Closed gpremer closed 2 months ago
Thanks for reporting!
However, on NixOS, by default, arbitrary executables, such as the bundled coursier, can't be run because of linker issues. While this can be worked around, the next step would be that a Java version is downloaded that has similar problems.
Is that a problem here though, I see that Metals did find Java, so we will not try to download it later on. I think running the coursier binary is an issue, no?
So, for example, a setting that allows bypassing the need for a download such as explicitly setting the java home for the build and server separately would fix this issue. Or reverting to the behaviour like before 1.30.0 in case coursier can't be run.
I think falling back to previous behaviour should help.
Btw. If we find coursier on PATH we will use that and not download anything, so this could be a workaround for now.
Alternatively, we could allow people to have metals on their PATH and just run that if it's available. :thinking:
Per your suggestion, I made coursier available in the path and as you said, no additional Java was downloaded and metals starts normally.
I'm happy with this solution, but having metals as a dependency in my flake would be clearer than requiring coursier. Especially since coursier isn't used anyway (with java being found already).
Thanks for the quick reply, the good suggestion and the great work overall.
Describe the bug
With the automatic upgrade of the plugin to 1.30.0 Metals can't activate anymore.
To Reproduce Steps to reproduce the behavior:
Just install version 1.30.0
Expected behavior
Metals should keep working as it did before. It should be able to work with the java installation present on the system.
Screenshots
Installation:
Additional context
The release notes already lay out the problem. With the new approach to allowing a different version a binary of coursier is included in the extension.
However, on NixOS, by default, arbitrary executables, such as the bundled coursier, can't be run because of linker issues. While this can be worked around, the next step would be that a Java version is downloaded that has similar problems.
Again, NixOS can be configured to allow this, but the end result is not desirable. This means that "some" version of Java will be used. That version might be different on a fellow developer's machine and a CI server. It will indeed be the same major version of Java, but it is not guaranteed to be the exact same version.
So, for example, a setting that allows bypassing the need for a download such as explicitly setting the java home for the build and server separately would fix this issue. Or reverting to the behaviour like before 1.30.0 in case coursier can't be run.
Search terms
coursier, nix, download, javahome