Skip to content

Run mir-opt panic=abort tests on CI - #160200

Open
Kobzol wants to merge 3 commits into
rust-lang:mainfrom
Kobzol:mir-opt-panic-abort-on-ci
Open

Run mir-opt panic=abort tests on CI#160200
Kobzol wants to merge 3 commits into
rust-lang:mainfrom
Kobzol:mir-opt-panic-abort-on-ci

Conversation

@Kobzol

@Kobzol Kobzol commented Jul 30, 2026

Copy link
Copy Markdown
Member

@rustbot rustbot added A-testsuite Area: The testsuite used to check the correctness of rustc S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Jul 30, 2026
@rustbot

rustbot commented Jul 30, 2026

Copy link
Copy Markdown
Collaborator

RalfJung is not on the review rotation at the moment.
They may take a while to respond.

@rust-log-analyzer

This comment has been minimized.

And only include the target name when rendering test metadata, to avoid including filenames in it.
@jieyouxu

Copy link
Copy Markdown
Member

cf. #154607

@jieyouxu jieyouxu self-assigned this Jul 30, 2026
Comment on lines +2131 to +2133
let panic_abort_target = builder
.ensure(MirOptPanicAbortSyntheticTarget { compiler: self.compiler, base: self.target });
run(panic_abort_target);

@jieyouxu jieyouxu Jul 30, 2026

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Question: hm, could we have this show up in a step resolution snapshot?

View changes since the review

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We have it shown in the step snapshot tests. Do you want to separate it so that instead of running mir-opt directly within the step, we generate two steps, one without mir-opt and another with mir-opt? And when blessing, we move the generation of additional steps to make_run?

@RalfJung

Copy link
Copy Markdown
Member

I don't know nearly enough about bootstrap to review this.^^
@rustbot reroll

@rustbot rustbot assigned jackh726 and unassigned RalfJung and jieyouxu Jul 30, 2026
// Now also run the tests for the host with panic=abort
let panic_abort_target = builder
.ensure(MirOptPanicAbortSyntheticTarget { compiler: self.compiler, base: self.target });
run(panic_abort_target);

@RalfJung RalfJung Jul 30, 2026

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will be redundant with --bless I think?
mir-opt --bless already takes very long due to all the sysroots it is building, I'd prefer it not to become even slower.

View changes since the review

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is only redundant if the host target matches the hardcoded targets we have below. I can add an if condition to skip them if they match the host target.

That being said, if the stdlib it built, re-running the tests again should be very fast, they will just be ignored.

@RalfJung RalfJung Jul 30, 2026

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is always redundant. There are only 4 actually distinct configurations, so running more than 4 targets on --bless is redundant.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see, so the target doesn't really matter, the only thing that matters is bitwidth and the panic strategy? Yeah, in that case I will try to optimize it to always run 2 targets when not blessing, and 4 targets when blessing.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah.

When checking it's good to check the actual self.target to ensure CI covers them all. But in principle only the bitwidth and panic strategy should matter.

@jieyouxu jieyouxu assigned jieyouxu and unassigned jackh726 Jul 30, 2026
@RalfJung

Copy link
Copy Markdown
Member

Cc @saethlin

@RalfJung

Copy link
Copy Markdown
Member

