sbt/main-command
Dream 8d9a0027e2
[2.x] fix: Print server stderr on startup failure (#8816)
**Problem**
When the sbt server fails to start (e.g. wrong JDK version), the client
only shows "failed to connect to server" hiding the actual error. The
server stderr is redirected to /dev/null to prevent Linux pipe buffer
deadlocks (#8442), so diagnostic output is lost.

**Solution**
Redirect server stderr to a temp file instead of /dev/null. When the
server fails to start (portfile never appears), read and print the temp
file contents before throwing ServerFailedException. The temp file is
cleaned up eagerly on both success and failure paths.

Fixes #8812
2026-02-26 00:31:09 -05:00
..
src [2.x] fix: Print server stderr on startup failure (#8816) 2026-02-26 00:31:09 -05:00