Skip to content

./x test --bless src/bootstrap does not work as expected #164837

Closed

Description

@RalfJung

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.)

Activity

  1. added
    T-bootstrap
    C-bug
    on Oct 24, 2026
  2. added
    needs-triage
    on Oct 24, 2026
  3. Kobzol commented on Oct 24, 2026

    @Kobzol
    Member

    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 the insta crate, 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 insta for the user, though they would have to have that tool installed. I'll take another look at this.

    (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.)

    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.

  4. RalfJung commented on Oct 24, 2026

    @RalfJung
    MemberAuthor

    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?

  5. Kobzol commented on Oct 24, 2026

    @Kobzol
    Member

    I think that the inline snapshot blessing code lives only within the cargo insta binary, and not the library crate, which kinda makes sense.

  6. added
    A-testsuite
    and removed
    needs-triage
    on Oct 24, 2026
  7. bjorn3 commented on Oct 24, 2026

    @bjorn3
    Member

    You could run the tests with INSTA_UPDATE=always if --blessed is passed. That should work without needing cargo-insta installed.

  8. Kobzol commented on Oct 24, 2026

    @Kobzol
    Member

    It only works for on disk snapshots, not for inline snapshots (unless something changed in the meantime).

  9. bjorn3 commented on Oct 24, 2026

    @bjorn3
    Member

    Maybe we could switch to expect-test? That is what rust-analyzer uses. It only supports inline snapshots and uses UPDATE_EXPECT=1 to tell it to update them.

  10. Kobzol commented on Oct 24, 2026

    @Kobzol
    Member

    That's a great idea :) #164856

  11. added 2 commits that reference this issue on Oct 24, 2026
  12. added a commit that references this issue on Oct 25, 2026
  13. added a commit that references this issue on Oct 25, 2026
  14. added 2 commits that reference this issue on Oct 25, 2026
  15. added a commit that references this issue on Oct 25, 2026
  16. added 4 commits that reference this issue on Oct 26, 2026
  17. added a commit that references this issue on Oct 26, 2026
  18. added a commit that references this issue on Oct 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-testsuiteC-bugT-bootstrap

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions