From 9d86d8693248a5747377eb41584c6e863c5736ca Mon Sep 17 00:00:00 2001 From: Eric Huss Date: Tue, 24 Sep 2019 15:29:04 -0700 Subject: [PATCH] Add comment for unusual placement of add_sysroot_artifact. --- src/cargo/core/compiler/job_queue.rs | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/cargo/core/compiler/job_queue.rs b/src/cargo/core/compiler/job_queue.rs index 2d324c2a238..ef597aa0071 100644 --- a/src/cargo/core/compiler/job_queue.rs +++ b/src/cargo/core/compiler/job_queue.rs @@ -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)?; }