Rollup merge of #92825 - pierwill:rustc-version-force-rename, r=Mark-Simulacrum
Rename environment variable for overriding rustc version
This commit is contained in:
commit
6acb7043e7
4 changed files with 5 additions and 5 deletions
|
@ -190,7 +190,7 @@ fn report_format_mismatch(report_incremental_info: bool, file: &Path, message: &
|
||||||
|
|
||||||
fn rustc_version(nightly_build: bool) -> String {
|
fn rustc_version(nightly_build: bool) -> String {
|
||||||
if nightly_build {
|
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();
|
return val.to_string_lossy().into_owned();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -176,9 +176,9 @@ impl StableCrateId {
|
||||||
// and no -Cmetadata, symbols from the same crate compiled with different versions of
|
// and no -Cmetadata, symbols from the same crate compiled with different versions of
|
||||||
// rustc are named the same.
|
// 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.
|
// 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())
|
hasher.write(val.to_string_lossy().into_owned().as_bytes())
|
||||||
} else {
|
} else {
|
||||||
hasher.write(option_env!("CFG_VERSION").unwrap_or("unknown version").as_bytes());
|
hasher.write(option_env!("CFG_VERSION").unwrap_or("unknown version").as_bytes());
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
|
|
||||||
// The `l33t haxx0r` Rust compiler is known to produce incr. comp. artifacts
|
// The `l33t haxx0r` Rust compiler is known to produce incr. comp. artifacts
|
||||||
// that are outrageously incompatible with just about anything, even itself:
|
// 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
|
// revisions:rpass1 rpass2
|
||||||
// compile-flags: -Z query-dep-graph
|
// compile-flags: -Z query-dep-graph
|
||||||
|
|
|
@ -27,7 +27,7 @@ all:
|
||||||
$(RUSTC) b.rs --extern a=$(TMPDIR)/liba$(EXT) --crate-type=bin -Crpath $(FLAGS)
|
$(RUSTC) b.rs --extern a=$(TMPDIR)/liba$(EXT) --crate-type=bin -Crpath $(FLAGS)
|
||||||
$(call RUN,b)
|
$(call RUN,b)
|
||||||
# Now re-compile a.rs with another rustc version
|
# 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.
|
# After compiling with a different rustc version, write symbols to disk again.
|
||||||
$(NM_CMD) $(call DYLIB,a) > $(TMPDIR)/symbolsafter
|
$(NM_CMD) $(call DYLIB,a) > $(TMPDIR)/symbolsafter
|
||||||
# As a sanity check, test if the symbols changed:
|
# As a sanity check, test if the symbols changed:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue