A JVM subsystem.

Review Request #2423 — Created June 26, 2015 and submitted

benjyw
pants
f4c947c...
pants-reviews
stuhood, zundel
This is primarily for tasks whose job is to run a JVM, such as
JunitRun, ScalaRepl, JvmRun etc. Basically, anything that extends
JvmTask.

This is not for tasks that happen to use some JVM-based tool to
do their work, i.e., tasks that mix in JvmToolTaskMixin.  A separate
change will subsystem-ize those tools.

The distinction is necessary because, for example, with the former
it makes sense to set the program args via an option, whereas
with the latter the program args are determined by the task.

All unit tests pass locally. Full CI passes here: https://travis-ci.org/pantsbuild/pants/builds/68875287.

BE
ZU
  1. 
      
  2. nit extra n/l

  3. I looked around and found a bug in a similar option:

    /Users/zundel/Src/Pants/src/python/pants/backend/project_info/tasks/ide_gen.py:  register('--debug_port', type=int, default=5005,
    

    The option shouldn't have an underscore - it should be --debug-port

    Would you mind fixing it in this change? If not, I'll submit it separately.

  4. 
      
BE
BE
BE
ZU
  1. I patched this in and looked at the help output. Maybe there is a problem with my patching job?

    1) I don't see any help output for the jvm subsystem.

    2) It seems to show jvm_options still set the way they were, but that and the defaults don't jive with the way the sections look in pants.ini:

      --compile-java-jvm-options=_compile.java_jvm_options__
      --jvm-options _COMPILE.JAVA_JVM_OPTIONS__
                              Run the compiler with these JVM options. (default:
                              [u'-Xmx1g', u'-XX:MaxPermSize=256m'])
    

    but in your pants.ini:

    [jvm.compile.java]
    options: ["-Xmx2G"]
    

    The default printed above appears to inherit from the default set in pants.ini.

    1. Aha, that is a bug. Only the JvmTask subclasses were supposed to have their options migrated. JvmCompile is not a JvmTask, and registers its own --jvm-options option. I shall fix appropriately.

    2. Also, re the help messages - subsystems don't show up in help currently, that's next on my radar to fix.

  2. 
      
BE
ZU
  1. Ship It!
    1. Thanks for the review, and for catching that option migration issue!

  2. 
      
BE
Review request changed

Status: Closed (submitted)

Change Summary:

Submitted as bf21c266537d65ab3d9aa23d1d55d4e2654d2770.

Loading...