Conversation
- Add sbtwProj: Scala 3.3.7 launcher with scopt, drop-in for sbt.bat - Config: .sbtopts, .jvmopts, sbtconfig.txt, JAVA_OPTS/SBT_OPTS precedence - Options: --client, --server, --jvm-client, mem, sbt-version, java-home, etc. - sbt 2.x defaults to native client; --server forces JVM launcher - JVM run via xsbt.boot.Boot; native via sbtn with --sbt-script - build.sbt: sbtwProj in root build and allProjects; NativeImagePlugin - Fixes: JAVA_OPTS then .jvmopts, build.properties trim, shutdownAll PID, Iterator.lastOption
|
Could you test this against the integration tests in https://github.com/sbt/sbt/blob/develop/launcher-package/integration-test/src/test/scala/ directory to see if we can use sbtw as the drop-in replacement for |
…Dsbt.test.useSbtw=true) - Add LauncherTestHelper: use sbtw (JVM) when -Dsbt.test.useSbtw=true on Windows - Wire RunnerScriptTest, RunnerMemoryScriptTest, ExtendedRunnerTest, BspConfigTest - launcherPackageIntegrationTest depends on sbtwProj - CI (Windows): run launcherPackageIntegrationTest twice (sbt.bat, then sbtw) - Workflow comment: verify sbtw native image built, do not run (scopt/Graal)
Done. Integration tests support sbtw via |
When useSbtw=true, LauncherTestHelper runs 'java -cp ... sbtw.Main' using java.class.path, which is incomplete in the test JVM. Pass the full test classpath via -Dsbt.test.classpath in launcherPackageIntegrationTest (fork=true, javaOptions) and use it in LauncherTestHelper when set.
Resolve sbt script and citest paths relative to integration-test base directory via sbt.test.integrationtest.basedir, so forked tests no longer depend on CWD. Fixes 'file not found' on Windows when CWD is not the integration-test project dir.
…kflow comment - ArgParser: use optional brace / fewer braces style per sbt coding style - Runner.runJvm: use Java ProcessBuilder with inheritIO() for interactive sbt - client-test.yml: clarify why sbtw native image is not smoke-tested
Per contributing-docs/03_coding_style.md: object/trait with : and end, if/while with then/do, fewer braces, colon syntax for lambdas.
eed3si9n
left a comment
There was a problem hiding this comment.
If lazy val causes issues, could you see if the problem can be fixed if we bumped to Scala 3.8.1? If native-image doesn't work, we should drop that from this PR (I'm still ok landing this PR with or without native-image).
|
Tried bumping to 3.8.1 first — native image still builds but the binary crashes at runtime with the same scopt lazy val issue, so that didn’t fix it. I’ve dropped sbtw native-image from this PR (removed from CI and the sbtw project in build.sbt). sbtw is still tested as the JVM runner on Windows. |
Summary
Adds sbtw, a Windows-only drop-in launcher that replaces
sbt.bat.What’s included
sbtw/): Scala 3.3.7, scopt-based CLI.sbtopts,.jvmopts,sbtconfig.txt, env--server)sbtwProjwith NativeImagePlugin;target/bincreated before native-image to fix CI.github/workflows/sbtw-release.yml— build sbtw on Windows and attach to releasesTesting
sbtwProj/compile,sbtwProj/test,sbtwProj/scalafmtCheckpassCloses #5406