Bazel: Windows: implement java launcher

Created on 9 Dec 2016  路  8Comments  路  Source: bazelbuild/bazel

The current java launcher is a shell script.
In order to implement https://github.com/bazelbuild/bazel/issues/2107, we need to come up with a different launcher -- native C++ launcher app, powershell script, batch file, something.

P2 windows feature request

Most helpful comment

I vote for C++ to have only one code to rule them all :) Python would be ok too but add a dependency to python for the Java rule so I'd rather not.

Also if C++ then we can use the JVM interface to launch the JVM in the same process.

All 8 comments

I vote for PowerShell unless startup times get too bad.

I vote for C++ to have only one code to rule them all :) Python would be ok too but add a dependency to python for the Java rule so I'd rather not.

Also if C++ then we can use the JVM interface to launch the JVM in the same process.

@damienmg: That's a really interesting idea, launching the java_binary in-process. This would mean we save the cost of a JVM startup, but also the app or bazel crashing would crash the other -- not necessarily good.

And I also vote for C++ because it's portable a little less unportable than scripts.

I vote for C++ to have only one code to rule them all :) Python would be ok too but add a dependency to python for the Java rule so I'd rather not.

Actually another reason to not use PowerShell is that there seems to be some policy that prevents Scripts from being executed by the user (the usual Windows policy hell). We currently wrap our PowerShell inside of batches to workaround that.

Yes, for powershell one has to usually get the user to change their ExecutionPolicy to something more lenient than the default Restricted. But of course, I think one can just shell out to cmd to call powershell.exe to do that pretty silently 馃檮 . https://technet.microsoft.com/en-us/library/ee176961.aspx

@meteorcloudy made great progress with this already, see https://github.com/bazelbuild/bazel/commit/09dd8c0330a3e18951d9481751ef99d3668115c0

Is there anything else to do with this bug? The native launcher is the default and working well.

54c5c5cf41bd47d11ea309f37697d83ae65fe9e7 should have closed this bug ;)

Was this page helpful?
0 / 5 - 0 ratings