The existing behavior of --bless is kind of annoying since it takes so long to build all these sysroots... and it actually builds 5 sysroots when 4 should be enough. (With this PR as-is it'd become 6 sysroots!) Not sure if there is something we could improve there. Does bootstrap know whether self.target is a 32bit target or 64bit target? If yes, we could bless

  • current target
  • current target with panic=abort
  • target of other bitwidth
  • target of other bitwidth with panic=abort

And only run the first two steps for non-bless mode. That'd be nice.

@rust-log-analyzer

Copy link
Copy Markdown
Collaborator

The job aarch64-gnu-llvm-21-1 failed! Check out the build log: (web) (plain enhanced) (plain)

Click to see the possible cause of the failure (guessed by this bot)
test result: ok. 400 passed; 0 failed; 7 ignored; 0 measured; 0 filtered out; finished in 7.75s

##[endgroup]
[TIMING:end] test::Compiletest { test_compiler: Compiler { stage: 2, host: aarch64-unknown-linux-gnu, forced_compiler: false }, target: aarch64-unknown-linux-gnu, mode: mir-opt, suite: "mir-opt", path: "tests/mir-opt", compare_mode: None } -- 7.859
[TIMING:start] synthetic_targets::MirOptPanicAbortSyntheticTarget { compiler: Compiler { stage: 2, host: aarch64-unknown-linux-gnu, forced_compiler: false }, base: aarch64-unknown-linux-gnu }
[TIMING:end] synthetic_targets::MirOptPanicAbortSyntheticTarget { compiler: Compiler { stage: 2, host: aarch64-unknown-linux-gnu, forced_compiler: false }, base: aarch64-unknown-linux-gnu } -- 0.020
[TIMING:start] test::Compiletest { test_compiler: Compiler { stage: 2, host: aarch64-unknown-linux-gnu, forced_compiler: false }, target: aarch64-unknown-linux-gnu-synthetic-miropt-abort(/checkout/obj/build/synthetic-target-specs/aarch64-unknown-linux-gnu-synthetic-miropt-abort.json), mode: mir-opt, suite: "mir-opt", path: "tests/mir-opt", compare_mode: None }
[TIMING:start] compile::Std { target: aarch64-unknown-linux-gnu-synthetic-miropt-abort(/checkout/obj/build/synthetic-target-specs/aarch64-unknown-linux-gnu-synthetic-miropt-abort.json), build_compiler: Compiler { stage: 2, host: aarch64-unknown-linux-gnu, forced_compiler: false }, crates: [], force_recompile: false, extra_rust_args: [], is_for_mir_opt_tests: true }
[TIMING:start] compile::StartupObjects { compiler: Compiler { stage: 2, host: aarch64-unknown-linux-gnu, forced_compiler: false }, target: aarch64-unknown-linux-gnu-synthetic-miropt-abort(/checkout/obj/build/synthetic-target-specs/aarch64-unknown-linux-gnu-synthetic-miropt-abort.json) }
[TIMING:end] compile::StartupObjects { compiler: Compiler { stage: 2, host: aarch64-unknown-linux-gnu, forced_compiler: false }, target: aarch64-unknown-linux-gnu-synthetic-miropt-abort(/checkout/obj/build/synthetic-target-specs/aarch64-unknown-linux-gnu-synthetic-miropt-abort.json) } -- 0.000
[TIMING:start] compile::Std { target: aarch64-unknown-linux-gnu-synthetic-miropt-abort(/checkout/obj/build/synthetic-target-specs/aarch64-unknown-linux-gnu-synthetic-miropt-abort.json), build_compiler: Compiler { stage: 1, host: aarch64-unknown-linux-gnu, forced_compiler: false }, crates: [], force_recompile: false, extra_rust_args: [], is_for_mir_opt_tests: false }
[TIMING:start] compile::StartupObjects { compiler: Compiler { stage: 1, host: aarch64-unknown-linux-gnu, forced_compiler: false }, target: aarch64-unknown-linux-gnu-synthetic-miropt-abort(/checkout/obj/build/synthetic-target-specs/aarch64-unknown-linux-gnu-synthetic-miropt-abort.json) }
[TIMING:end] compile::StartupObjects { compiler: Compiler { stage: 1, host: aarch64-unknown-linux-gnu, forced_compiler: false }, target: aarch64-unknown-linux-gnu-synthetic-miropt-abort(/checkout/obj/build/synthetic-target-specs/aarch64-unknown-linux-gnu-synthetic-miropt-abort.json) } -- 0.000
[TIMING:start] builder::Libdir { compiler: Compiler { stage: 1, host: aarch64-unknown-linux-gnu, forced_compiler: false }, target: aarch64-unknown-linux-gnu-synthetic-miropt-abort(/checkout/obj/build/synthetic-target-specs/aarch64-unknown-linux-gnu-synthetic-miropt-abort.json) }
[TIMING:end] builder::Libdir { compiler: Compiler { stage: 1, host: aarch64-unknown-linux-gnu, forced_compiler: false }, target: aarch64-unknown-linux-gnu-synthetic-miropt-abort(/checkout/obj/build/synthetic-target-specs/aarch64-unknown-linux-gnu-synthetic-miropt-abort.json) } -- 0.000

thread 'main' (1112) panicked at src/bootstrap/src/lib.rs:1262:16:
no entry found for key
stack backtrace:
   0: __rustc::rust_begin_unwind
             at /rustc/08d5b675a9b2abdca5e2fe4eabe0e07bbda15d49/library/std/src/panicking.rs:679:5
   1: core::panicking::panic_fmt
             at /rustc/08d5b675a9b2abdca5e2fe4eabe0e07bbda15d49/library/core/src/panicking.rs:80:14
   2: core::panicking::panic_display::<&str>
             at /rustc/08d5b675a9b2abdca5e2fe4eabe0e07bbda15d49/library/core/src/panicking.rs:259:5
   3: core::option::expect_failed
             at /rustc/08d5b675a9b2abdca5e2fe4eabe0e07bbda15d49/library/core/src/option.rs:2260:5
   4: <core::option::Option<&cc::tool::Tool>>::expect
             at /rustc/08d5b675a9b2abdca5e2fe4eabe0e07bbda15d49/library/core/src/option.rs:969:21
   5: <std::collections::hash::map::HashMap<bootstrap::core::config::target_selection::TargetSelection, cc::tool::Tool> as core::ops::index::Index<&bootstrap::core::config::target_selection::TargetSelection>>::index
             at /rustc/08d5b675a9b2abdca5e2fe4eabe0e07bbda15d49/library/std/src/collections/hash/map.rs:1517:23
   6: <bootstrap::Build>::cc
             at /checkout/src/bootstrap/src/lib.rs:1262:16
   7: <bootstrap::Build>::linker
             at /checkout/src/bootstrap/src/lib.rs:1374:23
   8: <bootstrap::core::builder::cargo::Cargo>::configure_linker
             at /checkout/src/bootstrap/src/core/builder/cargo.rs:359:46
   9: <bootstrap::core::builder::cargo::Cargo>::new
             at /checkout/src/bootstrap/src/core/builder/cargo.rs:162:23
  10: <bootstrap::core::build_steps::compile::Std as bootstrap::core::builder::CommandLineStep>::run
             at /checkout/src/bootstrap/src/core/build_steps/compile.rs:264:29
  11: <bootstrap::core::build_steps::compile::Std as bootstrap::core::builder::Step>::run
             at /checkout/src/bootstrap/src/core/builder/mod.rs:131:9
---
  22: <bootstrap::core::builder::Builder>::ensure::<bootstrap::core::build_steps::test::MirOpt>
             at /checkout/src/bootstrap/src/core/builder/mod.rs:1663:36
  23: <bootstrap::core::build_steps::test::MirOpt as bootstrap::core::builder::CommandLineStep>::make_run
             at /checkout/src/bootstrap/src/core/build_steps/test.rs:2113:21
  24: <bootstrap::core::builder::CommandLineStepDescription>::maybe_run
             at /checkout/src/bootstrap/src/core/builder/mod.rs:502:13
  25: bootstrap::core::builder::cli_paths::match_paths_to_steps_and_run
             at /checkout/src/bootstrap/src/core/builder/cli_paths.rs:142:22
  26: <bootstrap::core::builder::Builder>::run_step_descriptions
             at /checkout/src/bootstrap/src/core/builder/mod.rs:1190:9
  27: <bootstrap::core::builder::Builder>::execute_cli
             at /checkout/src/bootstrap/src/core/builder/mod.rs:1169:14
  28: <bootstrap::Build>::build
             at /checkout/src/bootstrap/src/lib.rs:802:25
  29: bootstrap::main
             at /checkout/src/bootstrap/src/bin/main.rs:157:11
  30: <fn() as core::ops::function::FnOnce<()>>::call_once
             at /rustc/08d5b675a9b2abdca5e2fe4eabe0e07bbda15d49/library/core/src/ops/function.rs:250:5
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.

Bootstrap has panicked, currently active steps:
test::MirOpt { compiler: Compiler { stage: 2, host: aarch64-unknown-linux-gnu, forced_compiler: false }, target: aarch64-unknown-linux-gnu } at src/bootstrap/src/core/build_steps/test.rs:2113
test::Compiletest { test_compiler: Compiler { stage: 2, host: aarch64-unknown-linux-gnu, forced_compiler: false }, target: aarch64-unknown-linux-gnu-synthetic-miropt-abort(/checkout/obj/build/synthetic-target-specs/aarch64-unknown-linux-gnu-synthetic-miropt-abort.json), mode: mir-opt, suite: "mir-opt", path: "tests/mir-opt", compare_mode: None } at src/bootstrap/src/core/build_steps/test.rs:2118
compile::Std { target: aarch64-unknown-linux-gnu-synthetic-miropt-abort(/checkout/obj/build/synthetic-target-specs/aarch64-unknown-linux-gnu-synthetic-miropt-abort.json), build_compiler: Compiler { stage: 2, host: aarch64-unknown-linux-gnu, forced_compiler: false }, crates: [], force_recompile: false, extra_rust_args: [], is_for_mir_opt_tests: true } at src/bootstrap/src/core/build_steps/test.rs:2256
compile::Std { target: aarch64-unknown-linux-gnu-synthetic-miropt-abort(/checkout/obj/build/synthetic-target-specs/aarch64-unknown-linux-gnu-synthetic-miropt-abort.json), build_compiler: Compiler { stage: 1, host: aarch64-unknown-linux-gnu, forced_compiler: false }, crates: [], force_recompile: false, extra_rust_args: [], is_for_mir_opt_tests: false } at src/bootstrap/src/core/build_steps/compile.rs:220
Build completed unsuccessfully in 0:28:59
  local time: Thu Jul 30 08:47:49 UTC 2026
  network time: Thu, 30 Jul 2026 08:47:49 GMT
##[error]Process completed with exit code 1.
##[group]Run echo "disk usage:"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-testsuite Area: The testsuite used to check the correctness of rustc S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants