Skip to content

Commit

Permalink
Add comment for unusual placement of add_sysroot_artifact.
Browse files Browse the repository at this point in the history
  • Loading branch information
ehuss committed Sep 24, 2019
1 parent abe92bc commit 9d86d86
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/cargo/core/compiler/job_queue.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)?;
}
Expand Down

0 comments on commit 9d86d86

Please sign in to comment.