Skip to content

Commit

Permalink
Cleanup extra check configs in bootstrap
Browse files Browse the repository at this point in the history
 - `target_os=watchos`: no longer relevant because there are now proper
   targets `*-apple-watchos`
 - `target_arch=nvptx64`: `nvptx64-nvidia-cuda`
 - `target_arch=le32`: target was removed
   (rust-lang#45041)
 - `release`: was removed from rustfmt
   (rust-lang/rustfmt#5375 and
   rust-lang/rustfmt#5449)
 - `dont_compile_me`: was removed from stdarch
   (rust-lang/stdarch#1308)

Also made some external cfg exception mode clear and only activated for
rustc and rustc tools (as to not have the Standard Library
unintentionally depend on them).
  • Loading branch information
Urgau committed Jan 25, 2023
1 parent dde74fe commit a01a540
Showing 1 changed file with 8 additions and 14 deletions.
22 changes: 8 additions & 14 deletions src/bootstrap/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,6 @@ const EXTRA_CHECK_CFGS: &[(Option<Mode>, &'static str, Option<&[&'static str]>)]
(None, "bootstrap", None),
(Some(Mode::Rustc), "parallel_compiler", None),
(Some(Mode::ToolRustc), "parallel_compiler", None),
(Some(Mode::ToolRustc), "emulate_second_only_system", None),
(Some(Mode::Codegen), "parallel_compiler", None),
(Some(Mode::Std), "stdarch_intel_sde", None),
(Some(Mode::Std), "no_fp_fmt_parse", None),
Expand All @@ -214,18 +213,9 @@ const EXTRA_CHECK_CFGS: &[(Option<Mode>, &'static str, Option<&[&'static str]>)]
(Some(Mode::Std), "backtrace_in_libstd", None),
/* Extra values not defined in the built-in targets yet, but used in std */
(Some(Mode::Std), "target_env", Some(&["libnx"])),
(Some(Mode::Std), "target_os", Some(&["watchos"])),
(
Some(Mode::Std),
"target_arch",
Some(&["asmjs", "spirv", "nvptx", "nvptx64", "le32", "xtensa"]),
),
// (Some(Mode::Std), "target_os", Some(&[])),
(Some(Mode::Std), "target_arch", Some(&["asmjs", "spirv", "nvptx", "xtensa"])),
/* Extra names used by dependencies */
// FIXME: Used by rustfmt is their test but is invalid (neither cargo nor bootstrap ever set
// this config) should probably by removed or use a allow attribute.
(Some(Mode::ToolRustc), "release", None),
// FIXME: Used by stdarch in their test, should use a allow attribute instead.
(Some(Mode::Std), "dont_compile_me", None),
// FIXME: Used by serde_json, but we should not be triggering on external dependencies.
(Some(Mode::Rustc), "no_btreemap_remove_entry", None),
(Some(Mode::ToolRustc), "no_btreemap_remove_entry", None),
Expand All @@ -235,8 +225,12 @@ const EXTRA_CHECK_CFGS: &[(Option<Mode>, &'static str, Option<&[&'static str]>)]
// FIXME: Used by proc-macro2, but we should not be triggering on external dependencies.
(Some(Mode::Rustc), "span_locations", None),
(Some(Mode::ToolRustc), "span_locations", None),
// Can be passed in RUSTFLAGS to prevent direct syscalls in rustix.
(None, "rustix_use_libc", None),
// FIXME: Used by rustix, but we should not be triggering on external dependencies.
(Some(Mode::Rustc), "rustix_use_libc", None),
(Some(Mode::ToolRustc), "rustix_use_libc", None),
// FIXME: Used by filetime, but we should not be triggering on external dependencies.
(Some(Mode::Rustc), "emulate_second_only_system", None),
(Some(Mode::ToolRustc), "emulate_second_only_system", None),
];

/// A structure representing a Rust compiler.
Expand Down

0 comments on commit a01a540

Please sign in to comment.