https://pantsbuild.org/ logo
f

few-airline-50721

10/19/2022, 12:21 AM
How can I set arbitrary pex parameters - e.g. PEX_ROOT - for all times pants runs pex?
Such as when generating a lock file
r

rough-vase-83553

10/19/2022, 12:43 AM
Usually this can be specified in the toml config. I'm still new to the architecture but IIUC most subsystems correspond to both CLI arguments as well as to toml config options Doesn't seem to be under references for pex, pex-binary-defaults, or pext-cli
e

enough-analyst-54434

10/19/2022, 3:05 AM
@few-airline-50721 can you fill in the why bit for more context 1st?
f

few-airline-50721

10/19/2022, 2:54 PM
@enough-analyst-54434 it looks like I can use
Copy code
[subprocess-environment]
env_vars.add = ["PEX_XXX","YYY"]
for many PEX parameters, but some cannot be changed like
PEX_ROOT
since it’s already set in the code
e

enough-analyst-54434

10/19/2022, 2:57 PM
I'm interested in why you want to change the PEX_ROOT. What issue are you trying to solve by doing so?
You can change the parent directory of the PEX_ROOT Pants uses via: https://www.pantsbuild.org/docs/reference-global#named_caches_dir but that moves other names caches as well (for the JVM, etc.).
h

happy-kitchen-89482

10/19/2022, 7:46 PM
I’m wondering if this is due to @few-airline-50721’s Pants install running in an environment where it cannot write to that location? In that case moving all the named_caches would make sense.
👍 1
f

few-airline-50721

10/19/2022, 7:58 PM
Thanks for the tips. I was seeing some permissions issues and wanted to try this
3 Views