[POC] Start Bloop using bloop-rifle from Scala CLI… #4103
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
…rather than the launcher module from Bloop. See scalacenter/bloop#1753 for context.
bloop-rifle from Scala CLI is somehow a clean rewrite of both the launcher and the bloopgun modules of Bloop. It starts / stop Bloop servers, runs Bloop commands via the nailgun protocol, and opens BSP connections to the Bloop server.
Note that this PR isn't ready to be merged yet: bloop-rifle currently requires Java 17 to work well (for its domain socket support, but also to start the Bloop daemon too, that also needs this support). So this should wait until Metals switches to it. This also starts Scala CLI's own Bloop fork, so we should rather wait until Bloop mainline and this fork converged.
The bloop-rifle module from Scala CLI should be moved to a repository of its own, and be polished from there, so that it's not too tied to Scala CLI. Some directory conventions are hard-coded in this PR, and should rather live in bloop-rifle.
Note that this doesn't make Metals use the same server instance as Scala CLI yet. In the PR here, I tried to settle for shared conventions for Bloop directories (location of the directory containing the nailgun socket file, the PID file, the server output file, and location of the directory containing BSP socket files). Scala CLI doesn't use these directories yet, but puts these in directories of its own for now.