-
-
Notifications
You must be signed in to change notification settings - Fork 147
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
Compile probe does not take Cargo rustc configuration into account #156
Comments
Ah, good call. I would accept a PR to fix this. |
Ooof, looks like those environment variables are only used to configure said settings. And the variables Cargo sets for build scripts does not include the wrapper nor rustflags. I'll follow up with the Cargo team. |
Filed rust-lang/cargo#9600 |
Submitted fix in rust-lang/cargo#9601, though this means we'll have to wait a while to actually implement this fix. |
jonhoo
pushed a commit
to jonhoo/anyhow
that referenced
this issue
Jun 18, 2021
Without this, environments that configure `RUSTFLAGS` or the `RUSTC_WRAPPER` in ways that break compilation with `backtrace` will fail to compile anyhow (see dtolnay#156). With this, the compiler probe takes into account that Cargo configuration, and thus (more) accurately represents whether the `backtrace` feature can be safely enabled. Requires rust-lang/cargo#9600. Fixes dtolnay#156.
This was referenced Jun 30, 2021
jonhoo
pushed a commit
to jonhoo/anyhow
that referenced
this issue
Aug 13, 2021
Without this, environments that configure `RUSTFLAGS` or the `RUSTC_WRAPPER` in ways that break compilation with `backtrace` will fail to compile anyhow (see dtolnay#156). With this, the compiler probe takes into account that Cargo configuration, and thus (more) accurately represents whether the `backtrace` feature can be safely enabled. Requires rust-lang/cargo#9601, but does not break without. Fixes dtolnay#156.
jonhoo
pushed a commit
to jonhoo/anyhow
that referenced
this issue
Aug 13, 2021
Without this, environments that configure `RUSTFLAGS` or the `RUSTC_WRAPPER` in ways that break compilation with `backtrace` will fail to compile anyhow (see dtolnay#156). With this, the compiler probe takes into account that Cargo configuration, and thus (more) accurately represents whether the `backtrace` feature can be safely enabled. Requires rust-lang/cargo#9601, but does not break without. Fixes dtolnay#156.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The compile probe just invokes
rustc
directly, without including relevant cargo configuration. This causes problems in environments where that configuration may change whether or not backtrace is available (or compiles):produces
Taking everything into account is probably too tall of an order, but the Cargo environment variables should get us pretty far. In particular, if set, anyhow should probably take into account these three:
CARGO_BUILD_RUSTC
CARGO_BUILD_RUSTC_WRAPPER
CARGO_BUILD_RUSTFLAGS
Together, those should encapsulate most of the rustc configuration in cargo.
The text was updated successfully, but these errors were encountered: