-
Notifications
You must be signed in to change notification settings - Fork 949
fixes remote caching not managing resource files #6554
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
Conversation
What is the problem? When using remote caching, the resource files are not tracked so if they have changed, pullRemoteCache will deliver both the old resource file as well as the changed one. This is a problem, because it's not the behaviour that our users will expect and it's not in keeping with the contract of this feature. Why is this happening? Zinc, sbt's incremental compiler, keeps track of changes that have been made. It keeps this in what is called the Analysis file. However, resource files are not tracked in the Analysis file, so remote caching is not invalidating the unchanged resource file in place of the latest version. What is the solution? PullRemoteCache deletes all of the resources files. After this, copyResources is called by PackageBin, which puts the latest version of the resources back.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @Nirvikalpa108!
I think this fix is good on its own, and is ready to merge. I've actually thought of another cool way to fix this. When we saw copyResources: sbt/main/src/main/scala/sbt/Defaults.scala Lines 2529 to 2535 in 4926cb4
that is sort of doing something like incremental compilation, but it's just not virtualized like this PR does. So... if we take |
Merge pull request sbt#6551 from samuelClarencTeads/bspIntegrationTestTag Add the tag "integration-test" to the it configuration in BSP. fixes remote caching not managing resource files What is the problem? When using remote caching, the resource files are not tracked so if they have changed, pullRemoteCache will deliver both the old resource file as well as the changed one. This is a problem, because it's not the behaviour that our users will expect and it's not in keeping with the contract of this feature. Why is this happening? Zinc, sbt's incremental compiler, keeps track of changes that have been made. It keeps this in what is called the Analysis file. However, resource files are not tracked in the Analysis file, so remote caching is not invalidating the unchanged resource file in place of the latest version. What is the solution? PullRemoteCache deletes all of the resources files. After this, copyResources is called by PackageBin, which puts the latest version of the resources back. Merge branch 'develop' into remote-cache Merge pull request sbt#6554 from Nirvikalpa108/remote-cache fixes remote caching not managing resource files Merge branch 'develop' into restore-charridge-return cleanup spec; Merge branch 'restore-charridge-return' of github.com:sebastian-alfers/sbt into restore-charridge-return
An alternative to sbt#6554.
An alternative to sbt#6554.
An alternative to sbt#6554.
An alternative to sbt#6554.
An alternative to sbt#6554.
An alternative to sbt#6554.
An alternative to sbt#6554.
An alternative to sbt#6554.
An alternative to sbt#6554.
…yncing An alternative to sbt#6554.
…yncing An alternative to sbt#6554.
…yncing An alternative to sbt#6554.
…yncing An alternative to sbt#6554.
…yncing An alternative to sbt#6554.
…yncing An alternative to sbt#6554.
What is the problem? 😔
When using remote caching, the resource files are not tracked so if they have changed, pullRemoteCache will deliver both the old resource file as well as the most recent version.
This is a problem, because it's not the behaviour that our users will expect and it's not in keeping with the contract of this feature.
Why is this happening?
Zinc, sbt's incremental compiler, keeps track of changes that have been made. It keeps this in what is called the Analysis file. However, resource files are not tracked in the Analysis file, so remote caching is not invalidating the unchanged resource in place of the new one.
What is the solution? 😃
PullRemoteCache deletes all of the resources files. After this, copyResources is called by PackageBin, which puts the latest
version of the resources back.
fixes #6394