Skip to content

test: Handle non-deterministic compilation order - #17347

Merged
weihanglo merged 1 commit into
rust-lang:masterfrom
epage:flakey-build-script-test
Aug 10, 2026
Merged

test: Handle non-deterministic compilation order#17347
weihanglo merged 1 commit into
rust-lang:masterfrom
epage:flakey-build-script-test

Conversation

@epage

@epage epage commented Aug 10, 2026

Copy link
Copy Markdown
Contributor

What does this PR try to resolve?

Hit this with #17346

thread 'build_script::cfg_override_test' (71300) panicked at tests/testsuite/build_script.rs:3634:10:

---- expected: tests/testsuite/build_script.rs:3601:27
++++ actual:   stderr
   1    1 | [COMPILING] foo v0.0.1 ([ROOT]/foo)
   2    2 | [RUNNING] `rustc --crate-name foo[..]`
   3      - [RUNNING] `rustc --crate-name foo[..]`
   4      - [RUNNING] `rustc --crate-name test[..]`
        3 + [RUNNING] `rustc --crate-name test --edition=2015 tests/test.rs --error-format=json --json=diagnostic-rendered-ansi,artifacts,future-incompat --diagnostic-width=400 --emit=dep-info,link -C embed-bitcode=no -C debuginfo=2 -C split-debuginfo=unpacked --allow=unexpected_cfgs --test --check-cfg 'cfg(docsrs,test)' --check-cfg 'cfg(feature, values())' -C metadata=7e98bdc87b54be1e -C extra-filename=-46d1fa8b5db2bd02 --out-dir [ROOT]/foo/target/debug/deps -L dependency=[ROOT]/foo/target/debug/deps --extern foo=[ROOT]/foo/target/debug/deps/libfoo-[HASH].rlib --cfg foo`
        4 + [RUNNING] `rustc --crate-name foo --edition=2015 src/lib.rs --error-format=json --json=diagnostic-rendered-ansi,artifacts,future-incompat --diagnostic-width=400 --emit=dep-info,link -C embed-bitcode=no -C debuginfo=2 -C split-debuginfo=unpacked --allow=unexpected_cfgs --test --check-cfg 'cfg(docsrs,test)' --check-cfg 'cfg(feature, values())' -C metadata=e83780a000df3302 -C extra-filename=-e1364ce7fb0b5fef --out-dir [ROOT]/foo/target/debug/deps -L dependency=[ROOT]/foo/target/debug/deps --cfg foo`
   5    5 | [FINISHED] `test` profile [unoptimized + debuginfo] target(s) in [ELAPSED]s
   6    6 | [RUNNING] `[ROOT]/foo/target/debug/deps/foo-[HASH][EXE]`
   7    7 | [RUNNING] `[ROOT]/foo/target/debug/deps/test-[HASH][EXE]`
   8    8 | [DOCTEST] foo
   9    9 | [RUNNING] `rustdoc [..] --cfg foo[..]`

How to test and review this PR?

Hit this with rust-lang#17346
```
thread 'build_script::cfg_override_test' (71300) panicked at tests/testsuite/build_script.rs:3634:10:

---- expected: tests/testsuite/build_script.rs:3601:27
++++ actual:   stderr
   1    1 | [COMPILING] foo v0.0.1 ([ROOT]/foo)
   2    2 | [RUNNING] `rustc --crate-name foo[..]`
   3      - [RUNNING] `rustc --crate-name foo[..]`
   4      - [RUNNING] `rustc --crate-name test[..]`
        3 + [RUNNING] `rustc --crate-name test --edition=2015 tests/test.rs --error-format=json --json=diagnostic-rendered-ansi,artifacts,future-incompat --diagnostic-width=400 --emit=dep-info,link -C embed-bitcode=no -C debuginfo=2 -C split-debuginfo=unpacked --allow=unexpected_cfgs --test --check-cfg 'cfg(docsrs,test)' --check-cfg 'cfg(feature, values())' -C metadata=7e98bdc87b54be1e -C extra-filename=-46d1fa8b5db2bd02 --out-dir [ROOT]/foo/target/debug/deps -L dependency=[ROOT]/foo/target/debug/deps --extern foo=[ROOT]/foo/target/debug/deps/libfoo-[HASH].rlib --cfg foo`
        4 + [RUNNING] `rustc --crate-name foo --edition=2015 src/lib.rs --error-format=json --json=diagnostic-rendered-ansi,artifacts,future-incompat --diagnostic-width=400 --emit=dep-info,link -C embed-bitcode=no -C debuginfo=2 -C split-debuginfo=unpacked --allow=unexpected_cfgs --test --check-cfg 'cfg(docsrs,test)' --check-cfg 'cfg(feature, values())' -C metadata=e83780a000df3302 -C extra-filename=-e1364ce7fb0b5fef --out-dir [ROOT]/foo/target/debug/deps -L dependency=[ROOT]/foo/target/debug/deps --cfg foo`
   5    5 | [FINISHED] `test` profile [unoptimized + debuginfo] target(s) in [ELAPSED]s
   6    6 | [RUNNING] `[ROOT]/foo/target/debug/deps/foo-[HASH][EXE]`
   7    7 | [RUNNING] `[ROOT]/foo/target/debug/deps/test-[HASH][EXE]`
   8    8 | [DOCTEST] foo
   9    9 | [RUNNING] `rustdoc [..] --cfg foo[..]`
```
@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Aug 10, 2026
@rustbot

rustbot commented Aug 10, 2026

Copy link
Copy Markdown
Collaborator

r? @weihanglo

rustbot has assigned @weihanglo.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

Why was this reviewer chosen?

The reviewer was selected based on:

  • Owners of files modified in this PR: @epage, @weihanglo
  • @epage, @weihanglo expanded to epage, weihanglo

@weihanglo
weihanglo added this pull request to the merge queue Aug 10, 2026
Merged via the queue into rust-lang:master with commit 6c59bf2 Aug 10, 2026
29 checks passed
@rustbot rustbot removed the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Aug 10, 2026
@epage
epage deleted the flakey-build-script-test branch August 11, 2026 20:39
rust-bors Bot pushed a commit to rust-lang/rust that referenced this pull request Aug 11, 2026
Update cargo submodule

10 commits in b07e5a08651da80108eb65d7dc769ee04589f9bf..eb98b54bc9f3c74519f43d066cb3fd02ebc88df0
2026-08-07 21:51:16 +0000 to 2026-08-11 16:00:29 +0000
- feat(trim-paths): honor workspace prefix override from env (rust-lang/cargo#17349)
- fix(clean): respect target with --doc (rust-lang/cargo#17322)
- chore(renovate): Use a 3day minimum release age (rust-lang/cargo#17346)
- test: Handle non-deterministic compilation order (rust-lang/cargo#17347)
- docs(ref): Add missing config env variables (rust-lang/cargo#17345)
- fix(trim-paths): workspace remap under -Zroot-dir (rust-lang/cargo#17337)
- Fix funding link (rust-lang/cargo#17344)
- fix(trim-paths): `/cargo/deps` fallback sources  (rust-lang/cargo#17338)
- doc: don't use mergeable info and json together (rust-lang/cargo#17336)
- docs: document --output-format for cargo doc (rust-lang/cargo#17325)
@rustbot rustbot added this to the 1.99.0 milestone Aug 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants