Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

does not build if HOST is not set #268

Open
matthiaskrgr opened this issue May 21, 2023 · 1 comment
Open

does not build if HOST is not set #268

matthiaskrgr opened this issue May 21, 2023 · 1 comment

Comments

@matthiaskrgr
Copy link

matthiaskrgr commented May 21, 2023

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?

@thomcc
Copy link
Contributor

thomcc commented May 22, 2023

This also breaks use with sccache: mozilla/sccache#1766

@matthiaskrgr matthiaskrgr changed the title does buit build if HOST is not set does not build if HOST is not set May 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants