RFR: JDK-8143296: javac-server/sjavac not compatible with LogFailures on Windows
Magnus Ihse Bursie
magnus.ihse.bursie at oracle.com
Tue Nov 24 13:56:29 UTC 2015
On 2015-11-19 12:10, Erik Joelsson wrote:
> On Windows, when trying to use the new javac-server mode (or sjavac),
> each java compilation process that spawns a javac server ends up
> waiting for that server to shut down before shutting down itself. This
> behavior is caused by the new LogFailure feature, where each javac
> invocation is wrapped with our logger.sh script, which in turn uses
> "tee" to record output to special log files.
>
> It has been a long standing known issue that sjavac on windows has not
> been compatible with having the automatic build log feature active,
> for the same reason. This old problem was worked around by simply
> disabling logging to file when using sjavac on windows. For the
> LogFailures feature, I would definitely prefer not having to disable it.
>
> It seems that spawning a completely detached background process on
> Windows can be a bit tricky, especially from java. You need to launch
> a process with certain flags and settings to the native
> CreateProcess() call and java.lang.ProcessBuilder is not providing an
> interface where those flags can be set.
>
> The solution then is to put another native program between the server
> java and the client java process. We already have one such program,
> fixpath, and we might as well add a new feature there. I have
> experimented and found a solution that works by adding a new optional
> parameter to fixpath "--detach". It launches the child process in
> detached mode as well as not inheriting handles. It also causes
> fixpath to exit right after spawning the process instead waiting for
> an exit code.
>
> Bug: https://bugs.openjdk.java.net/browse/JDK-8143296
> Webrev: http://cr.openjdk.java.net/~erikj/8143296/webrev.01/
The sjavac code is a bit tricky to follow, but your changes look good to me.
/Magnus
More information about the build-dev
mailing list