[2.x] Fix debug options breaking launcher on Windows#8440
[2.x] Fix debug options breaking launcher on Windows#8440eed3si9n merged 2 commits intosbt:developfrom
Conversation
Filter rt-ext-dir output for java9-rt-ext- pattern, matching the Unix script behavior. This prevents debug agent stdout (e.g., 'Listening for transport dt_socket at address: 1234') from being incorrectly parsed as a file path. Fixes sbt#8100
|
@eed3si9n Please have a look at the PR and let me know your feedback. |
|
Thank you for signing the Scala CLA. If you have already sent a pull request please add a comment to the pull request saying you did sign the CLA. We are looking forward to your contributions! The Scala Team Just got the reply from the team. |
|
Reran the CLA check, and it passed. |
|
@eed3si9n Can you please merge this PR and close the issue? |
|
I'm leaving it open in case others want to review it as well. |
anatoliykmetyuk
left a comment
There was a problem hiding this comment.
LGTM, would be good to explore adding a regression test here.
@anatoliykmetyuk please have a look at the changes. |
|
Great, thanks @MkDev11 ! |
|
@eed3si9n When are you going to merge the PR? |
|
We can land it once the CI passes. |
All passed! |
Fix debug options breaking launcher on Windows
Fixes #8100
Steps
On Windows with sbt 1.10.11, setting debug options via
SBT_OPTSbreaks the launcher:Problems
When the JVM debug agent starts, it prints
Listening for transport dt_socket at address: 1234to stdout. Thecopyrtfunction captures this output and tries to parse it as a file path, which fails withInvalidPathExceptiondue to the colon character.The root cause is that the Windows batch script reads the first line of
--rt-ext-diroutput without any filtering:Expectations
sbt should launch normally even when debug options are set, allowing developers to attach a debugger.
Solution
I added filtering to the Windows batch script so it only picks up the line containing
java9-rt-ext-, which is the actual path we care about. This matches what the Unix script already does withgrep java9-rt-ext-.Now any debug agent noise gets ignored, and only the rt.jar path is captured.
Notes
As discussed with @eed3si9n in #8100, this is a minimal fix that brings the Windows script in line with the Unix behavior. A more robust solution (using a
RTJAR=prefix) could be done later if needed, but this should address the immediate issue.Contribution by Gittensor, see my contribution statistics at https://gittensor.io/miners/details?githubId=94194147