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

RUSTFLAGS is gone #293

Closed
dtolnay opened this issue Jul 23, 2021 · 0 comments · Fixed by #294
Closed

RUSTFLAGS is gone #293

dtolnay opened this issue Jul 23, 2021 · 0 comments · Fixed by #294

Comments

@dtolnay
Copy link
Owner

dtolnay commented Jul 23, 2021

It appears Cargo is no longer propagating RUSTFLAGS into the build script execution as of nightly-2021-07-22.

// build.rs

use std::env;
use std::io::{self, Write};
use std::process;

fn main() {
    let _ = writeln!(io::stderr(), "{:?}", env::var_os("RUSTFLAGS"));
    process::exit(1);
}
$ RUSTFLAGS='-Z allow-features=' cargo +nightly-2021-07-21 check
  --- stderr
  Some("-Z allow-features=")

$ RUSTFLAGS='-Z allow-features=' cargo +nightly-2021-07-22 check
  --- stderr
  None

That currently breaks this CI build:

https://github.com/alexcrichton/proc-macro2/blob/e71bc70db21eb6f217d8ed9f8ece0d53ba7cfac5/.github/workflows/ci.yml#L46

due to this logic not being able to observe that RUSTFLAGS value:

https://github.com/alexcrichton/proc-macro2/blob/e71bc70db21eb6f217d8ed9f8ece0d53ba7cfac5/build.rs#L135

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

Successfully merging a pull request may close this issue.

1 participant