Make libraryClassName relation deterministic under concurrency#1638
Merged
eed3si9n merged 4 commits intosbt:developfrom Feb 6, 2026
Merged
Make libraryClassName relation deterministic under concurrency#1638eed3si9n merged 4 commits intosbt:developfrom
libraryClassName relation deterministic under concurrency#1638eed3si9n merged 4 commits intosbt:developfrom
Conversation
eed3si9n
reviewed
Feb 6, 2026
internal/zinc-core/src/main/scala/sbt/internal/inc/Incremental.scala
Outdated
Show resolved
Hide resolved
….scala Co-authored-by: eugene yokota <[email protected]>
Contributor
Author
|
@eed3si9n FYI CI looks green |
Contributor
Author
|
I think it actually does close it |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Previously, Zinc could produce nondeterministic analysis output because
binaryClassNameusedput(binary, className)from concurrentexternalLibraryDependencycallbacks. The final value depended on callback scheduling, sobinaryClassNamestores one representative class per binary JAR in a concurrent map, but representative selection was non-deterministic.This PR replaces
putwith deterministic merge usingupdateWith, choosing the lexicographically smallest class name for each binary.libraryClassNameonly needs a stable representative class per binary for lookup/stamp checks; selecting a deterministic representative preserves behavior while removing scheduler dependence. This removes one source of nondeterminism in Zinc analysis serialization and downstream build cache hashes, which was blocking attempts at reproducible builds in Mill (e.g. com-lihaoyi/mill#4642)