Skip to content

Commit 9d86d86

Browse files
committed
Add comment for unusual placement of add_sysroot_artifact.
1 parent abe92bc commit 9d86d86

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

src/cargo/core/compiler/job_queue.rs

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

0 commit comments

Comments
 (0)