How can I set arbitrary pex parameters - e.g. PEX_...
# general
f
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
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
@few-airline-50721 can you fill in the why bit for more context 1st?
f
@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
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
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
Thanks for the tips. I was seeing some permissions issues and wanted to try this