Skip to content
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

Replace directory hash from loaded analysis #1129

Closed
wants to merge 1 commit into from

Conversation

jvican
Copy link
Contributor

@jvican jvican commented Dec 18, 2019

The directory hash is random to avoid classpath hash conflicts and it's
a value initialized when the bloop server runs for the first time. This
means the directory hashes from different bloop instances in time is
different.

To work around this issue, we make sure we replace the directory hashes
from the previous bloop server instance with the new one. This avoid
classpath hash invalidations that might trigger recompiles upon
restarting the bloop server.

Thanks @olafurpg for reporting this misinteraction

@jvican jvican added bug A defect or misbehaviour. performance task / compile labels Dec 18, 2019
olafurpg pushed a commit to olafurpg/metals that referenced this pull request Dec 18, 2019
Previously, Bloop would trigger a re-compilation after restarting the
server. Now, the newly started Bloop server re-uses the cached
compilation.

Related PR scalacenter/bloop#1129
Copy link
Contributor

@olafurpg olafurpg left a comment

Choose a reason for hiding this comment

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

Just tested this locally and can confirm that I'm no longer able to reproduce the re-compilation on a restarted Bloop server when using this PR along with the change in scalameta/metals#1201

The directory hash is random to avoid classpath hash conflicts and it's
a value initialized when the bloop server runs for the first time. This
means the directory hashes from different bloop instances in time is
different.

To work around this issue, we make sure we replace the directory hashes
from the previous bloop server instance with the new one. This avoid
classpath hash invalidations that might trigger recompiles upon
restarting the bloop server.
@jvican
Copy link
Contributor Author

jvican commented Jan 23, 2020

This should no longer be necessary, this issue was actually fixed in the latest master but didn't realize that was the case.

@jvican jvican closed this Jan 23, 2020
@tgodzik tgodzik deleted the topic/fix-directory-hash branch September 7, 2021 16:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug A defect or misbehaviour. performance task / compile
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants