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

Rollup of 10 pull requests #133770

Merged
merged 28 commits into from
Dec 3, 2024
Merged
Changes from 1 commit
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
41c3b5c
show forbidden_lint_groups in future-compat reports
RalfJung Nov 27, 2024
20630c5
add "profiler" option coverage for ci-rustc
onur-ozkan Dec 1, 2024
a17294d
fix ICE when promoted has layout size overflow
RalfJung Dec 1, 2024
85e4765
Add specific test for check-cfg "and X more" diagnostic
Urgau Nov 29, 2024
1c4657d
compiletest: un-escape new-line in normalize replacement string
Urgau Dec 1, 2024
d37ed10
Fix crash with `-Zdump-mir-dataflow`
nnethercote Nov 28, 2024
9f2f690
Add test for `-Zdump-mir-dataflow`.
nnethercote Dec 1, 2024
cecef13
Simplify `ResultsHandle`.
nnethercote Dec 1, 2024
99e726b
add "optimized-compiler-builtins" option coverage for ci-rustc
onur-ozkan Dec 2, 2024
778321d
Change `AttrArgs::Eq` into a struct variant
oli-obk Dec 2, 2024
c0b5322
Add a helper method for extracting spans from AttrArgsEq
oli-obk Dec 2, 2024
da182b6
Deduplicate some matches that always panic in one arm
oli-obk Dec 2, 2024
43bed16
Reduce conflicts for check-cfg `target_feature` cfg values
Urgau Dec 1, 2024
72297d4
Fix `f16::midpoint` const feature gate
Urgau Dec 2, 2024
eadea77
Use c"lit" for CStrings without unwrap
kornelski Nov 30, 2024
c5fedc2
Stabilize `const_maybe_uninit_write`
tgross35 Oct 14, 2024
277e049
Move `Const::{from_anon_const,try_from_lit}` to hir_ty_lowering
camelid Nov 29, 2024
dcf332b
Fix broken intra-doc link
camelid Nov 29, 2024
e56e685
Rollup merge of #131713 - tgross35:stabilize-const_maybe_uninit_write…
GuillaumeGomez Dec 2, 2024
f79e09c
Rollup merge of #133535 - RalfJung:forbidden_lint_groups-future-compa…
GuillaumeGomez Dec 2, 2024
6f0d15a
Rollup merge of #133610 - camelid:move-from_anon_const, r=BoxyUwU
GuillaumeGomez Dec 2, 2024
65b0dad
Rollup merge of #133701 - kornelski:c-str, r=workingjubilee
GuillaumeGomez Dec 2, 2024
b1a643e
Rollup merge of #133704 - RalfJung:promoted-size-overflow-ice, r=comp…
GuillaumeGomez Dec 2, 2024
7d67af9
Rollup merge of #133705 - onur-ozkan:profiler-check, r=jieyouxu
GuillaumeGomez Dec 2, 2024
8a26a8b
Rollup merge of #133710 - Urgau:target_feature-merge-conflitcs, r=jie…
GuillaumeGomez Dec 2, 2024
3586e4a
Rollup merge of #133732 - nnethercote:fix-Z-dump-mir-dataflow, r=comp…
GuillaumeGomez Dec 2, 2024
6f9f17f
Rollup merge of #133746 - oli-obk:push-xwyrylxmrtvq, r=jieyouxu
GuillaumeGomez Dec 2, 2024
73f225a
Rollup merge of #133763 - Urgau:f16-midpoint-const-feat, r=Amanieu
GuillaumeGomez Dec 2, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
add "profiler" option coverage for ci-rustc
Signed-off-by: onur-ozkan <work@onurozkan.dev>
  • Loading branch information
