You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
After setting PEX_ROOT, pex still attempts to write to ~/.pex -- notably trying to create ~/.pex/interpreters.
This is a problem because on our build system the build process's users $HOME is non-writeable.
I suspect that the default values for the flags in pex.py lines 162 and 269 are at fault here; expanding to the $HOME regardless of the PEX_ROOT setting.
(For the time being have worked round this by setting flags explicitly.)
Thanks,
Katie
The text was updated successfully, but these errors were encountered:
Sorry for the huge delay, but this issue has been revived through a reference.
How do you set PEX_ROOT? NB: A very confusing aspect of pex is its build time vs runtime behavior.
At build time, if you set PEX_ROOT as an env var or pass the --pex-root flag to the cli, you only set the PEX_ROOT for the build process and not for the runtime of the resulting pex when executed. The pex --help hints at this:
$ pex --help
...
--pex-root=PEX_ROOT Specify the pex root used in this invocation of pex.
[Default: ~/.pex]
...
So, to set PEX_ROOT at runtime you need to do one of:
Ensure the desired PEX_ROOT environment variable is exported.
Set PEX_ROOT inline if using a shell like bash; ie PEX_ROOT=x ./my.pex ...
Deploy appropriate pexrc files on target machines. These can be in 3 locations:
sibling to the pex file being run in .pexrc
in ~/.pexrc
in /etc/pexrc
Line in pexrc are env-var lines like PEX_ROOT=y and they are read and applied with the precedence above, a sibling .pexrc having the highest precedence.
We currently offer no option to embed the PEX_ROOT setting in the pex at build time since pexes are generally non-machine specific - they can run anywhere; so the PEX_ROOT embedded in the pex if we supported this might not exist or be appropriate on some target hosts.
After setting PEX_ROOT, pex still attempts to write to ~/.pex -- notably trying to create ~/.pex/interpreters.
This is a problem because on our build system the build process's users $HOME is non-writeable.
I suspect that the default values for the flags in pex.py lines 162 and 269 are at fault here; expanding to the $HOME regardless of the PEX_ROOT setting.
(For the time being have worked round this by setting flags explicitly.)
Thanks,
Katie
The text was updated successfully, but these errors were encountered: