Skip to content

Commit

Permalink
Auto merge of #930 - RalfJung:build, r=RalfJung
Browse files Browse the repository at this point in the history
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](#641 (comment)) 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?
  • Loading branch information
bors committed Aug 28, 2019
2 parents 283928a + 7faa329 commit 2661580
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
1 change: 0 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down
15 changes: 15 additions & 0 deletions test-cargo-miri/build.rs
Original file line number Diff line number Diff line change
@@ -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");
}

0 comments on commit 2661580

Please sign in to comment.