https://pantsbuild.org/ logo
#general
Title
# general
b

best-nightfall-7221

01/08/2020, 7:10 PM
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

aloof-angle-91616

01/08/2020, 7:11 PM
what is your goal here? what default options would you want to specify on the command line?
b

best-nightfall-7221

01/08/2020, 7:12 PM
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

witty-crayon-22786

01/08/2020, 7:14 PM
pants.ini has a "[DEFAULT]" section that can be useful for that case
a

aloof-angle-91616

01/08/2020, 7:14 PM
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

best-nightfall-7221

01/08/2020, 7:14 PM
yep, i have stuff in there, but for something like travis, i wanna override it
a

aloof-angle-91616

01/08/2020, 7:14 PM
you could potentially add another config file
b

best-nightfall-7221

01/08/2020, 7:14 PM
i see you guys dynamically generate the travis.yml file 🙂 , was hoping to avoid that
w

witty-crayon-22786

01/08/2020, 7:14 PM
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

hundreds-father-404

01/08/2020, 7:15 PM
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

best-nightfall-7221

01/08/2020, 7:16 PM
ahh, good point. yeah i guess i can add in another
pants-travis.ini
with my overrides
cool will try that, thanks!
w

witty-crayon-22786

01/08/2020, 7:16 PM
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

best-nightfall-7221

01/08/2020, 8:58 PM
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

witty-crayon-22786

01/08/2020, 8:58 PM
the "default" only applies where something is not defined
b

best-nightfall-7221

01/08/2020, 8:59 PM
ah i see, i have
binary.dup.skip: True
in pants.ini
3 Views