Hi, I'm on pants 1.16. Is there a way to specify d...
# general
b
Hi, I'm on pants 1.16. Is there a way to specify default options on the command line?
Copy code
./pants --jvm-options="-Xmx1g" options | grep shader.jvm_options
shader.jvm_options = ['-Xmx256m', '-Xmx3g', '-XX:+UseParallelGC'] (from CONFIG_DEFAULT in pants.ini)
https://www.pantsbuild.org/options.html#command-line-flags mentions its possible for global options, but I guess not default options?
a
what is your goal here? what default options would you want to specify on the command line?
b
I want to set every scope's
jvm_options
to a specific value. I know i can do it if i specify the scope
Copy code
./pants --shader-jvm-options="-Xmx1g" options | grep shader.jvm_options
shader.jvm_options = ['-Xmx256m', '-Xmx3g', '-XX:+UseParallelGC', '-Xmx1g'] (from FLAG in pants.ini)
w
pants.ini has a "[DEFAULT]" section that can be useful for that case
a
hm, yes, i believe this is only doable in a config file right now, but there’s no reason that needs to be the case. since we can clearly tell that CONFIG_DEFAULT is being used i think our options system should be able to support this if it’s desired
b
yep, i have stuff in there, but for something like travis, i wanna override it
a
you could potentially add another config file
b
i see you guys dynamically generate the travis.yml file 🙂 , was hoping to avoid that
w
oooh, i see what you mean.
@best-nightfall-7221: a common pattern is to use another pants.ini file, and specify it in CI.
h
i see you guys dynamically generate the travis.yml file
This is only for deduplication because our CI is really complex. We use
pants.travis-ci.ini
to handle different Pants config in CI
b
ahh, good point. yeah i guess i can add in another
pants-travis.ini
with my overrides
cool will try that, thanks!
w
the "[default]" section concept is implemented entirely in the ini config parser, unfortunately. and using it is really only needed for things like jvm_options which were spotily converted to subsystems a while back.
b
Hmm I'm noticing some weird behavior. For a few flags,
pants-traivs.ini
properly overrides the value, in other cases it doesnt
Copy code
./pants --pants-config-files=pants-travis.ini options | grep jvm_options

analysis.zinc.jvm_options = ['-Xmx2g'] (from CONFIG_DEFAULT in pants-travis.ini)
binary.dup.jvm_options = ['-Xmx4g'] (from CONFIG in pants.ini, in pants.ini)
I have
jvm_options: ['-Xmx4g']
in my
pants.ini
and then exact same line with 2g in my
pants-travis.ini
. Seems like it takes affect for one option but not the other?
w
the "default" only applies where something is not defined
b
ah i see, i have
binary.dup.skip: True
in pants.ini