Skip to content

Commit

Permalink
Rollup merge of rust-lang#100532 - RalfJung:unwind-miri, r=Mark-Simul…
Browse files Browse the repository at this point in the history
…acrum

unwind: don't build dependency when building for Miri

This is basically re-submitting rust-lang#94813.

In that PR there was a suggestion to instead have bootstrap set a `RUST_CHECK` env var and use that rather than doing something Miri-specific. However, such an env var would mean that when switching between `./x.py check` and `./x.py build`, the build script gets re-run each time, which doesn't seem good. So I think for now checking for Miri probably causes fewer problems.

r? ``@Mark-Simulacrum``
  • Loading branch information
TaKO8Ki authored Aug 17, 2022
2 parents 17eb749 + 63113c8 commit bc60f1e
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion library/unwind/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,14 @@ use std::env;

fn main() {
println!("cargo:rerun-if-changed=build.rs");
let target = env::var("TARGET").expect("TARGET was not set");
println!("cargo:rerun-if-env-changed=CARGO_CFG_MIRI");

if env::var_os("CARGO_CFG_MIRI").is_some() {
// Miri doesn't need the linker flags or a libunwind build.
return;
}

let target = env::var("TARGET").expect("TARGET was not set");
if target.contains("android") {
let build = cc::Build::new();

Expand Down

0 comments on commit bc60f1e

Please sign in to comment.