mirror of
https://github.com/rust-lang/rust.git
synced 2025-06-05 03:38:29 +00:00
Gate binary dependency information behind -Zbinary-dep-depinfo
This commit is contained in:
parent
eafb42dc94
commit
d749b5e223
@ -1468,6 +1468,8 @@ options! {DebuggingOptions, DebuggingSetter, basic_debugging_options,
|
|||||||
symbol_mangling_version: SymbolManglingVersion = (SymbolManglingVersion::Legacy,
|
symbol_mangling_version: SymbolManglingVersion = (SymbolManglingVersion::Legacy,
|
||||||
parse_symbol_mangling_version, [TRACKED],
|
parse_symbol_mangling_version, [TRACKED],
|
||||||
"which mangling version to use for symbol names"),
|
"which mangling version to use for symbol names"),
|
||||||
|
binary_dep_depinfo: bool = (false, parse_bool, [TRACKED],
|
||||||
|
"include artifacts (sysroot, crate dependencies) used during compilation in dep-info"),
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn default_lib_output() -> CrateType {
|
pub fn default_lib_output() -> CrateType {
|
||||||
|
@ -545,6 +545,9 @@ impl Session {
|
|||||||
pub fn print_llvm_passes(&self) -> bool {
|
pub fn print_llvm_passes(&self) -> bool {
|
||||||
self.opts.debugging_opts.print_llvm_passes
|
self.opts.debugging_opts.print_llvm_passes
|
||||||
}
|
}
|
||||||
|
pub fn binary_dep_depinfo(&self) -> bool {
|
||||||
|
self.opts.debugging_opts.binary_dep_depinfo
|
||||||
|
}
|
||||||
|
|
||||||
/// Gets the features enabled for the current compilation session.
|
/// Gets the features enabled for the current compilation session.
|
||||||
/// DO NOT USE THIS METHOD if there is a TyCtxt available, as it circumvents
|
/// DO NOT USE THIS METHOD if there is a TyCtxt available, as it circumvents
|
||||||
|
@ -677,6 +677,7 @@ fn write_out_deps(compiler: &Compiler, outputs: &OutputFilenames, out_filenames:
|
|||||||
.map(|fmap| escape_dep_filename(&fmap.name))
|
.map(|fmap| escape_dep_filename(&fmap.name))
|
||||||
.collect();
|
.collect();
|
||||||
|
|
||||||
|
if sess.binary_dep_depinfo() {
|
||||||
for cnum in compiler.cstore.crates_untracked() {
|
for cnum in compiler.cstore.crates_untracked() {
|
||||||
let metadata = compiler.cstore.crate_data_as_rc_any(cnum);
|
let metadata = compiler.cstore.crate_data_as_rc_any(cnum);
|
||||||
let metadata = metadata.downcast_ref::<cstore::CrateMetadata>().unwrap();
|
let metadata = metadata.downcast_ref::<cstore::CrateMetadata>().unwrap();
|
||||||
@ -690,6 +691,7 @@ fn write_out_deps(compiler: &Compiler, outputs: &OutputFilenames, out_filenames:
|
|||||||
files.push(escape_dep_filename(&FileName::Real(path.clone())));
|
files.push(escape_dep_filename(&FileName::Real(path.clone())));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
let mut file = fs::File::create(&deps_filename)?;
|
let mut file = fs::File::create(&deps_filename)?;
|
||||||
for path in out_filenames {
|
for path in out_filenames {
|
||||||
|
Loading…
Reference in New Issue
Block a user