mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-22 14:55:26 +00:00
Rename environment variable for overriding rustc version
This commit is contained in:
parent
72e74d7b9c
commit
68515cb668
@ -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();
|
||||
}
|
||||
}
|
||||
|
@ -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());
|
||||
|
@ -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
|
||||
|
@ -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:
|
||||
|
Loading…
Reference in New Issue
Block a user