onur-ozkan committed Dec 1, 2024
commit 20630c54aa416b6fc7282ac3555b45122a948d89
70 changes: 46 additions & 24 deletions src/bootstrap/src/core/config/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2505,6 +2505,7 @@ impl Config {
// Check the config compatibility
// FIXME: this doesn't cover `--set` flags yet.
let res = check_incompatible_options_for_ci_rustc(
self.build,
current_config_toml,
ci_config_toml,
);
Expand Down Expand Up @@ -3086,17 +3087,18 @@ pub(crate) fn check_incompatible_options_for_ci_llvm(
/// Compares the current Rust options against those in the CI rustc builder and detects any incompatible options.
/// It does this by destructuring the `Rust` instance to make sure every `Rust` field is covered and not missing.
fn check_incompatible_options_for_ci_rustc(
host: TargetSelection,
current_config_toml: TomlConfig,
ci_config_toml: TomlConfig,
) -> Result<(), String> {
macro_rules! err {
($current:expr, $expected:expr) => {
($current:expr, $expected:expr, $config_section:expr) => {
if let Some(current) = &$current {
if Some(current) != $expected.as_ref() {
return Err(format!(
"ERROR: Setting `rust.{}` is incompatible with `rust.download-rustc`. \
"ERROR: Setting `{}` is incompatible with `rust.download-rustc`. \
Current value: {:?}, Expected value(s): {}{:?}",
stringify!($expected).replace("_", "-"),
format!("{}.{}", $config_section, stringify!($expected).replace("_", "-")),
$current,
if $expected.is_some() { "None/" } else { "" },
$expected,
Expand All @@ -3107,13 +3109,13 @@ fn check_incompatible_options_for_ci_rustc(
}

macro_rules! warn {
($current:expr, $expected:expr) => {
($current:expr, $expected:expr, $config_section:expr) => {
if let Some(current) = &$current {
if Some(current) != $expected.as_ref() {
println!(
"WARNING: `rust.{}` has no effect with `rust.download-rustc`. \
"WARNING: `{}` has no effect with `rust.download-rustc`. \
Current value: {:?}, Expected value(s): {}{:?}",
stringify!($expected).replace("_", "-"),
format!("{}.{}", $config_section, stringify!($expected).replace("_", "-")),
$current,
if $expected.is_some() { "None/" } else { "" },
$expected,
Expand All @@ -3123,6 +3125,26 @@ fn check_incompatible_options_for_ci_rustc(
};
}

err!(
current_config_toml.build.as_ref().and_then(|b| b.profiler),
ci_config_toml.build.as_ref().and_then(|b| b.profiler),
"build"
);

// We always build the in-tree compiler on cross targets, so we only care
// about the host target here.
let host_str = host.to_string();
if let Some(current_cfg) = current_config_toml.target.as_ref().and_then(|c| c.get(&host_str)) {
if current_cfg.profiler.is_some() {
let ci_target_toml = ci_config_toml.target.as_ref().and_then(|c| c.get(&host_str));
let ci_cfg = ci_target_toml.ok_or(format!(
"Target specific config for '{host_str}' is not present for CI-rustc"
))?;

err!(current_cfg.profiler, ci_cfg.profiler, "build");
}
}

let (Some(current_rust_config), Some(ci_rust_config)) =
(current_config_toml.rust, ci_config_toml.rust)
else {
Expand Down Expand Up @@ -3196,24 +3218,24 @@ fn check_incompatible_options_for_ci_rustc(
// If the option belongs to the first category, we call `err` macro for a hard error;
// otherwise, we just print a warning with `warn` macro.

err!(current_rust_config.optimize, optimize);
err!(current_rust_config.randomize_layout, randomize_layout);
err!(current_rust_config.debug_logging, debug_logging);
err!(current_rust_config.debuginfo_level_rustc, debuginfo_level_rustc);
err!(current_rust_config.rpath, rpath);
err!(current_rust_config.strip, strip);
err!(current_rust_config.lld_mode, lld_mode);
err!(current_rust_config.llvm_tools, llvm_tools);
err!(current_rust_config.llvm_bitcode_linker, llvm_bitcode_linker);
err!(current_rust_config.jemalloc, jemalloc);
err!(current_rust_config.default_linker, default_linker);
err!(current_rust_config.stack_protector, stack_protector);
err!(current_rust_config.lto, lto);
err!(current_rust_config.std_features, std_features);

warn!(current_rust_config.channel, channel);
warn!(current_rust_config.description, description);
warn!(current_rust_config.incremental, incremental);
err!(current_rust_config.optimize, optimize, "rust");
err!(current_rust_config.randomize_layout, randomize_layout, "rust");
err!(current_rust_config.debug_logging, debug_logging, "rust");
err!(current_rust_config.debuginfo_level_rustc, debuginfo_level_rustc, "rust");
err!(current_rust_config.rpath, rpath, "rust");
err!(current_rust_config.strip, strip, "rust");
err!(current_rust_config.lld_mode, lld_mode, "rust");
err!(current_rust_config.llvm_tools, llvm_tools, "rust");
err!(current_rust_config.llvm_bitcode_linker, llvm_bitcode_linker, "rust");
err!(current_rust_config.jemalloc, jemalloc, "rust");
err!(current_rust_config.default_linker, default_linker, "rust");
err!(current_rust_config.stack_protector, stack_protector, "rust");
err!(current_rust_config.lto, lto, "rust");
err!(current_rust_config.std_features, std_features, "rust");

warn!(current_rust_config.channel, channel, "rust");
warn!(current_rust_config.description, description, "rust");
warn!(current_rust_config.incremental, incremental, "rust");

Ok(())
}
Expand Down
Loading