Skip to content

Commit

Permalink
Temporarily make the test cfg a well known bootstrap cfg
Browse files Browse the repository at this point in the history
  • Loading branch information
Urgau committed Oct 21, 2024
1 parent 56e96a6 commit bda2e89
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/bootstrap/src/core/builder/cargo.rs
Original file line number Diff line number Diff line change
Expand Up @@ -624,6 +624,8 @@ impl Builder<'_> {
// get warnings about it being unexpected.
hostflags.arg("-Zunstable-options");
hostflags.arg("--check-cfg=cfg(bootstrap)");
// #[cfg(bootstrap)] as we are transition `test` to userspace cfg
hostflags.arg("--check-cfg=cfg(test)");

// FIXME: It might be better to use the same value for both `RUSTFLAGS` and `RUSTDOCFLAGS`,
// but this breaks CI. At the very least, stage0 `rustdoc` needs `--cfg bootstrap`. See
Expand Down
2 changes: 2 additions & 0 deletions src/bootstrap/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,8 @@ const LLD_FILE_NAMES: &[&str] = &["ld.lld", "ld64.lld", "lld-link", "wasm-ld"];
#[allow(clippy::type_complexity)] // It's fine for hard-coded list and type is explained above.
const EXTRA_CHECK_CFGS: &[(Option<Mode>, &str, Option<&[&'static str]>)] = &[
(None, "bootstrap", None),
// #[cfg(bootstrap)] to be removed when Cargo is updated
(None, "test", None),
(Some(Mode::Rustc), "llvm_enzyme", None),
(Some(Mode::Codegen), "llvm_enzyme", None),
(Some(Mode::ToolRustc), "llvm_enzyme", None),
Expand Down

0 comments on commit bda2e89

Please sign in to comment.