Skip to content

Fix #7852: avoid reading stale .tasty files from jars #7918

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

Merged
merged 2 commits into from
Jan 8, 2020

Conversation

smarter
Copy link
Member

@smarter smarter commented Jan 7, 2020

No description provided.

Somehow, if we don't close the classloader used to read .tasty files
from jars, a subsequent compilation run might end up reading a stale
version of the .tasty file which does not exist on disk anymore. I don't
understand why this happens since we don't reuse the classloader itself,
but that's life sometimes ¯\_(ツ)_/¯
Copy link
Contributor

@nicolasstucki nicolasstucki left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Otherwise LGTM

The previous commit tried to fix some weird caching behaviors by closing
the classloader used to read a .tasty file, but it turns out the JVM is
dumb and that breaks any other in-use classloader that uses the same
jar. Give up on the whole thing and work directly with the underlying
ZipArchive to find the .tasty file (this just required adding a "parent"
field to ZipArchive#Entry).
@smarter
Copy link
Member Author

smarter commented Jan 7, 2020

I had to use a different approach, see latest commit

@smarter smarter assigned nicolasstucki and unassigned smarter Jan 7, 2020
@nicolasstucki nicolasstucki merged commit 8305bd0 into scala:master Jan 8, 2020
@nicolasstucki nicolasstucki deleted the fix-stale-tasty branch January 8, 2020 08:02
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.

2 participants