Rollup merge of #93969 - bjorn3:codegen_backend_dep_info, r=pnkfelix
Only add codegen backend to dep info if -Zbinary-dep-depinfo is used I am currently migrating the cg_clif build system from using a binary linked to the codegen backend as rustc replacement to passing `-Zcodegen-backend` instead. Without this PR this would force cargo to rebuild the sysroot on any change to the codegen backend even if I explicitly specify that I want it to be preserved, which would make development of cg_clif a lot slower. If you still want to have changes to the codegen backend invalidate the cargo build cache you can explicitly specify `-Zbinary-dep-depinfo`. cc ``@eddyb`` as the codegen backend was initially added to the depinfo for rust-gpu.
This commit is contained in:
commit
d14bda48d5
2 changed files with 25 additions and 6 deletions
|
@ -629,11 +629,15 @@ fn write_out_deps(
|
|||
});
|
||||
files.extend(extra_tracked_files);
|
||||
|
||||
if let Some(ref backend) = sess.opts.debugging_opts.codegen_backend {
|
||||
files.push(backend.to_string());
|
||||
}
|
||||
|
||||
if sess.binary_dep_depinfo() {
|
||||
if let Some(ref backend) = sess.opts.debugging_opts.codegen_backend {
|
||||
if backend.contains('.') {
|
||||
// If the backend name contain a `.`, it is the path to an external dynamic
|
||||
// library. If not, it is not a path.
|
||||
files.push(backend.to_string());
|
||||
}
|
||||
}
|
||||
|
||||
boxed_resolver.borrow_mut().access(|resolver| {
|
||||
for cnum in resolver.cstore().crates_untracked() {
|
||||
let source = resolver.cstore().crate_source_untracked(cnum);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue