Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add extra_jvm_options for jvm_binary #5868

Closed
stuhood opened this issue May 24, 2018 · 3 comments
Closed

Add extra_jvm_options for jvm_binary #5868

stuhood opened this issue May 24, 2018 · 3 comments
Assignees

Comments

@stuhood
Copy link
Sponsor Member

stuhood commented May 24, 2018

Similar to extra_jvm_options on junit_tests, we should support extra_jvm_options on jvm_binary targets.

This would help to avoid wrapper scripts around ./pants run calls in many simple cases.

@stuhood
Copy link
Sponsor Member Author

stuhood commented Jul 27, 2018

A question was raised as to whether this should use a strategy similar to #6065 ... my feeling is that it maybe should not, and should let people use their own options.

The reason for that is that unlike compiler options, jvm options (and jvm properties) can be very specific to binaries/services (although some like memory settings aren't). Additionally, the jvm_options only affect runtime for the application, so "weird" JVM options aren't a hinderance to evolution/consistency of the code like compiler options would be.

@benjyw : Does that sound reasonable to you?

@benjyw
Copy link
Sponsor Contributor

benjyw commented Jul 27, 2018

Absolutely. There is an important distinction, even in implementation, between "running a JVM because a tool happens to be written in a JVM language" (e.g., ivy, zinc, antlr) and "running a JVM at the explicit request of a user." For example, the former can be nailgunned, the latter not.

So, as you say, compiler options are build configuration, but these are pretty much just passthru args.

@blorente
Copy link
Contributor

blorente commented Aug 6, 2018

I have made a fist attempt at this ☝️ ☝️

illicitonion pushed a commit that referenced this issue Sep 13, 2018
### Problem

Targets could not include custom jvm options to be passed to the `jvm_run` task.
This creates the need of wrapper scripts around calls to `./pants run ...`
Closes issue: #5868 

### Solution

The `jvm_binary.py` target now accepts `extra_jvm_options` as a parameter.
The `jvm_run.py` task now injects those options into the run command.

### Result

Users can now specify `extra_jvm_options` for `jvm_binary` targets.
@benjyw benjyw closed this as completed Jul 17, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants