diff options
| author | bors <bors@rust-lang.org> | 2023-05-18 21:45:02 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2023-05-18 21:45:02 +0000 |
| commit | c9dc55d05c9a111300271b7f8b8f62220ce9ad1e (patch) | |
| tree | cfb1c94a9592cd57a5f53e22829813c80e218504 /compiler/rustc_interface/src | |
| parent | d3f416dc063fc478c7250873246cb2d4136d8c42 (diff) | |
| parent | d5f2b8e5c65b0406254b990296793f664c1926a0 (diff) | |
| download | rust-c9dc55d05c9a111300271b7f8b8f62220ce9ad1e.tar.gz rust-c9dc55d05c9a111300271b7f8b8f62220ce9ad1e.zip | |
Auto merge of #111345 - jyn514:cfg-release-caching, r=cjgillot,est31
Only depend on CFG_VERSION in rustc_interface This avoids having to rebuild the whole compiler on each commit when `omit-git-hash = false`. cc https://github.com/rust-lang/rust/issues/76720 - this won't fix it, and I'm not suggesting we turn this on by default, but it will make it less painful for people who do have `omit-git-hash` on as a workaround.
Diffstat (limited to 'compiler/rustc_interface/src')
| -rw-r--r-- | compiler/rustc_interface/src/passes.rs | 1 | ||||
| -rw-r--r-- | compiler/rustc_interface/src/queries.rs | 2 | ||||
| -rw-r--r-- | compiler/rustc_interface/src/tests.rs | 3 | ||||
| -rw-r--r-- | compiler/rustc_interface/src/util.rs | 1 |
4 files changed, 5 insertions, 2 deletions
diff --git a/compiler/rustc_interface/src/passes.rs b/compiler/rustc_interface/src/passes.rs index bbf9d9d515d..ec3a782e7d2 100644 --- a/compiler/rustc_interface/src/passes.rs +++ b/compiler/rustc_interface/src/passes.rs @@ -89,6 +89,7 @@ pub fn register_plugins<'a>( crate_name, sess.crate_types().contains(&CrateType::Executable), sess.opts.cg.metadata.clone(), + sess.cfg_version, ); sess.stable_crate_id.set(stable_crate_id).expect("not yet initialized"); rustc_incremental::prepare_session_directory(sess, crate_name, stable_crate_id)?; diff --git a/compiler/rustc_interface/src/queries.rs b/compiler/rustc_interface/src/queries.rs index 6483d51a0b9..c441a8ffd6f 100644 --- a/compiler/rustc_interface/src/queries.rs +++ b/compiler/rustc_interface/src/queries.rs @@ -369,7 +369,7 @@ impl Linker { if sess.opts.unstable_opts.no_link { let rlink_file = self.prepare_outputs.with_extension(config::RLINK_EXT); - CodegenResults::serialize_rlink(&rlink_file, &codegen_results) + CodegenResults::serialize_rlink(sess, &rlink_file, &codegen_results) .map_err(|error| sess.emit_fatal(FailedWritingFile { path: &rlink_file, error }))?; return Ok(()); } diff --git a/compiler/rustc_interface/src/tests.rs b/compiler/rustc_interface/src/tests.rs index 1bae771e373..28e719a40e5 100644 --- a/compiler/rustc_interface/src/tests.rs +++ b/compiler/rustc_interface/src/tests.rs @@ -52,7 +52,8 @@ fn mk_session(matches: getopts::Matches) -> (Session, CfgSpecs) { output_file: None, temps_dir, }; - let sess = build_session(sessopts, io, None, registry, vec![], Default::default(), None, None); + let sess = + build_session(sessopts, io, None, registry, vec![], Default::default(), None, None, ""); (sess, cfg) } diff --git a/compiler/rustc_interface/src/util.rs b/compiler/rustc_interface/src/util.rs index 910cafff769..cb19750203e 100644 --- a/compiler/rustc_interface/src/util.rs +++ b/compiler/rustc_interface/src/util.rs @@ -104,6 +104,7 @@ pub fn create_session( lint_caps, file_loader, target_override, + rustc_version_str().unwrap_or("unknown"), ); codegen_backend.init(&sess); |
