compiletest-rs icon indicating copy to clipboard operation
compiletest-rs copied to clipboard

does not build if HOST is not set

Open matthiaskrgr opened this issue 1 year ago • 1 comments

error: environment variable `HOST` not defined at compile time
   --> /home/matthias/.cargo/registry/src/index.crates.io-6f17d22bba15001f/compiletest_rs-0.10.0/src/common.rs:402:19
    |
402 |             host: env!("HOST").to_string(),
    |                   ^^^^^^^^^^^^
    |
    = help: Cargo sets build script variables at run time. Use `std::env::var("HOST")` instead
    = note: this error originates in the macro `env` (in Nightly builds, run with -Z macro-backtrace for more info)

error: could not compile `compiletest_rs` (lib) due to previous error

this currently breaks tests of clippy and rustcs x.py check Workaround is to run HOST="" cargo test or HOST="" ./x.py check. I wonder why this is needed at all, what is compiletest expecting here? Can we use option_env and unwrap_or_default maybe?

matthiaskrgr avatar May 21 '23 07:05 matthiaskrgr