]> git.proxmox.com Git - cargo.git/commitdiff
Add comment for unusual placement of add_sysroot_artifact.
authorEric Huss <eric@huss.org>
Tue, 24 Sep 2019 22:29:04 +0000 (15:29 -0700)
committerEric Huss <eric@huss.org>
Tue, 24 Sep 2019 22:29:04 +0000 (15:29 -0700)
src/cargo/core/compiler/job_queue.rs

index 2d324c2a23893c477052953d59690f6f0a01d6de..ef597aa0071b6966d32ca70c020ea39dab38fff0 100644 (file)
@@ -619,6 +619,19 @@ impl<'a, 'cfg> JobQueue<'a, 'cfg> {
             Artifact::Metadata => self.timings.unit_rmeta_finished(id, unlocked),
         }
         if unit.is_std && unit.kind == super::Kind::Target && !cx.bcx.build_config.build_plan {
+            // This is a bit of an unusual place to copy files around, and
+            // ideally this would be somewhere like the Work closure
+            // (`link_targets`). The tricky issue is handling rmeta files for
+            // pipelining. Since those are emitted asynchronously, the code
+            // path (like `on_stderr_line`) does not have enough information
+            // to know where the sysroot is, and that it is an std unit. If
+            // possible, it might be nice to eventually move this to the
+            // worker thread, but may be tricky to have the paths available.
+            // Another possibility is to disable pipelining between std ->
+            // non-std. The pipelining opportunities are small, and are not a
+            // huge win (in a full build, only proc_macro overlaps for 2
+            // seconds out of a 90s build on my system). Care must also be
+            // taken to properly copy these artifacts for Fresh units.
             let rmeta = artifact == Artifact::Metadata;
             standard_lib::add_sysroot_artifact(cx, unit, rmeta)?;
         }