Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rename environment variable for overriding rustc version #92825

Merged
merged 1 commit into from
Jan 18, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion compiler/rustc_incremental/src/persist/file_format.rs
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ fn report_format_mismatch(report_incremental_info: bool, file: &Path, message: &

fn rustc_version(nightly_build: bool) -> String {
if nightly_build {
if let Some(val) = env::var_os("RUSTC_FORCE_INCR_COMP_ARTIFACT_HEADER") {
if let Some(val) = env::var_os("RUSTC_FORCE_RUSTC_VERSION") {
return val.to_string_lossy().into_owned();
}
}
Expand Down
4 changes: 2 additions & 2 deletions compiler/rustc_span/src/def_id.rs
Original file line number Diff line number Diff line change
Expand Up @@ -176,9 +176,9 @@ impl StableCrateId {
// and no -Cmetadata, symbols from the same crate compiled with different versions of
// rustc are named the same.
//
// RUSTC_FORCE_INCR_COMP_ARTIFACT_HEADER is used to inject rustc version information
// RUSTC_FORCE_RUSTC_VERSION is used to inject rustc version information
// during testing.
if let Some(val) = std::env::var_os("RUSTC_FORCE_INCR_COMP_ARTIFACT_HEADER") {
if let Some(val) = std::env::var_os("RUSTC_FORCE_RUSTC_VERSION") {
hasher.write(val.to_string_lossy().into_owned().as_bytes())
} else {
hasher.write(option_env!("CFG_VERSION").unwrap_or("unknown version").as_bytes());
Expand Down
2 changes: 1 addition & 1 deletion src/test/incremental/cache_file_headers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

// The `l33t haxx0r` Rust compiler is known to produce incr. comp. artifacts
// that are outrageously incompatible with just about anything, even itself:
//[rpass1] rustc-env:RUSTC_FORCE_INCR_COMP_ARTIFACT_HEADER="l33t haxx0r rustc 2.1 LTS"
//[rpass1] rustc-env:RUSTC_FORCE_RUSTC_VERSION="l33t haxx0r rustc 2.1 LTS"

// revisions:rpass1 rpass2
// compile-flags: -Z query-dep-graph
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ all:
$(RUSTC) b.rs --extern a=$(TMPDIR)/liba$(EXT) --crate-type=bin -Crpath $(FLAGS)
$(call RUN,b)
# Now re-compile a.rs with another rustc version
RUSTC_FORCE_INCR_COMP_ARTIFACT_HEADER=deadfeed $(RUSTC) a.rs --crate-type=dylib $(FLAGS)
RUSTC_FORCE_RUSTC_VERSION=deadfeed $(RUSTC) a.rs --crate-type=dylib $(FLAGS)
# After compiling with a different rustc version, write symbols to disk again.
$(NM_CMD) $(call DYLIB,a) > $(TMPDIR)/symbolsafter
# As a sanity check, test if the symbols changed:
Expand Down