Repository navigation
Closed
Labels
A-testsuiteArea: The testsuite used to check the correctness of rustcC-bugCategory: This is a bug.T-bootstrapRelevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)
Description
Summary
./x test src/bootstrap tells me that some output is outdated. It mentions cargo insta review to fix that but that cannot work as I am in the rustc workspace root, it has to be some ./x command. I was hoping ./x test --bless src/bootstrap would work but unfortunately it does not:
$ ./x test --bless src/bootstrap
...
---- core::builder::tests::snapshot::check_cross_compile stdout ----
Running test in /tmp/.tmpJWl7YV
Building LLVM for x86_64-unknown-linux-gnu
Building stage1 compiler artifacts (stage0 -> stage1, x86_64-unknown-linux-gnu)
Creating a sysroot for stage1 compiler (use `rustup toolchain link 'name' build/host/stage1`)
Building stage1 library artifacts (stage1 -> stage1, x86_64-unknown-linux-gnu)
Checking stage1 library artifacts (stage1:x86_64-unknown-linux-gnu -> stage1:i686-unknown-haiku)
Checking stage2 compiler artifacts{rustc-main, rustc_abi, rustc_arena, rustc_ast, rustc_ast_ir, rustc_ast_lowering, rustc_ast_passes, rustc_ast_pretty, rustc_attr_ir, rustc_attr_parsing, rustc_baked_icu_data, rustc_borrowck, rustc_builtin_macros, rustc_codegen_llvm, rustc_codegen_ssa, rustc_const_eval, rustc_crate_store, rustc_data_structures, rustc_driver, rustc_driver_impl, rustc_error_codes, rustc_error_messages, rustc_errors, rustc_expand, rustc_expand_queries, rustc_feature, rustc_fs_util, rustc_graphviz, rustc_hashes, rustc_hir, rustc_hir_analysis, rustc_hir_id, rustc_hir_pretty, rustc_hir_typeck, rustc_incremental, rustc_index, rustc_index_macros, rustc_infer, rustc_interface, rustc_lexer, rustc_lint, rustc_lint_defs, rustc_llvm, rustc_log, rustc_macros, rustc_metadata, rustc_middle, rustc_mir_build, rustc_mir_dataflow, rustc_mir_transform, rustc_monomorphize, rustc_next_trait_solver, rustc_parse, rustc_parse_format, rustc_passes, rustc_pattern_analysis, rustc_privacy, rustc_proc_macro, rustc_public, rustc_public_bridge, rustc_query_impl, rustc_resolve, rustc_sanitizers, rustc_serialize, rustc_session, rustc_span, rustc_structures, rustc_symbol_mangling, rustc_target, rustc_thread_pool, rustc_trait_selection, rustc_traits, rustc_transmute, rustc_ty_utils, rustc_ty_walk, rustc_type_ir, rustc_type_ir_macros, rustc_windows_rc} (stage1:x86_64-unknown-linux-gnu -> stage2:i686-unknown-haiku)
Checking stage2 compiler artifacts (stage1:x86_64-unknown-linux-gnu -> stage2:i686-unknown-haiku)
Checking stage2 rustdoc (stage1:x86_64-unknown-linux-gnu -> stage2:i686-unknown-haiku)
Checking stage2 rustc_codegen_cranelift (stage1:x86_64-unknown-linux-gnu -> stage2:i686-unknown-haiku)
Checking stage2 rustc_codegen_gcc (stage1:x86_64-unknown-linux-gnu -> stage2:i686-unknown-haiku)
Checking stage2 clippy (stage1:x86_64-unknown-linux-gnu -> stage2:i686-unknown-haiku)
Checking stage2 miri (stage1:x86_64-unknown-linux-gnu -> stage2:i686-unknown-haiku)
Checking stage2 cargo-miri (stage1:x86_64-unknown-linux-gnu -> stage2:i686-unknown-haiku)
WARNING: not checking bootstrap tool "src/tools/miropt-test-tools" for target i686-unknown-haiku as it is a bootstrap (host-only) tool
Checking stage2 rustfmt (stage1:x86_64-unknown-linux-gnu -> stage2:i686-unknown-haiku)
Checking stage2 rust-analyzer (stage1:x86_64-unknown-linux-gnu -> stage2:i686-unknown-haiku)
Checking stage2 test-float-parse (stage1:x86_64-unknown-linux-gnu -> stage2:i686-unknown-haiku)
WARNING: not checking bootstrap tool "src/tools/features-status-dump" for target i686-unknown-haiku as it is a bootstrap (host-only) tool
Checking stage1 library artifacts{alloc, compiler_builtins, core, panic_abort, panic_unwind, proc_macro, rustc-std-workspace-core, std, std_detect, sysroot, test, unwind} (stage1:x86_64-unknown-linux-gnu -> stage1:i686-unknown-haiku)
Checking stage1 library test/bench/example targets (stage1:x86_64-unknown-linux-gnu -> stage1:i686-unknown-haiku)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ Snapshot Summary ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Snapshot: check_cross_compile
Source: src/bootstrap/src/core/builder/tests.rs:1650
────────────────────────────────────────────────────────────────────────────────
Expression: ctx.config("check").targets(&[TEST_TRIPLE_1]).hosts(&[TEST_TRIPLE_1]).render_steps()
────────────────────────────────────────────────────────────────────────────────
-old snapshot
+new results
────────────┬───────────────────────────────────────────────────────────────────
9 9 │ [check] rustc 1 <host> -> rustc_codegen_gcc 2 <target1>
10 10 │ [check] rustc 1 <host> -> Clippy 2 <target1>
11 11 │ [check] rustc 1 <host> -> Miri 2 <target1>
12 12 │ [check] rustc 1 <host> -> CargoMiri 2 <target1>
13 │-[check] rustc 1 <host> -> Priroda 2 <target1>
14 13 │ [check] rustc 1 <host> -> Rustfmt 2 <target1>
15 14 │ [check] rustc 1 <host> -> RustAnalyzer 2 <target1>
16 15 │ [check] rustc 1 <host> -> TestFloatParse 2 <target1>
17 16 │ [check] rustc 1 <host> -> std 1 <target1>
────────────┴───────────────────────────────────────────────────────────────────
To update snapshots run `cargo insta review`
Stopped on the first failure. Run `cargo insta test` to run all snapshots.
thread 'core::builder::tests::snapshot::check_cross_compile' (2389282) panicked at /home/r/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/insta-1.47.2/src/runtime.rs:719:13:
snapshot assertion for 'check_cross_compile' failed in line 1650
---- core::builder::tests::snapshot::check_cross_compile stdout end ----
failures:
core::builder::tests::snapshot::check_cross_compile
I guess I'll update the outputs manually then...
(Also is it expected that ./x test src/bootstrap checks out the cargo submodules? I'd prefer having the minimal amount of submodules checked out as they like make problems during rebases.)
Metadata
Metadata
Assignees
Labels
A-testsuiteArea: The testsuite used to check the correctness of rustcC-bugCategory: This is a bug.T-bootstrapRelevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)
Activity
Kobzol commentedon Oct 24, 2026
Yeah, those tests have to be blessed using
cargo insta review --manifest-path src/bootstrap/Cargo.toml, it should be documented in the README. There is unfortunately no simple way to bless in-source snapshots using theinstacrate, so we'd either have to hack something together or switch to disk snapshots, which is IMO less readable.I wonder if we could somehow invoke
cargo instafor the user, though they would have to have that tool installed. I'll take another look at this.It runs all kinds of bootstrap steps, and some of them checkout the submodule. I'll take a look if we can easily get rid of it.
RalfJung commentedon Oct 24, 2026
Having to have a separate tool installed is quite unfortunate indeed. Can't the same logic be invoked directly from the test suite via a lib crate?
Kobzol commentedon Oct 24, 2026
I think that the inline snapshot blessing code lives only within the
cargo instabinary, and not the library crate, which kinda makes sense.bjorn3 commentedon Oct 24, 2026
You could run the tests with
INSTA_UPDATE=alwaysif--blessedis passed. That should work without needing cargo-insta installed.Kobzol commentedon Oct 24, 2026
It only works for on disk snapshots, not for inline snapshots (unless something changed in the meantime).
bjorn3 commentedon Oct 24, 2026
Maybe we could switch to expect-test? That is what rust-analyzer uses. It only supports inline snapshots and uses
UPDATE_EXPECT=1to tell it to update them.Kobzol commentedon Oct 24, 2026
That's a great idea :) #164856
Rollup merge of rust-lang#164857 - Kobzol:bootstrap-no-cargo-checkout…
Rollup merge of rust-lang#164857 - Kobzol:bootstrap-no-cargo-checkout…
Rollup merge of rust-lang#164857 - Kobzol:bootstrap-no-cargo-checkout…
Rollup merge of rust-lang#164857 - Kobzol:bootstrap-no-cargo-checkout…
Rollup merge of rust-lang#164857 - Kobzol:bootstrap-no-cargo-checkout…
Rollup merge of rust-lang#164857 - Kobzol:bootstrap-no-cargo-checkout…
Unrolled build for #164857 in rollup 164894
Rollup merge of rust-lang#164856 - Kobzol:expect-test, r=Mark-Simulacrum
Rollup merge of rust-lang#164856 - Kobzol:expect-test, r=Mark-Simulacrum
Rollup merge of rust-lang#164856 - Kobzol:expect-test, r=Mark-Simulacrum
Rollup merge of rust-lang#164856 - Kobzol:expect-test, r=Mark-Simulacrum
Rollup merge of #164856 - Kobzol:expect-test, r=Mark-Simulacrum
Unrolled build for #164856 in rollup 165002
Rollup merge of #164856 - Kobzol:expect-test, r=Mark-Simulacrum