-
Notifications
You must be signed in to change notification settings - Fork 950
Default to sbtn for sbt 2.x #7775
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
This changes the runner script logic to default to sbtn when sbt version is 2.x.
@@ -1127,6 +1127,7 @@ object NetworkClient { | |||
sbtArguments += s"-Dsbt.script=$sbtScript" | |||
} | |||
} | |||
if (!sbtArguments.contains("--server")) sbtArguments += "--server" |
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.
I think this is causing Metals to stop working with the embedded launcher jar:
2024.10.21 14:06:01 INFO BSP server: [info] server was not detected. starting an instance
2024.10.21 14:06:01 INFO BSP server: [warn] server is started using sbt-launch jar directly
2024.10.21 14:06:01 INFO BSP server: [warn] this is not the recommended way: .sbtopts and .jvmopts files are not loaded and SBT_OPTS is ignored
2024.10.21 14:06:01 INFO BSP server: [warn] either upgrade sbt to its latest version or make sure it is accessible from $PATH, and run 'sbt bspConfig'
2024.10.21 14:06:01 INFO BSP server: Unrecognized option: --server
2024.10.21 14:06:01 INFO BSP server: Error: Could not create the Java Virtual Machine.
2024.10.21 14:06:01 INFO BSP server: Error: A fatal exception has occurred. Program will exit.
should this happen now? I can't seem to figure out where --server
is added. The other option is to use the scripts, but that's a bigger change and we were pretty happy with how things worked with the launcher jar
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.
should this happen now?
No I only meant this to affect sbt
shell script invoking either the sbtn or sbt server. I didn't intend BSP to break. How is Metals invoking Network client? @adpi2 Do you have suggestion on how we should proceed?
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.
We invoke whatever is in the sbt.json generated by bspConfig method:
{"name":"sbt","version":"1.10.3","bspVersion":"2.1.0-M1","languages":["scala"],"argv":["/usr/lib/jvm/openjdk21/bin/java","-Xms100m","-Xmx100m","-classpath","/home/tgodzik/Documents/metals/tests/slow/target/e2e/sbt-server/generate/.bsp/sbt-launch.jar","xsbt.boot.Boot","-bsp","--sbt-launch-jar=/home/tgodzik/Documents/metals/tests/slow/target/e2e/sbt-server/generate/.bsp/sbt-launch.jar"]}⏎
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.
Splitting this out as a bug - #7792
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.
Is it possible to add some Metals & sbt integration test (on sbt or Metals repo) to automatically catch such issue?
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.
Since we're the one generating the BSP JSON, we should be running integration test of sbt vs sbt.
@eed3si9n Forgot to ask it back then but what is the behavior for Windows ARM? Does it default to x86_64 build of sbtn or does it default to the jar? Just want to make sure we have special handling for this particular case. |
This changes the runner script logic to default to sbtn when sbt version is 2.x.