hundreds-father-404
02/23/2021, 12:41 AM$ wget <https://github.com/pantsbuild/pex/releases/download/v2.1.31/pex>
$ which -a python2.7
# Copy the path to your system Python 2.7
$ <python2.7> ./pex --venv --seed
happy-kitchen-89482
02/23/2021, 12:42 AMhappy-kitchen-89482
02/23/2021, 12:43 AMhappy-kitchen-89482
02/23/2021, 12:43 AMfast-nail-55400
02/23/2021, 12:43 AMtdyas@paradox:~$ /usr/bin/python2.7 ./pex --venv --seed
Python 2.7.16 (default, Dec 21 2020, 23:00:36)
[GCC Apple LLVM 12.0.0 (clang-1200.0.30.4) [+internal-os, ptrauth-isa=sign+stri on darwin
Type "help", "copyright", "credits" or "license" for more information.
(InteractiveConsole)
>>>
hundreds-father-404
02/23/2021, 12:44 AMpex.executor.NonZeroExit: received exit code 100 during execution of `['/System/Library/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python', '-s', '-E', '/private/var/folders/hm/qjjq4w3n0fsb07kp5bxbn8rw0000gn/T/tmpy3fBiI', '--no-pip', '--no-setuptools', '--no-wheel', '/Users/eric/.pex/venvs/d747c0f95e20fa8c832124357460aedcfa97f5dc/800ae8ef047bd783543e8282c22bfdbee7b7fca8.54c57459721a4b908085a315d20233b8']` while trying to execute `['/System/Library/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python', '-s', '-E', '/private/var/folders/hm/qjjq4w3n0fsb07kp5bxbn8rw0000gn/T/tmpy3fBiI', '--no-pip', '--no-setuptools', '--no-wheel', '/Users/eric/.pex/venvs/d747c0f95e20fa8c832124357460aedcfa97f5dc/800ae8ef047bd783543e8282c22bfdbee7b7fca8.54c57459721a4b908085a315d20233b8']`
Thank you both! I wonder if this is a weird mac Silicon thing..enough-analyst-54434
02/23/2021, 12:44 AMhundreds-father-404
02/23/2021, 12:45 AMenough-analyst-54434
02/23/2021, 12:45 AMhundreds-father-404
02/23/2021, 12:45 AM--venv
is fine and --unzip --seed
is fineenough-analyst-54434
02/23/2021, 12:46 AMenough-analyst-54434
02/23/2021, 12:46 AMenough-analyst-54434
02/23/2021, 12:47 AMhundreds-father-404
02/23/2021, 12:47 AM/System/Library/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python ./pex --venv
fails for me, whereas /System/Library/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python ./pex --venv -o test.pex
does succeed until running ./test.pex
enough-analyst-54434
02/23/2021, 12:47 AMhundreds-father-404
02/23/2021, 12:48 AMhundreds-father-404
02/23/2021, 12:52 AMenough-analyst-54434
02/23/2021, 12:52 AMenough-analyst-54434
02/23/2021, 12:52 AMenough-analyst-54434
02/23/2021, 12:52 AMenough-analyst-54434
02/23/2021, 12:52 AMhundreds-father-404
02/23/2021, 12:58 AM❯ /System/Library/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python ./virtualenv_16.7.10_py --no-pip --no-setuptools --no-wheel dest_venv
New python executable in /Users/eric/code/pants/dest_venv/bin/python
ERROR: The executable /Users/eric/code/pants/dest_venv/bin/python is not functioning
ERROR: It thinks sys.prefix is '/Users/eric/code/pants' (should be u'/Users/eric/code/pants/dest_venv')
ERROR: virtualenv is not compatible with this system or executable
❯ ./dest_venv/bin/python
[1] 15655 killed ./dest_venv/bin/python
enough-analyst-54434
02/23/2021, 1:00 AMhundreds-father-404
02/23/2021, 1:26 AMproc.returncode
is -9
at the end of the try block, and proc_stdout
is ""
.
❯ python2
>>> import os.path
>>> os.path.normcase(os.path.realpath(""))
'/Users/eric/code/pants'
norm_home_dir
is correctly being set to /Users/eric/code/pants/dest_venv/bin/python
, but that doesn't == proc_stdout
, i.e. the cwd /Users/eric/code/pants/dest_venv
, so the script is erroring with an exit code of 100 and that log.
The fundamental issue seems to be that /Users/eric/code/pants/dest_venv/bin/python
fails with an exit code 137 when run directly, -9
when run in the virtualenv script. But it's obfuscated by a confusing error message because the script is not eagerly validating the process had a zero exit codeenough-analyst-54434
02/23/2021, 1:45 AMhundreds-father-404
02/23/2021, 1:47 AMsigkill -9
iiuc. Is something like this best investigated via core dump?
❯ ./dest_venv/bin/python
[1] 15655 killed ./dest_venv/bin/python
enough-analyst-54434
02/23/2021, 1:50 AMenough-analyst-54434
02/23/2021, 1:52 AMenough-analyst-54434
02/23/2021, 1:53 AMenough-analyst-54434
02/23/2021, 1:54 AM