Auto merge of #930 - RalfJung:build, r=RalfJung

test that build scripts do not run in Miri

@elichai reported something that sounded a lot like build script running in Miri. But as this test shows, build scripts are not run by Miri, they are run normally.

@elichai are you sure the [env var usage you were referring to](https://github.com/rust-lang/miri/issues/641#issuecomment-524989482) was only in a build script? Those shouldn't be affected by Miri flags at all. Is your code available somewhere so that I can try to reproduce?
This commit is contained in:
bors 2019-08-28 20:23:39 +00:00
commit 26615807de
2 changed files with 15 additions and 1 deletions

View file

@ -5,7 +5,6 @@ license = "MIT/Apache-2.0"
name = "miri"
repository = "https://github.com/rust-lang/miri"
version = "0.1.0"
build = "build.rs"
default-run = "miri"
edition = "2018"

15
test-cargo-miri/build.rs Normal file
View file

@ -0,0 +1,15 @@
#![feature(asm)]
fn not_in_miri() -> i32 {
// Inline assembly definitely does not work in Miri.
let dummy = 42;
unsafe {
asm!("" : : "r"(&dummy));
}
return dummy;
}
fn main() {
not_in_miri();
println!("cargo:rerun-if-changed=build.rs");
}