-
Notifications
You must be signed in to change notification settings - Fork 950
Use -Dsbt.script
to start sbt server
#6593
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
Conversation
In order to start the sbt server we must use the sbt script because it is the only way to load the .sbtopts and the .jvmopts file properly. To do so the sbt script can pass a -Dsbt.script prop to the java server. It is used in the NetworkClient to start the server, and it is replicated in the BuildServerConnection file (.bsp/sbt.json).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the PR, I successfully tested it on my laptop for our enteprise use case: we want BSP clients to honor the -Dsbt.repository.config
/ -Dsbt.override.build.repos
flags from .sbtopts
to get a safe, deterministic build.
protocol/src/main/scala/sbt/internal/bsp/BuildServerConnection.scala
Outdated
Show resolved
Hide resolved
protocol/src/main/scala/sbt/internal/bsp/BuildServerConnection.scala
Outdated
Show resolved
Hide resolved
protocol/src/main/scala/sbt/internal/bsp/BuildServerConnection.scala
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🙇
In order to start the sbt server we must use the sbt script because it is the only way to load the .sbtopts and the .jvmopts files properly.
To do so the sbt script can pass a
-Dsbt.script
option to the Java process:-Dsbt.script
is used to start the server-Dsbt.script
is written into the.bsp/sbt.json
fileExample of
bsp/sbt.json
file:This PR fixes #6575 and #6476, and part of #6468.
This PR makes #6580 not necessary (except if IntelliJ starts sbt using the sbt-launch.jar directly).