Skip to content

does not build if HOST is not set #268

@matthiaskrgr

Description

@matthiaskrgr
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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions