[2.x] Always create symlinks to the cache in the target locations #8445#8461
Merged
eed3si9n merged 3 commits intosbt:developfrom Jan 13, 2026
Merged
[2.x] Always create symlinks to the cache in the target locations #8445#8461eed3si9n merged 3 commits intosbt:developfrom
eed3si9n merged 3 commits intosbt:developfrom
Conversation
ba59dee to
e773000
Compare
eed3si9n
approved these changes
Jan 10, 2026
Member
eed3si9n
left a comment
There was a problem hiding this comment.
@azdrojowa123 Thanks for the contribution. Overall LGTM! We just have to figure out why the scripted test is failing. Maybe there's already some hermeticity bug somewhere along the run task.
azdrojowa123
added a commit
to azdrojowa123/sbt
that referenced
this pull request
Jan 12, 2026
…overwriting the cache sbt#8461
azdrojowa123
added a commit
to azdrojowa123/sbt
that referenced
this pull request
Jan 12, 2026
…overwriting the cache sbt#8461
186b96b to
009d060
Compare
…the digest matches sbt#8445
… if `zipPath` in `sbt.util.ActionCache.packageDirectory` is a symlink to the CAS, in later calls, this path in the CAS gets overridden by the new sources. - in this test, after "run 1" in line 15, the produced file "target/out/jvm/scala-3.7.4/a/classes.sbtdir.zip" is a symlink to the CAS, let's call it SH1. - when "run 3" is executed, `IO.zip` saves the new value to `zipPath`, which is "target/out/jvm/scala-3.7.4/a/classes.sbtdir.zip -> SH1", so SH1 gets overridden. - when the last "run 1" is executed, the cache retrieves SH1, but it contains the data from "run 3" (the test fails with "actual A.x is 3").
…overwriting the cache sbt#8461
009d060 to
3dd1127
Compare
Contributor
Author
|
Is |
Member
|
Any lm tests are subject to the Internet weather I guess. |
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.
The problem described in #8445 is not only tied to
scalaCompilerBridgeBin, for which it was initially reported, but also affects other tasks likeexportedProductJars,packageBin, and likely more.I've tested the proposed approach, and it seems to work - it always creates symlinks.
However, I think I don't have enough broad knowledge to confidently say that it won't have negative side effects in some other use cases.