-
Notifications
You must be signed in to change notification settings - Fork 13.2k
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
improvements on build_steps::test
implementation
#135887
Conversation
Signed-off-by: onur-ozkan <work@onurozkan.dev>
Signed-off-by: onur-ozkan <work@onurozkan.dev>
Signed-off-by: onur-ozkan <work@onurozkan.dev>
rustbot has assigned @Mark-Simulacrum. Use |
This PR modifies If appropriate, please update |
if let Some(flags) = option_env!("RUSTFLAGS") { | ||
// Use the same rustc flags for testing as for "normal" compilation, | ||
// so that Cargo doesn’t recompile the entire dependency graph every time: | ||
// /~https://github.com/rust-lang/rust/issues/49215 | ||
cmd.env("RUSTFLAGS", flags); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note: this is already handled from Cargo
with
rust/src/bootstrap/src/core/builder/cargo.rs
Lines 27 to 31 in b2728d5
fn new(target: TargetSelection) -> Rustflags { | |
let mut ret = Rustflags(String::new(), target); | |
ret.propagate_cargo_env("RUSTFLAGS"); | |
ret | |
} |
@@ -92,7 +92,7 @@ fn detect_src_and_out() { | |||
// `{build-dir}/bootstrap/debug/deps/bootstrap-c7ee91d5661e2804` | |||
// `{build-dir}` can be anywhere, not just in the rust project directory. | |||
let dep = Path::new(args.first().unwrap()); | |||
let expected_out = dep.ancestors().nth(4).unwrap(); | |||
let expected_out = dep.ancestors().nth(5).unwrap(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Output path now also includes the host triple as bootstrap passes that regardless even for non-cross builds
rust/src/bootstrap/src/core/builder/cargo.rs
Lines 415 to 416 in b2728d5
if cmd_kind != Kind::Install { | |
cargo.arg("--target").arg(target.rustc_target_arg()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, this is a nice cleanup. I tried some basic sanity checks like ./x test bootstrap
and ./x test run-make-support
, and they behaved as expected.
@bors r+ rollup |
…=jieyouxu improvements on `build_steps::test` implementation Reviewing commits one-by-one should make it easier to understand.
Rollup of 10 pull requests Successful merges: - rust-lang#134746 (Don't ICE in coerce when autoderef fails to structurally normalize non-WF type in new solver) - rust-lang#135552 ([AIX] Lint on structs that have a different alignment in AIX's C ABI) - rust-lang#135764 (Fix tests on LLVM 20) - rust-lang#135779 (CI: free disk on linux arm runner) - rust-lang#135790 (Update windows-gnu targets to set `DebuginfoKind::DWARF`) - rust-lang#135879 (fix outdated file path ref in llvm) - rust-lang#135883 (Remove erroneous `unsafe` in `BTreeSet::upper_bound_mut`) - rust-lang#135884 (remove implied end of slice) - rust-lang#135887 (improvements on `build_steps::test` implementation) - rust-lang#135898 (rustdoc-json-types: Finalize dyn compatibility renaming) r? `@ghost` `@rustbot` modify labels: rollup
…iaskrgr Rollup of 9 pull requests Successful merges: - rust-lang#134746 (Don't ICE in coerce when autoderef fails to structurally normalize non-WF type in new solver) - rust-lang#135552 ([AIX] Lint on structs that have a different alignment in AIX's C ABI) - rust-lang#135779 (CI: free disk on linux arm runner) - rust-lang#135790 (Update windows-gnu targets to set `DebuginfoKind::DWARF`) - rust-lang#135879 (fix outdated file path ref in llvm) - rust-lang#135883 (Remove erroneous `unsafe` in `BTreeSet::upper_bound_mut`) - rust-lang#135884 (remove implied end of slice) - rust-lang#135887 (improvements on `build_steps::test` implementation) - rust-lang#135898 (rustdoc-json-types: Finalize dyn compatibility renaming) r? `@ghost` `@rustbot` modify labels: rollup
Reviewing commits one-by-one should make it easier to understand.