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

Bloop error when switching between minor versions of Scala 3 due to dirty cached compiler output directory #5955

Open
smarter opened this issue Dec 18, 2023 · 1 comment
Labels
upstream-fix-needed Waiting on a fix upstream

Comments

@smarter
Copy link
Contributor

smarter commented Dec 18, 2023

Describe the bug

(I'm not sure if this is a bloop issue or a metals issue, but the path to the dirty cache includes "Metals" so it might be under metals' control).
I switched from a nightly of Scala 3.4 to Scala 3.3 in a project and metals reported a bloop error due to a tasty file compiled with Scala 3.4 being read by the Scala 3.3 compiler:

error id: YOTzVt81VQLDdHD9WU0ZMg==
### Bloop error:

error while loading BdlInterface,
class file <WORKSPACE>/.bloop/prj_forj_main/bloop-internal-classes/classes-Metals-0ge9W8bwRqii2JtoiW_wuw==-N20lSK8mSyKOyALtcAt50w==/com/arteris/forj/BdlInterface.class is broken, reading aborted with class dotty.tools.tasty.UnpickleException
TASTy signature has wrong version.
 expected: {majorVersion: 28, minorVersion: 3}
 found   : {majorVersion: 28, minorVersion: 4 [unstable release: 1]}

This TASTy file was produced by an unstable release.
To read this TASTy file, your tooling must be at the same version.
The TASTy file was produced by Scala 3.4.0-RC1-bin-20231207-16f1680-NIGHTLY-git-16f1680.
#### Short summary: 

error while loading BdlInterface,
class file <WORKSPACE>/.bloop/prj_forj_main/bloop-internal-classes...

Expected behavior

Metals/Bloop should clear the compiler output directory they use when switching between compiler versions to ensure this does not happen.

Operating system

Windows

Editor/Extension

VS Code

Version of Metals

v1.2.0

Extra context or search terms

No response

@tgodzik tgodzik added the upstream-fix-needed Waiting on a fix upstream label Dec 19, 2023
@tgodzik
Copy link
Contributor

tgodzik commented Dec 19, 2023

Thanks for reporting! This is an issue with Bloop, I need to investigate.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
upstream-fix-needed Waiting on a fix upstream
Projects
None yet
Development

No branches or pull requests

2 participants