Skip to content

Fix parallel rustc not being reproducible due to unstable sorts of items #144886

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

ywxt
Copy link
Contributor

@ywxt ywxt commented Aug 4, 2025

Currently, A tuple (DefId, SymbolName) is used to determine the order of items in the final binary. However DefId is expected as non-deterministic, which leads to some not reproducible issues under parallel compilation.

Here we use (Span, SymbolName) to replace (DefId, SymbolName) and make them sorted.

This PR is purposed to fix #140425, but seemly works on #140413 too.

This behavior hasn't added into any test until we have a test suit for the parallel frontend. (See #143953)

Related discussion: Zulip #144576

Update #113349

r? @SparrowLii

@rustbot
Copy link
Collaborator

rustbot commented Aug 4, 2025

r? @saethlin

rustbot has assigned @saethlin.
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

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Aug 4, 2025
@rustbot rustbot assigned SparrowLii and unassigned saethlin Aug 4, 2025
@SparrowLii
Copy link
Member

@bors try @rust-timer queue

@rust-timer
Copy link
Collaborator

Awaiting bors try build completion.

@rustbot label: +S-waiting-on-perf

@rust-bors
Copy link

rust-bors bot commented Aug 4, 2025

⌛ Trying commit 7f73e8b with merge 8bf70d1

To cancel the try build, run the command @bors try cancel.

rust-bors bot added a commit that referenced this pull request Aug 4, 2025
Fix parallel rustc not being reproducible due to unstable sorts of items
@rustbot rustbot added the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Aug 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-perf Status: Waiting on a perf run to be completed. S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. 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.

parallel rustc: async closures not reproducible
5 participants