RFR: 8256308: Send arguments to javac server in a config file [v5]
Erik Joelsson
erikj at openjdk.java.net
Fri Nov 13 14:32:03 UTC 2020
On Fri, 13 Nov 2020 01:08:09 GMT, Magnus Ihse Bursie <ihse at openjdk.org> wrote:
>> Currently, to use the javac server, a horrendously long command line option is created, looking like this: `--server:portfile=<path to portfile>:sjavac=<command to launch server>`, where the sjavac command has had all spaces replaced by %20. Since Project Jigsaw, the set of module arguments needed is huge to begin with, making this command line incomprehensible after mangling.
>>
>> Apart from making java command lines hard to read (and copy/paste!) by developers, it also makes it hard for scripts to parse. The upcoming winenv rewrite is dependent on being able to differentiate between path names and other arguments, which is not possible in this mess.
>>
>> So, instead, let's write it to a file, without any escaping, and just pass the configuration file name to the server.
>>
>> Note that this will change the behavior of the javac server, but as the source code states this is not a documented or externally supported API no CSR is needed.
>>
>> I also cleaned up some code in SjavacClient, in particular code relating to the passing of arguments. (We never change poolsize or keepalive when we call it.)
>
> Magnus Ihse Bursie has updated the pull request incrementally with one additional commit since the last revision:
>
> MODULE_SUBDIR must be defined before using
make/common/JavaCompilation.gmk line 237:
> 235: $1_JAVAC_SERVER_CMD := $$(JAVA_DETACH) $$($1_JAVA_FLAGS) $$($1_JAVAC)
> 236:
> 237: $1_CONFIG_VARDEPS :=$$($1_JAVAC_PORT_FILE) $$($1_JAVAC_SERVER_CMD)
Space
make/common/JavaCompilation.gmk line 239:
> 237: $1_CONFIG_VARDEPS :=$$($1_JAVAC_PORT_FILE) $$($1_JAVAC_SERVER_CMD)
> 238: $1_CONFIG_VARDEPS_FILE := $$(call DependOnVariable, $1_CONFIG_VARDEPS, \
> 239: $$($1_BIN)$$($1_MODULE_SUBDIR)/_the.$1.config_vardeps)
Indentation 4
make/common/JavaCompilation.gmk line 246:
> 244: $1_ECHO_COMMAND := $(ECHO)
> 245: endif
> 246: $$($1_JAVAC_SERVER_CONFIG): $$($1_CONFIG_VARDEPS_FILE)
Indentation?
-------------
PR: https://git.openjdk.java.net/jdk/pull/1195
More information about the compiler-dev
mailing list