Skip to content

Commit 2661580

Browse files
committed
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](#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?
2 parents 283928a + 7faa329 commit 2661580

File tree

2 files changed

+15
-1
lines changed

2 files changed

+15
-1
lines changed

Cargo.toml

-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ license = "MIT/Apache-2.0"
55
name = "miri"
66
repository = "https://github.com/rust-lang/miri"
77
version = "0.1.0"
8-
build = "build.rs"
98
default-run = "miri"
109
edition = "2018"
1110

test-cargo-miri/build.rs

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
#![feature(asm)]
2+
3+
fn not_in_miri() -> i32 {
4+
// Inline assembly definitely does not work in Miri.
5+
let dummy = 42;
6+
unsafe {
7+
asm!("" : : "r"(&dummy));
8+
}
9+
return dummy;
10+
}
11+
12+
fn main() {
13+
not_in_miri();
14+
println!("cargo:rerun-if-changed=build.rs");
15+
}

0 commit comments

Comments
 (0)