curved-television-6568
03/25/2021, 1:53 PM~/src/.../
$ /private/var/folders/8j/c8jf_msj009947wyw82xvdkw0000gn/T/process-executionQXCoGY/pylint_runner.pex --version
Traceback (most recent call last):
File "/usr/local/Cellar/python@3.8/3.8.5/Frameworks/Python.framework/Versions/3.8/lib/python3.8/runpy.py", line 194, in _run_module_as_main
return _run_code(code, main_globals, None,
File "/usr/local/Cellar/python@3.8/3.8.5/Frameworks/Python.framework/Versions/3.8/lib/python3.8/runpy.py", line 87, in _run_code
exec(code, run_globals)
File "/private/var/folders/8j/c8jf_msj009947wyw82xvdkw0000gn/T/process-executionQXCoGY/pylint_runner.pex/__main__.py", line 74, in <module>
File "/private/var/folders/8j/c8jf_msj009947wyw82xvdkw0000gn/T/process-executionQXCoGY/pylint_runner.pex/__main__.py", line 31, in __maybe_run_venv__
File "/private/var/folders/8j/c8jf_msj009947wyw82xvdkw0000gn/T/process-executionQXCoGY/pylint_runner.pex/.bootstrap/pex/variables.py", line 689, in venv_dir
File "/private/var/folders/8j/c8jf_msj009947wyw82xvdkw0000gn/T/process-executionQXCoGY/pylint_runner.pex/.bootstrap/pex/variables.py", line 687, in add_pex_path_items
File "/private/var/folders/8j/c8jf_msj009947wyw82xvdkw0000gn/T/process-executionQXCoGY/pylint_runner.pex/.bootstrap/pex/pex_info.py", line 99, in from_pex
FileNotFoundError: [Errno 2] No such file or directory: 'pylint.pex/PEX-INFO'
~/src/.../
$ cd /private/var/folders/8j/c8jf_msj009947wyw82xvdkw0000gn/T/process-executionQXCoGY
/private/var/folders/8j/c8jf_msj009947wyw82xvdkw0000gn/T/process-executionQXCoGY
$ ls
__plugins pylint.pex pylint_runner.pex_bin_python_shim.sh requirements.pex
__run.sh pylint_runner.pex pylint_runner.pex_pex_shim.sh src
/private/var/folders/8j/c8jf_msj009947wyw82xvdkw0000gn/T/process-executionQXCoGY
$ ./pylint_runner.pex --version
pylint 2.7.2
...
enough-analyst-54434
03/25/2021, 3:00 PM./pylint_runner.pex
file is an "aggregator" PEX that is empty save for specifying a PEX_PATH in its metadata. In this case, Pants uses a relative PEX_PATH and so the PEX can only be run from the sandbox root where the paths are relative to.
You were trying to run the PEX file directly which there may not be much to do about, but we could lessen surprises by having the __run.sh
script - which is supposed to emulate the process execution Pants performed - do a cd to the proper workdir before continuing. If __run.sh
had that improved fidelity and you had used it, then surprise could have been avoided.curved-television-6568
03/25/2021, 3:42 PM__run.sh
script.enough-analyst-54434
03/25/2021, 4:30 PM<path to pex>/<relative pex path>
at runtime so that CWD would not be a factor. I need to think through any corners though.curved-television-6568
03/26/2021, 9:23 AM