Hi! MacOS - any one face issues with AppTranslocat...
# general
a
Hi! MacOS - any one face issues with AppTranslocator? We're experiencing some trouble when building a macos application, that includes a pex file as its executable. The problem is - when the pex is ran, it unpacks itself in ~/.pex (including an .so of python_bindings), which is outside the temporary directory created by the Translocator. Gatekeeper blocks the code from running once it tries to load the .so. Did anyone face the issue? Is there a way to force pex to run within its original directory? Thank you!
c
Hi, not sure if this helps, but have you tried a different execution mode? https://www.pantsbuild.org/docs/reference-pex_binary#codeexecution_modecode
l
pex --help
turns up something like:
Copy code
--pex-root PEX_ROOT   Specify the pex root used in this invocation of pex (if unspecified,
                        uses /Users/gauthamnair/.pex). (default: None)
👍 1
It works to do:
PEX_ROOT=somewhere/ yourpex.pex ...
Copy code
pex_same_dir $ pex flake8 -e flake8 -o flake.pex
pex_same_dir $ ls
flake.pex
pex_same_dir $ echo "foo=5" > lib.py
pex_same_dir $ PEX_ROOT=. ./flake.pex lib.py 
lib.py:1:4: E225 missing whitespace around operator
pex_same_dir $ ls
bootstraps              installed_wheels        unzipped_pexes
flake.pex               lib.py                  user_code
a
thanks for the help folks! Execution modes - all of them seem to default to running things from ~/.pex. Even venv. PEX_ROOT - looks helpful! Thank you.
👍 1