New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
pex python interpreter path contains absolute path from previous remote execution sandbox #13170
Comments
To reproduce:
|
I tried changing the |
It does. The regression occurred some time after 2.3.x and I have not bisected yet. Given the length of time / number of changes, probably not worth bisecting. |
This doesn't make alot of sense since we have no append only caches facility when remoting. As such, the file |
Info on Buildfarm that may or may not be relevant: Buildfarm hard links all of the files in the input root into its local CAS cache. See discussion at https://buildteamworld.slack.com/archives/C9C4H1SN7/p1633710791295800. |
Thanks - that shouldn't be relevant since the relevant input root is:
The relevant packed wheel contains: $ unzip -qc mypy_protobuf.pex/.deps/mypy_protobuf-2.4-py3-none-any.whl bin/protoc-gen-mypy | head -1
#!python And the relevant shim script contains: $ cat mypy_protobuf.pex_bin_protoc-gen-mypy_shim.sh
#!/usr/bin/bash
set -euo pipefail
# N.B.: We convert all sandbox root relative paths to absolute paths so this script
# works when run with a cwd set elsewhere.
# N.B.: This relies on BASH_SOURCE which has been available since bash-3.0, released in
# 2004. In turn, our use of BASH_SOURCE relies on the fact that this script is executed
# by the engine via its absolute path.
ABS_SANDBOX_ROOT="${BASH_SOURCE%/*}"
function ensure_absolute() {
local value0="$1"
shift
if [ "${value0:0:1}" == "/" ]; then
echo "${value0}" "$@"
else
echo "${ABS_SANDBOX_ROOT}/${value0}" "$@"
fi
}
export PATH=/home/jsirois/.cache/pants/pants_dev_deps/Linux.x86_64.unknown.py37.venv/bin:/home/jsirois/.cargo/bin:/home/jsirois/.pyenv/bin:/home/jsirois/bin:/home/jsirois/.local/bin:/usr/local/bin:/usr/bin:/usr/local/sbin:/usr/lib/jvm/default/bin:/usr/bin/site_perl:/usr/bin/vendor_perl:/usr/bin/core_perl:/home/jsirois/go/bin:/home/jsirois/.bash.d/bin PEX_IGNORE_RCFILES=true PEX_ROOT=.cache/pex_root LANG=en_US.UTF-8
export PEX_ROOT="$(ensure_absolute ${PEX_ROOT})"
execute_pex_args="$(ensure_absolute /usr/bin/python3.6) $(ensure_absolute mypy_protobuf.pex)"
target_venv_executable="$(ensure_absolute .cache/pex_root/venvs/89c5e62b4572637dc3b077e8d663e561c89a2920/061a3a67f6a451d33806aa2696288de4ee1b175c/bin/protoc-gen-mypy)"
venv_dir="$(ensure_absolute .cache/pex_root/venvs/89c5e62b4572637dc3b077e8d663e561c89a2920/061a3a67f6a451d33806aa2696288de4ee1b175c)"
# Let PEX_TOOLS invocations pass through to the original PEX file since venvs don't come
# with tools support.
if [ -n "${PEX_TOOLS:-}" ]; then
exec ${execute_pex_args} "$@"
fi
# If the seeded venv has been removed from the PEX_ROOT, we re-seed from the original
# `--venv` mode PEX file.
if [ ! -e "${target_venv_executable}" ]; then
rm -rf "${venv_dir}" || true
PEX_INTERPRETER=1 ${execute_pex_args} -c ''
fi
exec "${target_venv_executable}" "$@" No references to any absolute paths from yore in sight. It's as-if the |
Oh, hm - My examples above were all taken from a local process execution sandbox. Continuing to dig. |
I would try running it in Buildfarm (using the config in remote-apis-testing). This error only happens in Buildfarm. The code works fine running in Buildbarn and Buildgrid. |
Yeah - I am. Using your setup above. I just used a local run too to easily grok what's going on. Not as easy to do that in BuildFarm without re-familiarizing myself with its knobs to observe / keep around sandboxes. |
I verified that the error occurs with v2.5.2 and Buildfarm. (Tested with latest 2.5.x branch plus had to cherry-pick the archive extraction fix from 2.7.x of |
Works for 2.4.2. So the error was introduced somewhere between 2.4.2 and 2.5.2. |
I reproduced the failure by extracting the input root into its own directory and running the applicable command:
So Indeed happened for all of the similar scripts:
|
The
|
@jsirois: Any pointers on where to look to see how that wheel in #13170 (comment) is made? |
Welp: $ rm -rf ~/.pex
$ pex mypy-protobuf==2.4 --layout packed -omypy-protobuf.pex
$ ls -l mypy-protobuf.pex/.deps
total 1060
-rw-r--r-- 2 jsirois jsirois 15296 Oct 20 08:57 mypy_protobuf-2.4-py3-none-any.whl
-rw-r--r-- 2 jsirois jsirois 1067135 Oct 20 08:57 protobuf-3.18.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
$ zipinfo mypy-protobuf.pex/.deps/mypy_protobuf-2.4-py3-none-any.whl
Archive: mypy-protobuf.pex/.deps/mypy_protobuf-2.4-py3-none-any.whl
Zip file size: 15296 bytes, number of entries: 18
drwxr-xr-x 2.0 unx 0 b- stor 80-Jan-01 00:00 ../
drwxr-xr-x 2.0 unx 0 b- stor 80-Jan-01 00:00 mypy_protobuf-2.4.dist-info/
-rw-r--r-- 2.0 unx 4 b- defN 80-Jan-01 00:00 mypy_protobuf-2.4.dist-info/INSTALLER
-rw-r--r-- 2.0 unx 11348 b- defN 80-Jan-01 00:00 mypy_protobuf-2.4.dist-info/LICENSE
-rw-r--r-- 2.0 unx 438 b- defN 80-Jan-01 00:00 mypy_protobuf-2.4.dist-info/METADATA
-rw-r--r-- 2.0 unx 1171 b- defN 80-Jan-01 00:00 mypy_protobuf-2.4.dist-info/RECORD
-rw-r--r-- 2.0 unx 0 b- defN 80-Jan-01 00:00 mypy_protobuf-2.4.dist-info/REQUESTED
-rw-r--r-- 2.0 unx 92 b- defN 80-Jan-01 00:00 mypy_protobuf-2.4.dist-info/WHEEL
-rw-r--r-- 2.0 unx 108 b- defN 80-Jan-01 00:00 mypy_protobuf-2.4.dist-info/entry_points.txt
-rw-r--r-- 2.0 unx 14 b- defN 80-Jan-01 00:00 mypy_protobuf-2.4.dist-info/top_level.txt
drwxr-xr-x 2.0 unx 0 b- stor 80-Jan-01 00:00 mypy_protobuf/
-rw-r--r-- 2.0 unx 0 b- defN 80-Jan-01 00:00 mypy_protobuf/__init__.py
-rw-r--r-- 2.0 unx 2959 b- defN 80-Jan-01 00:00 mypy_protobuf/extensions_pb2.py
-rw-r--r-- 2.0 unx 32486 b- defN 80-Jan-01 00:00 mypy_protobuf/main.py
drwxr-xr-x 2.0 unx 0 b- stor 80-Jan-01 00:00 bin/
-rwxr-xr-x 2.0 unx 207 b- defN 80-Jan-01 00:00 bin/protoc-gen-mypy
-rwxr-xr-x 2.0 unx 207 b- defN 80-Jan-01 00:00 bin/protoc-gen-mypy_grpc
-rwxr-xr-x 2.0 unx 48 b- defN 80-Jan-01 00:00 bin/protoc_gen_mypy.bat
18 files, 49082 bytes uncompressed, 12928 bytes compressed: 73.7%
$ unzip -qc mypy-protobuf.pex/.deps/mypy_protobuf-2.4-py3-none-any.whl bin/protoc-gen-mypy
#!python
# -*- coding: utf-8 -*-
import re
import sys
from mypy_protobuf.main import main
if __name__ == '__main__':
sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0])
sys.exit(main()) You'll notice the That's done here when Pex uses Pip to install each wheel into a The place where the psuedo-shebang is reified is creating a venv in Note though that that venv re-write occurs inside |
And to restate the issue for clarity, once that wheel is packed with the old paths, those paths will persist in all subsequent venv builds using that wheel? |
As demonstrated by #13170 (comment), the wheel captured from the build_pex step does have the fully-substituted shebang paths and not |
Yes, but "once that wheel is packed with the old paths" is the part that I can't currently concede. #13170 (comment) shows that mechanism.
Well, it has a |
Yeah, so for this remexec request / response pair:
If I 1st materialize the input and then run that command:
I find again, the shebang in the mypy_protobuf wheel zip is not expanded.:
Now the venv script equivalent is - of course - re-written, but not to
That said! The output digest for the process has:
So ... I'm at a complete loss. |
Alright, doctored up Pex to log script re-write operations to a $ docker container exec -it 7abe2cb28c6c bash -i
root@7abe2cb28c6c:/bazel-buildfarm# cat /debug.txt
/tmp/worker/remote-execution/operations/733a416e-078e-4425-8c5b-9948e3808e1c/.cache/pex_root/installed_wheels/98430780dd87bc6ce504dce68c64b626286f31f7/pex-2.1.56-py2.py3-none-any.whl/pex/pip.py: Re-writing scripts in /tmp/worker/remote-execution/operations/733a416e-078e-4425-8c5b-9948e3808e1c/.cache/pex_root/installed_wheels/d8dbe72f24eaeea8b51e0f353336f9bd4915dc4a/pytest-6.2.5-py3-none-any.whl.516853df8d3644309a44b255cf2f84ba/bin
/tmp/worker/remote-execution/operations/733a416e-078e-4425-8c5b-9948e3808e1c/.cache/pex_root/installed_wheels/98430780dd87bc6ce504dce68c64b626286f31f7/pex-2.1.56-py2.py3-none-any.whl/pex/pip.py: won't re-write non-python script /tmp/worker/remote-execution/operations/733a416e-078e-4425-8c5b-9948e3808e1c/.cache/pex_root/installed_wheels/d8dbe72f24eaeea8b51e0f353336f9bd4915dc4a/pytest-6.2.5-py3-none-any.whl.516853df8d3644309a44b255cf2f84ba/bin/pytest
/tmp/worker/remote-execution/operations/733a416e-078e-4425-8c5b-9948e3808e1c/.cache/pex_root/installed_wheels/98430780dd87bc6ce504dce68c64b626286f31f7/pex-2.1.56-py2.py3-none-any.whl/pex/pip.py: won't re-write non-python script /tmp/worker/remote-execution/operations/733a416e-078e-4425-8c5b-9948e3808e1c/.cache/pex_root/installed_wheels/d8dbe72f24eaeea8b51e0f353336f9bd4915dc4a/pytest-6.2.5-py3-none-any.whl.516853df8d3644309a44b255cf2f84ba/bin/py.test
/tmp/worker/remote-execution/operations/733a416e-078e-4425-8c5b-9948e3808e1c/.cache/pex_root/installed_wheels/98430780dd87bc6ce504dce68c64b626286f31f7/pex-2.1.56-py2.py3-none-any.whl/pex/pip.py: Re-writing scripts in /tmp/worker/remote-execution/operations/733a416e-078e-4425-8c5b-9948e3808e1c/.cache/pex_root/installed_wheels/04ac6ecd49abd3b7bd5158795b8e181899083f55/coverage-6.1.2-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl.d1f50e8a2a54400390e30f5aedf230f0/bin
/tmp/worker/remote-execution/operations/733a416e-078e-4425-8c5b-9948e3808e1c/.cache/pex_root/installed_wheels/98430780dd87bc6ce504dce68c64b626286f31f7/pex-2.1.56-py2.py3-none-any.whl/pex/pip.py: won't re-write non-python script /tmp/worker/remote-execution/operations/733a416e-078e-4425-8c5b-9948e3808e1c/.cache/pex_root/installed_wheels/04ac6ecd49abd3b7bd5158795b8e181899083f55/coverage-6.1.2-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl.d1f50e8a2a54400390e30f5aedf230f0/bin/coverage-3.8
/tmp/worker/remote-execution/operations/733a416e-078e-4425-8c5b-9948e3808e1c/.cache/pex_root/installed_wheels/98430780dd87bc6ce504dce68c64b626286f31f7/pex-2.1.56-py2.py3-none-any.whl/pex/pip.py: won't re-write non-python script /tmp/worker/remote-execution/operations/733a416e-078e-4425-8c5b-9948e3808e1c/.cache/pex_root/installed_wheels/04ac6ecd49abd3b7bd5158795b8e181899083f55/coverage-6.1.2-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl.d1f50e8a2a54400390e30f5aedf230f0/bin/coverage
/tmp/worker/remote-execution/operations/733a416e-078e-4425-8c5b-9948e3808e1c/.cache/pex_root/installed_wheels/98430780dd87bc6ce504dce68c64b626286f31f7/pex-2.1.56-py2.py3-none-any.whl/pex/pip.py: won't re-write non-python script /tmp/worker/remote-execution/operations/733a416e-078e-4425-8c5b-9948e3808e1c/.cache/pex_root/installed_wheels/04ac6ecd49abd3b7bd5158795b8e181899083f55/coverage-6.1.2-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl.d1f50e8a2a54400390e30f5aedf230f0/bin/coverage3
/tmp/worker/remote-execution/operations/096f67a9-f750-412a-9169-44281efd61e2/.cache/pex_root/installed_wheels/98430780dd87bc6ce504dce68c64b626286f31f7/pex-2.1.56-py2.py3-none-any.whl/pex/pip.py: Re-writing scripts in /tmp/worker/remote-execution/operations/096f67a9-f750-412a-9169-44281efd61e2/.cache/pex_root/installed_wheels/48afe6378d3f200977f5a08be517e6409eefba98/translate-3.6.1-py2.py3-none-any.whl.70fd55c05eb54e46988fa82c9fe12734/bin
/tmp/worker/remote-execution/operations/096f67a9-f750-412a-9169-44281efd61e2/.cache/pex_root/installed_wheels/98430780dd87bc6ce504dce68c64b626286f31f7/pex-2.1.56-py2.py3-none-any.whl/pex/pip.py: won't re-write non-python script /tmp/worker/remote-execution/operations/096f67a9-f750-412a-9169-44281efd61e2/.cache/pex_root/installed_wheels/48afe6378d3f200977f5a08be517e6409eefba98/translate-3.6.1-py2.py3-none-any.whl.70fd55c05eb54e46988fa82c9fe12734/bin/translate-cli
/tmp/worker/remote-execution/operations/096f67a9-f750-412a-9169-44281efd61e2/.cache/pex_root/installed_wheels/98430780dd87bc6ce504dce68c64b626286f31f7/pex-2.1.56-py2.py3-none-any.whl/pex/pip.py: Re-writing scripts in /tmp/worker/remote-execution/operations/096f67a9-f750-412a-9169-44281efd61e2/.cache/pex_root/installed_wheels/9fa96037a1a985fe7dda81c0e1e35ae015163d88/charset_normalizer-2.0.4-py3-none-any.whl.139b639c79b94d59bd52bbb10c16348a/bin
/tmp/worker/remote-execution/operations/096f67a9-f750-412a-9169-44281efd61e2/.cache/pex_root/installed_wheels/98430780dd87bc6ce504dce68c64b626286f31f7/pex-2.1.56-py2.py3-none-any.whl/pex/pip.py: won't re-write non-python script /tmp/worker/remote-execution/operations/096f67a9-f750-412a-9169-44281efd61e2/.cache/pex_root/installed_wheels/9fa96037a1a985fe7dda81c0e1e35ae015163d88/charset_normalizer-2.0.4-py3-none-any.whl.139b639c79b94d59bd52bbb10c16348a/bin/normalizer
/tmp/worker/remote-execution/operations/096f67a9-f750-412a-9169-44281efd61e2/.cache/pex_root/installed_wheels/98430780dd87bc6ce504dce68c64b626286f31f7/pex-2.1.56-py2.py3-none-any.whl/pex/pip.py: Re-writing scripts in /tmp/worker/remote-execution/operations/096f67a9-f750-412a-9169-44281efd61e2/.cache/pex_root/installed_wheels/e13b43549899a1478d60af690ea973c3943a5175/pip-21.2.2-py3-none-any.whl.286876c502694a6e9c836ad5c4c4315d/bin
/tmp/worker/remote-execution/operations/096f67a9-f750-412a-9169-44281efd61e2/.cache/pex_root/installed_wheels/98430780dd87bc6ce504dce68c64b626286f31f7/pex-2.1.56-py2.py3-none-any.whl/pex/pip.py: won't re-write non-python script /tmp/worker/remote-execution/operations/096f67a9-f750-412a-9169-44281efd61e2/.cache/pex_root/installed_wheels/e13b43549899a1478d60af690ea973c3943a5175/pip-21.2.2-py3-none-any.whl.286876c502694a6e9c836ad5c4c4315d/bin/pip3.8
/tmp/worker/remote-execution/operations/096f67a9-f750-412a-9169-44281efd61e2/.cache/pex_root/installed_wheels/98430780dd87bc6ce504dce68c64b626286f31f7/pex-2.1.56-py2.py3-none-any.whl/pex/pip.py: won't re-write non-python script /tmp/worker/remote-execution/operations/096f67a9-f750-412a-9169-44281efd61e2/.cache/pex_root/installed_wheels/e13b43549899a1478d60af690ea973c3943a5175/pip-21.2.2-py3-none-any.whl.286876c502694a6e9c836ad5c4c4315d/bin/pip
/tmp/worker/remote-execution/operations/096f67a9-f750-412a-9169-44281efd61e2/.cache/pex_root/installed_wheels/98430780dd87bc6ce504dce68c64b626286f31f7/pex-2.1.56-py2.py3-none-any.whl/pex/pip.py: won't re-write non-python script /tmp/worker/remote-execution/operations/096f67a9-f750-412a-9169-44281efd61e2/.cache/pex_root/installed_wheels/e13b43549899a1478d60af690ea973c3943a5175/pip-21.2.2-py3-none-any.whl.286876c502694a6e9c836ad5c4c4315d/bin/pip3
/tmp/worker/remote-execution/operations/af6ae367-eca4-4716-af8b-d716a01c62e8/.cache/pex_root/installed_wheels/98430780dd87bc6ce504dce68c64b626286f31f7/pex-2.1.56-py2.py3-none-any.whl/pex/pip.py: Re-writing scripts in /tmp/worker/remote-execution/operations/af6ae367-eca4-4716-af8b-d716a01c62e8/.cache/pex_root/installed_wheels/60974b0bc64909a12b2201d5d0093478d955e90a/mypy_protobuf-2.4-py3-none-any.whl.8a63762cf82b465a88e3c6e3aece3819/bin
/tmp/worker/remote-execution/operations/af6ae367-eca4-4716-af8b-d716a01c62e8/.cache/pex_root/installed_wheels/98430780dd87bc6ce504dce68c64b626286f31f7/pex-2.1.56-py2.py3-none-any.whl/pex/pip.py: won't re-write non-python script /tmp/worker/remote-execution/operations/af6ae367-eca4-4716-af8b-d716a01c62e8/.cache/pex_root/installed_wheels/60974b0bc64909a12b2201d5d0093478d955e90a/mypy_protobuf-2.4-py3-none-any.whl.8a63762cf82b465a88e3c6e3aece3819/bin/protoc_gen_mypy.bat
/tmp/worker/remote-execution/operations/af6ae367-eca4-4716-af8b-d716a01c62e8/.cache/pex_root/installed_wheels/98430780dd87bc6ce504dce68c64b626286f31f7/pex-2.1.56-py2.py3-none-any.whl/pex/pip.py: won't re-write non-python script /tmp/worker/remote-execution/operations/af6ae367-eca4-4716-af8b-d716a01c62e8/.cache/pex_root/installed_wheels/60974b0bc64909a12b2201d5d0093478d955e90a/mypy_protobuf-2.4-py3-none-any.whl.8a63762cf82b465a88e3c6e3aece3819/bin/protoc-gen-mypy
/tmp/worker/remote-execution/operations/af6ae367-eca4-4716-af8b-d716a01c62e8/.cache/pex_root/installed_wheels/98430780dd87bc6ce504dce68c64b626286f31f7/pex-2.1.56-py2.py3-none-any.whl/pex/pip.py: won't re-write non-python script /tmp/worker/remote-execution/operations/af6ae367-eca4-4716-af8b-d716a01c62e8/.cache/pex_root/installed_wheels/60974b0bc64909a12b2201d5d0093478d955e90a/mypy_protobuf-2.4-py3-none-any.whl.8a63762cf82b465a88e3c6e3aece3819/bin/protoc-gen-mypy_grpc
/tmp/worker/remote-execution/operations/768271cd-264c-4c2f-b64a-a9714b0c54f0/.cache/pex_root/installed_wheels/c720e2bf057dc4ff88df428c9dd87f782a55dbd4/pex-2.1.56-py2.py3-none-any.whl/pex/pip.py: Re-writing scripts in /tmp/worker/remote-execution/operations/768271cd-264c-4c2f-b64a-a9714b0c54f0/.cache/pex_root/installed_wheels/d8dbe72f24eaeea8b51e0f353336f9bd4915dc4a/pytest-6.2.5-py3-none-any.whl.e62c93e0086e4c6986c3ce51601a3c4f/bin
/tmp/worker/remote-execution/operations/768271cd-264c-4c2f-b64a-a9714b0c54f0/.cache/pex_root/installed_wheels/c720e2bf057dc4ff88df428c9dd87f782a55dbd4/pex-2.1.56-py2.py3-none-any.whl/pex/pip.py: won't re-write non-python script /tmp/worker/remote-execution/operations/768271cd-264c-4c2f-b64a-a9714b0c54f0/.cache/pex_root/installed_wheels/d8dbe72f24eaeea8b51e0f353336f9bd4915dc4a/pytest-6.2.5-py3-none-any.whl.e62c93e0086e4c6986c3ce51601a3c4f/bin/pytest
/tmp/worker/remote-execution/operations/ac458f6a-2fe0-472e-804e-45c4ae120187/.cache/pex_root/installed_wheels/c720e2bf057dc4ff88df428c9dd87f782a55dbd4/pex-2.1.56-py2.py3-none-any.whl/pex/pip.py: Re-writing scripts in /tmp/worker/remote-execution/operations/ac458f6a-2fe0-472e-804e-45c4ae120187/.cache/pex_root/installed_wheels/48afe6378d3f200977f5a08be517e6409eefba98/translate-3.6.1-py2.py3-none-any.whl.1165c662e8c24c6aa2055d1ede6b90b3/bin
/tmp/worker/remote-execution/operations/ac458f6a-2fe0-472e-804e-45c4ae120187/.cache/pex_root/installed_wheels/c720e2bf057dc4ff88df428c9dd87f782a55dbd4/pex-2.1.56-py2.py3-none-any.whl/pex/pip.py: won't re-write non-python script /tmp/worker/remote-execution/operations/ac458f6a-2fe0-472e-804e-45c4ae120187/.cache/pex_root/installed_wheels/48afe6378d3f200977f5a08be517e6409eefba98/translate-3.6.1-py2.py3-none-any.whl.1165c662e8c24c6aa2055d1ede6b90b3/bin/translate-cli
/tmp/worker/remote-execution/operations/f5b19532-34e5-4dc3-80e1-d24711eb39da/.cache/pex_root/installed_wheels/99c26016ed352bc9532967eaf31424ca58576aae/pex-2.1.56-py2.py3-none-any.whl/pex/pip.py: Re-writing scripts in /tmp/worker/remote-execution/operations/f5b19532-34e5-4dc3-80e1-d24711eb39da/.cache/pex_root/installed_wheels/d8dbe72f24eaeea8b51e0f353336f9bd4915dc4a/pytest-6.2.5-py3-none-any.whl.6e8589b93c8b4aee8a5a31be7c61bedc/bin
/tmp/worker/remote-execution/operations/f5b19532-34e5-4dc3-80e1-d24711eb39da/.cache/pex_root/installed_wheels/99c26016ed352bc9532967eaf31424ca58576aae/pex-2.1.56-py2.py3-none-any.whl/pex/pip.py: won't re-write non-python script /tmp/worker/remote-execution/operations/f5b19532-34e5-4dc3-80e1-d24711eb39da/.cache/pex_root/installed_wheels/d8dbe72f24eaeea8b51e0f353336f9bd4915dc4a/pytest-6.2.5-py3-none-any.whl.6e8589b93c8b4aee8a5a31be7c61bedc/bin/pytest
/tmp/worker/remote-execution/operations/f5b19532-34e5-4dc3-80e1-d24711eb39da/.cache/pex_root/installed_wheels/99c26016ed352bc9532967eaf31424ca58576aae/pex-2.1.56-py2.py3-none-any.whl/pex/pip.py: ---
#!/bin/sh
'''exec' /tmp/worker/remote-execution/operations/f5b19532-34e5-4dc3-80e1-d24711eb39da/.cache/pex_root/venvs/s/b7f9dc7f/venv/bin/python3.8 "$0" "$@"
' '''
# -*- coding: utf-8 -*-
import re
/tmp/worker/remote-execution/operations/f5b19532-34e5-4dc3-80e1-d24711eb39da/.cache/pex_root/installed_wheels/99c26016ed352bc9532967eaf31424ca58576aae/pex-2.1.56-py2.py3-none-any.whl/pex/pip.py: won't re-write non-python script /tmp/worker/remote-execution/operations/f5b19532-34e5-4dc3-80e1-d24711eb39da/.cache/pex_root/installed_wheels/d8dbe72f24eaeea8b51e0f353336f9bd4915dc4a/pytest-6.2.5-py3-none-any.whl.6e8589b93c8b4aee8a5a31be7c61bedc/bin/py.test
/tmp/worker/remote-execution/operations/f5b19532-34e5-4dc3-80e1-d24711eb39da/.cache/pex_root/installed_wheels/99c26016ed352bc9532967eaf31424ca58576aae/pex-2.1.56-py2.py3-none-any.whl/pex/pip.py: ---
#!/bin/sh
'''exec' /tmp/worker/remote-execution/operations/f5b19532-34e5-4dc3-80e1-d24711eb39da/.cache/pex_root/venvs/s/b7f9dc7f/venv/bin/python3.8 "$0" "$@"
' '''
# -*- coding: utf-8 -*-
import re
/tmp/worker/remote-execution/operations/f5b19532-34e5-4dc3-80e1-d24711eb39da/.cache/pex_root/installed_wheels/99c26016ed352bc9532967eaf31424ca58576aae/pex-2.1.56-py2.py3-none-any.whl/pex/pip.py: Re-writing scripts in /tmp/worker/remote-execution/operations/f5b19532-34e5-4dc3-80e1-d24711eb39da/.cache/pex_root/installed_wheels/04ac6ecd49abd3b7bd5158795b8e181899083f55/coverage-6.1.2-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl.4f92e12264694ab2bc10e1e2b913735e/bin
/tmp/worker/remote-execution/operations/f5b19532-34e5-4dc3-80e1-d24711eb39da/.cache/pex_root/installed_wheels/99c26016ed352bc9532967eaf31424ca58576aae/pex-2.1.56-py2.py3-none-any.whl/pex/pip.py: won't re-write non-python script /tmp/worker/remote-execution/operations/f5b19532-34e5-4dc3-80e1-d24711eb39da/.cache/pex_root/installed_wheels/04ac6ecd49abd3b7bd5158795b8e181899083f55/coverage-6.1.2-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl.4f92e12264694ab2bc10e1e2b913735e/bin/coverage-3.8
/tmp/worker/remote-execution/operations/f5b19532-34e5-4dc3-80e1-d24711eb39da/.cache/pex_root/installed_wheels/99c26016ed352bc9532967eaf31424ca58576aae/pex-2.1.56-py2.py3-none-any.whl/pex/pip.py: ---
#!/bin/sh
'''exec' /tmp/worker/remote-execution/operations/f5b19532-34e5-4dc3-80e1-d24711eb39da/.cache/pex_root/venvs/s/b7f9dc7f/venv/bin/python3.8 "$0" "$@"
' '''
# -*- coding: utf-8 -*-
import re
/tmp/worker/remote-execution/operations/f5b19532-34e5-4dc3-80e1-d24711eb39da/.cache/pex_root/installed_wheels/99c26016ed352bc9532967eaf31424ca58576aae/pex-2.1.56-py2.py3-none-any.whl/pex/pip.py: won't re-write non-python script /tmp/worker/remote-execution/operations/f5b19532-34e5-4dc3-80e1-d24711eb39da/.cache/pex_root/installed_wheels/04ac6ecd49abd3b7bd5158795b8e181899083f55/coverage-6.1.2-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl.4f92e12264694ab2bc10e1e2b913735e/bin/coverage
/tmp/worker/remote-execution/operations/f5b19532-34e5-4dc3-80e1-d24711eb39da/.cache/pex_root/installed_wheels/99c26016ed352bc9532967eaf31424ca58576aae/pex-2.1.56-py2.py3-none-any.whl/pex/pip.py: ---
#!/bin/sh
'''exec' /tmp/worker/remote-execution/operations/f5b19532-34e5-4dc3-80e1-d24711eb39da/.cache/pex_root/venvs/s/b7f9dc7f/venv/bin/python3.8 "$0" "$@"
' '''
# -*- coding: utf-8 -*-
import re
/tmp/worker/remote-execution/operations/f5b19532-34e5-4dc3-80e1-d24711eb39da/.cache/pex_root/installed_wheels/99c26016ed352bc9532967eaf31424ca58576aae/pex-2.1.56-py2.py3-none-any.whl/pex/pip.py: won't re-write non-python script /tmp/worker/remote-execution/operations/f5b19532-34e5-4dc3-80e1-d24711eb39da/.cache/pex_root/installed_wheels/04ac6ecd49abd3b7bd5158795b8e181899083f55/coverage-6.1.2-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl.4f92e12264694ab2bc10e1e2b913735e/bin/coverage3
/tmp/worker/remote-execution/operations/f5b19532-34e5-4dc3-80e1-d24711eb39da/.cache/pex_root/installed_wheels/99c26016ed352bc9532967eaf31424ca58576aae/pex-2.1.56-py2.py3-none-any.whl/pex/pip.py: ---
#!/bin/sh
'''exec' /tmp/worker/remote-execution/operations/f5b19532-34e5-4dc3-80e1-d24711eb39da/.cache/pex_root/venvs/s/b7f9dc7f/venv/bin/python3.8 "$0" "$@"
' '''
# -*- coding: utf-8 -*-
import re
/tmp/worker/remote-execution/operations/679c67b0-4e40-4c6f-bdad-7a0bc88668d0/.cache/pex_root/installed_wheels/99c26016ed352bc9532967eaf31424ca58576aae/pex-2.1.56-py2.py3-none-any.whl/pex/pip.py: Re-writing scripts in /tmp/worker/remote-execution/operations/679c67b0-4e40-4c6f-bdad-7a0bc88668d0/.cache/pex_root/installed_wheels/48afe6378d3f200977f5a08be517e6409eefba98/translate-3.6.1-py2.py3-none-any.whl.fde2c4cc03af4679af6c1dd9304fb9eb/bin
/tmp/worker/remote-execution/operations/679c67b0-4e40-4c6f-bdad-7a0bc88668d0/.cache/pex_root/installed_wheels/99c26016ed352bc9532967eaf31424ca58576aae/pex-2.1.56-py2.py3-none-any.whl/pex/pip.py: won't re-write non-python script /tmp/worker/remote-execution/operations/679c67b0-4e40-4c6f-bdad-7a0bc88668d0/.cache/pex_root/installed_wheels/48afe6378d3f200977f5a08be517e6409eefba98/translate-3.6.1-py2.py3-none-any.whl.fde2c4cc03af4679af6c1dd9304fb9eb/bin/translate-cli
/tmp/worker/remote-execution/operations/679c67b0-4e40-4c6f-bdad-7a0bc88668d0/.cache/pex_root/installed_wheels/99c26016ed352bc9532967eaf31424ca58576aae/pex-2.1.56-py2.py3-none-any.whl/pex/pip.py: ---
#!/bin/sh
'''exec' /tmp/worker/remote-execution/operations/679c67b0-4e40-4c6f-bdad-7a0bc88668d0/.cache/pex_root/venvs/s/a99a3aeb/venv/bin/python3.8 "$0" "$@"
' '''
# -*- coding: utf-8 -*-
import re
/tmp/worker/remote-execution/operations/679c67b0-4e40-4c6f-bdad-7a0bc88668d0/.cache/pex_root/installed_wheels/99c26016ed352bc9532967eaf31424ca58576aae/pex-2.1.56-py2.py3-none-any.whl/pex/pip.py: Re-writing scripts in /tmp/worker/remote-execution/operations/679c67b0-4e40-4c6f-bdad-7a0bc88668d0/.cache/pex_root/installed_wheels/9fa96037a1a985fe7dda81c0e1e35ae015163d88/charset_normalizer-2.0.4-py3-none-any.whl.e6a4bc3223914e7b9002f8c3b3fd753d/bin
/tmp/worker/remote-execution/operations/679c67b0-4e40-4c6f-bdad-7a0bc88668d0/.cache/pex_root/installed_wheels/99c26016ed352bc9532967eaf31424ca58576aae/pex-2.1.56-py2.py3-none-any.whl/pex/pip.py: won't re-write non-python script /tmp/worker/remote-execution/operations/679c67b0-4e40-4c6f-bdad-7a0bc88668d0/.cache/pex_root/installed_wheels/9fa96037a1a985fe7dda81c0e1e35ae015163d88/charset_normalizer-2.0.4-py3-none-any.whl.e6a4bc3223914e7b9002f8c3b3fd753d/bin/normalizer
/tmp/worker/remote-execution/operations/679c67b0-4e40-4c6f-bdad-7a0bc88668d0/.cache/pex_root/installed_wheels/99c26016ed352bc9532967eaf31424ca58576aae/pex-2.1.56-py2.py3-none-any.whl/pex/pip.py: ---
#!/bin/sh
'''exec' /tmp/worker/remote-execution/operations/679c67b0-4e40-4c6f-bdad-7a0bc88668d0/.cache/pex_root/venvs/s/a99a3aeb/venv/bin/python3.8 "$0" "$@"
' '''
# -*- coding: utf-8 -*-
import re
/tmp/worker/remote-execution/operations/679c67b0-4e40-4c6f-bdad-7a0bc88668d0/.cache/pex_root/installed_wheels/99c26016ed352bc9532967eaf31424ca58576aae/pex-2.1.56-py2.py3-none-any.whl/pex/pip.py: Re-writing scripts in /tmp/worker/remote-execution/operations/679c67b0-4e40-4c6f-bdad-7a0bc88668d0/.cache/pex_root/installed_wheels/e13b43549899a1478d60af690ea973c3943a5175/pip-21.2.2-py3-none-any.whl.364eedc968a94c60af05f03f05fa0aee/bin
/tmp/worker/remote-execution/operations/679c67b0-4e40-4c6f-bdad-7a0bc88668d0/.cache/pex_root/installed_wheels/99c26016ed352bc9532967eaf31424ca58576aae/pex-2.1.56-py2.py3-none-any.whl/pex/pip.py: won't re-write non-python script /tmp/worker/remote-execution/operations/679c67b0-4e40-4c6f-bdad-7a0bc88668d0/.cache/pex_root/installed_wheels/e13b43549899a1478d60af690ea973c3943a5175/pip-21.2.2-py3-none-any.whl.364eedc968a94c60af05f03f05fa0aee/bin/pip3.8
/tmp/worker/remote-execution/operations/679c67b0-4e40-4c6f-bdad-7a0bc88668d0/.cache/pex_root/installed_wheels/99c26016ed352bc9532967eaf31424ca58576aae/pex-2.1.56-py2.py3-none-any.whl/pex/pip.py: ---
#!/bin/sh
'''exec' /tmp/worker/remote-execution/operations/679c67b0-4e40-4c6f-bdad-7a0bc88668d0/.cache/pex_root/venvs/s/a99a3aeb/venv/bin/python3.8 "$0" "$@"
' '''
# -*- coding: utf-8 -*-
import re
/tmp/worker/remote-execution/operations/679c67b0-4e40-4c6f-bdad-7a0bc88668d0/.cache/pex_root/installed_wheels/99c26016ed352bc9532967eaf31424ca58576aae/pex-2.1.56-py2.py3-none-any.whl/pex/pip.py: won't re-write non-python script /tmp/worker/remote-execution/operations/679c67b0-4e40-4c6f-bdad-7a0bc88668d0/.cache/pex_root/installed_wheels/e13b43549899a1478d60af690ea973c3943a5175/pip-21.2.2-py3-none-any.whl.364eedc968a94c60af05f03f05fa0aee/bin/pip
/tmp/worker/remote-execution/operations/679c67b0-4e40-4c6f-bdad-7a0bc88668d0/.cache/pex_root/installed_wheels/99c26016ed352bc9532967eaf31424ca58576aae/pex-2.1.56-py2.py3-none-any.whl/pex/pip.py: ---
#!/bin/sh
'''exec' /tmp/worker/remote-execution/operations/679c67b0-4e40-4c6f-bdad-7a0bc88668d0/.cache/pex_root/venvs/s/a99a3aeb/venv/bin/python3.8 "$0" "$@"
' '''
# -*- coding: utf-8 -*-
import re
/tmp/worker/remote-execution/operations/679c67b0-4e40-4c6f-bdad-7a0bc88668d0/.cache/pex_root/installed_wheels/99c26016ed352bc9532967eaf31424ca58576aae/pex-2.1.56-py2.py3-none-any.whl/pex/pip.py: won't re-write non-python script /tmp/worker/remote-execution/operations/679c67b0-4e40-4c6f-bdad-7a0bc88668d0/.cache/pex_root/installed_wheels/e13b43549899a1478d60af690ea973c3943a5175/pip-21.2.2-py3-none-any.whl.364eedc968a94c60af05f03f05fa0aee/bin/pip3
/tmp/worker/remote-execution/operations/679c67b0-4e40-4c6f-bdad-7a0bc88668d0/.cache/pex_root/installed_wheels/99c26016ed352bc9532967eaf31424ca58576aae/pex-2.1.56-py2.py3-none-any.whl/pex/pip.py: ---
#!/bin/sh
'''exec' /tmp/worker/remote-execution/operations/679c67b0-4e40-4c6f-bdad-7a0bc88668d0/.cache/pex_root/venvs/s/a99a3aeb/venv/bin/python3.8 "$0" "$@"
' '''
# -*- coding: utf-8 -*-
import re
/tmp/worker/remote-execution/operations/7f0557df-3516-4e79-a881-600c61dd5829/.cache/pex_root/installed_wheels/99c26016ed352bc9532967eaf31424ca58576aae/pex-2.1.56-py2.py3-none-any.whl/pex/pip.py: Re-writing scripts in /tmp/worker/remote-execution/operations/7f0557df-3516-4e79-a881-600c61dd5829/.cache/pex_root/installed_wheels/60974b0bc64909a12b2201d5d0093478d955e90a/mypy_protobuf-2.4-py3-none-any.whl.ca6b8c8c3fe14e3cbe12e1a1f9560ebb/bin
/tmp/worker/remote-execution/operations/7f0557df-3516-4e79-a881-600c61dd5829/.cache/pex_root/installed_wheels/99c26016ed352bc9532967eaf31424ca58576aae/pex-2.1.56-py2.py3-none-any.whl/pex/pip.py: won't re-write non-python script /tmp/worker/remote-execution/operations/7f0557df-3516-4e79-a881-600c61dd5829/.cache/pex_root/installed_wheels/60974b0bc64909a12b2201d5d0093478d955e90a/mypy_protobuf-2.4-py3-none-any.whl.ca6b8c8c3fe14e3cbe12e1a1f9560ebb/bin/protoc_gen_mypy.bat
/tmp/worker/remote-execution/operations/7f0557df-3516-4e79-a881-600c61dd5829/.cache/pex_root/installed_wheels/99c26016ed352bc9532967eaf31424ca58576aae/pex-2.1.56-py2.py3-none-any.whl/pex/pip.py: ---
@echo off
%~dp0\python -u %0\..\protoc-gen-mypy
/tmp/worker/remote-execution/operations/7f0557df-3516-4e79-a881-600c61dd5829/.cache/pex_root/installed_wheels/99c26016ed352bc9532967eaf31424ca58576aae/pex-2.1.56-py2.py3-none-any.whl/pex/pip.py: won't re-write non-python script /tmp/worker/remote-execution/operations/7f0557df-3516-4e79-a881-600c61dd5829/.cache/pex_root/installed_wheels/60974b0bc64909a12b2201d5d0093478d955e90a/mypy_protobuf-2.4-py3-none-any.whl.ca6b8c8c3fe14e3cbe12e1a1f9560ebb/bin/protoc-gen-mypy
/tmp/worker/remote-execution/operations/7f0557df-3516-4e79-a881-600c61dd5829/.cache/pex_root/installed_wheels/99c26016ed352bc9532967eaf31424ca58576aae/pex-2.1.56-py2.py3-none-any.whl/pex/pip.py: ---
#!/bin/sh
'''exec' /tmp/worker/remote-execution/operations/7f0557df-3516-4e79-a881-600c61dd5829/.cache/pex_root/venvs/s/ea545397/venv/bin/python3.8 "$0" "$@"
' '''
# -*- coding: utf-8 -*-
import re
/tmp/worker/remote-execution/operations/7f0557df-3516-4e79-a881-600c61dd5829/.cache/pex_root/installed_wheels/99c26016ed352bc9532967eaf31424ca58576aae/pex-2.1.56-py2.py3-none-any.whl/pex/pip.py: won't re-write non-python script /tmp/worker/remote-execution/operations/7f0557df-3516-4e79-a881-600c61dd5829/.cache/pex_root/installed_wheels/60974b0bc64909a12b2201d5d0093478d955e90a/mypy_protobuf-2.4-py3-none-any.whl.ca6b8c8c3fe14e3cbe12e1a1f9560ebb/bin/protoc-gen-mypy_grpc
/tmp/worker/remote-execution/operations/7f0557df-3516-4e79-a881-600c61dd5829/.cache/pex_root/installed_wheels/99c26016ed352bc9532967eaf31424ca58576aae/pex-2.1.56-py2.py3-none-any.whl/pex/pip.py: ---
#!/bin/sh
'''exec' /tmp/worker/remote-execution/operations/7f0557df-3516-4e79-a881-600c61dd5829/.cache/pex_root/venvs/s/ea545397/venv/bin/python3.8 "$0" "$@"
' '''
# -*- coding: utf-8 -*-
import re
root@7abe2cb28c6c:/bazel-buildfarm# So, under BuildFarm in the worker container, it's the |
BuildFarm uses hard links to setup the input root. The files are also hard linked in the CAS cache directory used by BuildFarm. Could this confuse |
Maybe this could be related to the specific remote execution environment (e.g., the python / pip versions etc.) being used in remote -apis-testing and our ad hoc testing? |
The only ~arbitrary thing is Python, Pip is vendored by Pex. |
@#!$%:
Still no straight line but this is likely it. |
Actually, Pex sets up the root@7abe2cb28c6c:/bazel-buildfarm# python -mvenv --without-pip test.venv
root@7abe2cb28c6c:/bazel-buildfarm# source test.venv/bin/activate
(test.venv) root@7abe2cb28c6c:/bazel-buildfarm# python --version
Python 3.8.10
(test.venv) root@7abe2cb28c6c:/bazel-buildfarm# |
Ok, code generating the whacky shebang is here: |
Aha: if sys.platform == 'darwin':
max_shebang_length = 512
else:
max_shebang_length = 127 If the shebang length is > 127 then the funky
So it looks like this is all explained now. BuildFarm uses super long paths, which triggers this bit of Pip / distlib code which produces a non python shebang which foils Pip producing a That said, on this image, the kernel is configured for 256 so its all unfortunate and should be moot. |
Whittled down here: pex-tool/pex#1520 |
Great debugging! I don't think I would have found that. |
The BuildFarm only was screaming from the get go, it was just hard to see what was relevantly different about BuildFarm. |
This is in fact fixed by pex-tool/pex#1521 when using |
This brings official support for Python 3.10 and a hermeticity fix for build environments where the named_caches directory has an especially long path name. Changelogs are here: + https://github.com/pantsbuild/pex/releases/tag/v2.1.55 + https://github.com/pantsbuild/pex/releases/tag/v2.1.56 Fixes pantsbuild#13170 # Rust tests and lints will be skipped. Delete if not intended. [ci skip-rust] # Building wheels and fs_util will be skipped. Delete if not intended. [ci skip-build-wheels]
I have a fix for remote-apis-testing out here: https://gitlab.com/remote-apis-testing/remote-apis-testing/-/merge_requests/271 |
This brings official support for Python 3.10 and a hermeticity fix for build environments where the named_caches directory has an especially long path name. Changelogs are here: + https://github.com/pantsbuild/pex/releases/tag/v2.1.55 + https://github.com/pantsbuild/pex/releases/tag/v2.1.56 Fixes #13170
Protobuf code generation is currently failing when run in remote execution against Buildfarm even after the fix in #13077 for archive extraction in remote execution.
Using the example-python repository for the test, the error that occurs when running
./pants test helloworld::
(with appropriate options to enable remote execution) is:Note that the path to
protoc-gen-mypy
and the path topython3.8
are different:28150c45-177d-4894-9fcb-7b88fc57f9c7
vsc79cf097-80ab-4212-b27f-b999f573cfc7
. The shebang for thepython3.8
in the venv pex has the path that was valid in a prior remote execution sandbox.This occurs on the current Pants
main
. It is unclear when it was introduced since the bug was obscured by the archive extraction bug fixed by #13077.The text was updated successfully, but these errors were encountered: