From 7134456fadd5b6e127385a73d969a59d1cbe298e Mon Sep 17 00:00:00 2001 From: Yi Cheng Date: Sun, 13 Oct 2019 23:40:47 -0700 Subject: [PATCH] Use jvm options from RSC subsystem for RSC invocation (#8434) ### Problem Actual RSC invocation under `compile.rsc` is using `--compile-rsc-jvm-options` meant for zinc. Therefore, if security manager was involved for zinc, it could cause RSC invocation to fail like below: ``` 23:53:22 [DEBUG] pants.engine.scheduler:pid=53433: computed 1 nodes in 1.325367 seconds. there are 3121 total nodes. Error occurred during initialization of VM java.lang.InternalError: Could not create SecurityManager: __shaded_by_pants__.com.company.common_internal.compile_security.CompileSecurityManager at sun.misc.Launcher.(Launcher.java:103) at sun.misc.Launcher.(Launcher.java:54) at java.lang.ClassLoader.initSystemClassLoader(ClassLoader.java:1451) at java.lang.ClassLoader.getSystemClassLoader(ClassLoader.java:1436) ``` ### Solution Introduce a separate set of jvm options for RSC Subsystem, which does not use `--compile-rsc-jvm-options`, but `--rsc-jvm-options`. --- src/python/pants/backend/jvm/subsystems/rsc.py | 2 ++ .../backend/jvm/tasks/jvm_compile/rsc/rsc_compile.py | 9 ++++----- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/src/python/pants/backend/jvm/subsystems/rsc.py b/src/python/pants/backend/jvm/subsystems/rsc.py index fca235e7613..bac6a001a71 100644 --- a/src/python/pants/backend/jvm/subsystems/rsc.py +++ b/src/python/pants/backend/jvm/subsystems/rsc.py @@ -18,6 +18,8 @@ def register_options(cls, register): register('--native-image', fingerprint=True, type=bool, help='Use a pre-compiled native-image for rsc. Requires running in hermetic mode') + register('--jvm-options', type=list, metavar='