}
if !attempted_run {
- panic!("error: no rules matched {}", path.display());
+ eprintln!(
+ "error: no `{}` rules matched '{}'",
+ builder.kind.as_str(),
+ path.display()
+ );
+ eprintln!(
+ "help: run `x.py {} --help --verbose` to show a list of available paths",
+ builder.kind.as_str()
+ );
+ eprintln!(
+ "note: if you are adding a new Step to bootstrap itself, make sure you register it with `describe!`"
+ );
+ std::process::exit(1);
}
}
}
native::Lld,
native::CrtBeginEnd
),
- Kind::Check => describe!(
+ Kind::Check | Kind::Clippy | Kind::Fix => describe!(
check::Std,
check::Rustc,
check::Rustdoc,
),
Kind::Run => describe!(run::ExpandYamlAnchors, run::BuildManifest, run::BumpStage0),
// These commands either don't use paths, or they're special-cased in Build::build()
- Kind::Clean | Kind::Clippy | Kind::Fix | Kind::Format | Kind::Setup => vec![],
+ Kind::Clean | Kind::Format | Kind::Setup => vec![],
}
}
rustflags.arg("-Zunstable-options");
}
- // #[cfg(not(bootstrap)]
+ // FIXME(Urgau): This a hack as it shouldn't be gated on stage 0 but until `rustc_llvm`
+ // is made to work with `--check-cfg` which is currently not easly possible until cargo
+ // get some support for setting `--check-cfg` within build script, it's the least invasive
+ // hack that still let's us have cfg checking for the vast majority of the codebase.
if stage != 0 {
- // Enable cfg checking of cargo features
- // FIXME: De-comment this when cargo beta get support for it
- // cargo.arg("-Zcheck-cfg-features");
-
- // Enable cfg checking of rustc well-known names
+ // Enable cfg checking of cargo features for everything but std.
+ //
+ // Note: `std`, `alloc` and `core` imports some dependencies by #[path] (like
+ // backtrace, core_simd, std_float, ...), those dependencies have their own features
+ // but cargo isn't involved in the #[path] and so cannot pass the complete list of
+ // features, so for that reason we don't enable checking of features for std.
+ //
+ // FIXME: Re-enable this after the beta bump as apperently rustc-perf doesn't use the
+ // beta cargo. See https://github.com/rust-lang/rust/pull/96984#issuecomment-1126678773
+ // #[cfg(not(bootstrap))]
+ // if mode != Mode::Std {
+ // cargo.arg("-Zcheck-cfg-features"); // -Zcheck-cfg=features after bump
+ // }
+
+ // Enable cfg checking of well known names/values
rustflags
.arg("-Zunstable-options")
// Enable checking of well known names
// FIXME(davidtwco): #[cfg(not(bootstrap))] - #95612 needs to be in the bootstrap compiler
// for this conditional to be removed.
if !target.contains("windows") || compiler.stage >= 1 {
- if target.contains("linux") || target.contains("windows") || target.contains("openbsd")
- {
+ let needs_unstable_opts = target.contains("linux")
+ || target.contains("windows")
+ || target.contains("bsd")
+ || target.contains("dragonfly");
+
+ if needs_unstable_opts {
rustflags.arg("-Zunstable-options");
}
match self.config.rust_split_debuginfo {