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

Fix/changing options from sources should not require reload #3112

Conversation

MaciejG604
Copy link
Contributor

Right now from Bsp we pass to BspImpl build options that are the options from CLI and sources combined, this behaviour is incorrect since those options get used as options from CLI (so override all else) in BspImpl.compile() and BspImpl.build().

As a result we have incorrect project configuration on every change of options from sources after launching the BSP command! From what I remeber this is covered up by Metals since on every change of project configuration (more specific on a change of bloop config json file) we send buildTarget/didChange and receive from Metals a workspace/reload request. This allows us to fix everything since the options used in BspImpl.compile() and BspImpl.build() get reloaded to correct values that represent options passed from CLI. (See initialBspOptions and bspReloadableOptionsReference in Bsp)

No idea if IntelliJ does the same on our buildTarget/didChange, but if not this might be a major problem for IntelliJ users.

Also due to this error our tests needed some fixing. The test with correct bloop JVM version is a weird case since in old behaviour we never send java-19 path to bloop before the workspace reload. So we were sending java-11 and the --release 19 resulted in an error during compilation. New behaviour is we send java-19 path and the compilation succeeds, but we get some error logs from bloop from whetever it's doing with the compiler jar 🤷. We might need to fix this so that Scala CLI fails the compilation when the log is received from bloop, but I'm not sure if this is doable.

@Gedochao
Copy link
Contributor

New behaviour is we send java-19 path and the compilation succeeds, but we get some error logs from bloop from whetever it's doing with the compiler jar 🤷. We might need to fix this so that Scala CLI fails the compilation when the log is received from bloop, but I'm not sure if this is doable.

@MaciejG604 can you extract this to an issue?

Copy link
Contributor

@Gedochao Gedochao left a comment

Choose a reason for hiding this comment

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

LGTM

@Gedochao Gedochao merged commit b67eb3e into VirtusLab:main Aug 20, 2024
79 checks passed
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