sparse-lifeguard-95737
11/23/2022, 3:10 PMsparse-lifeguard-95737
11/23/2022, 3:13 PMpython
point at the 3.9 interpreter. after making that switch, we consistently see one ./pants package
of a PEX in our build fail with:
There was 1 error downloading required artifacts:artifacts
1. clr 0.3.19 from git+<https://github.com/color/clr.git@a444a0612374a19f22e511b5e3514a60561e6160>
Expected sha256 hash of 88c4fc49003c1594d70aefe9cfbae3e60327a85e52e4608755f52cce2d438eb3 when downloading clr but hashed to 39cdfcc1e1980477476434e6d3d7777bc2bbecff7fcd903f36b4ddb1b17283a5.
sparse-lifeguard-95737
11/23/2022, 3:13 PMsparse-lifeguard-95737
11/23/2022, 3:14 PM__run.sh
after the failure to point at 3.8, everything starts workingsparse-lifeguard-95737
11/23/2022, 3:15 PMPEX_VERBOSE=1
doesn’t give me much more informationenough-analyst-54434
11/23/2022, 3:32 PM$ curl -sSL <https://github.com/pantsbuild/pex/releases/download/v2.1.114/pex> -O
$ PEX_SCRIPT=pex3 python3.7 pex lock create --style universal --target-system linux --target-system mac --resolver-version pip-2020-resolver "git+<https://githu>
b.com/color/clr.git@a444a0612374a19f22e511b5e3514a60561e6160#egg=clr" --indent 2 -o lock.3.7.json
$ PEX_SCRIPT=pex3 python3.8 pex lock create --style universal --target-system linux --target-system mac --resolver-version pip-2020-resolver "git+<https://github.com/color/clr.git@a444a0612374a19f22e511b5e3514a60561e6160#egg=clr>" --indent 2 -o lock.3.8.json
$ PEX_SCRIPT=pex3 python3.9 pex lock create --style universal --target-system linux --target-system mac --resolver-version pip-2020-resolver "git+<https://github.com/color/clr.git@a444a0612374a19f22e511b5e3514a60561e6160#egg=clr>" --indent 2 -o lock.3.9.json
$ diff lock.3.7.json lock.3.8.json
52c52
< "hash": "39be551f54bc4c59210f08326bc649806d0ca18b8c008975424023cda2568782",
---
> "hash": "88c4fc49003c1594d70aefe9cfbae3e60327a85e52e4608755f52cce2d438eb3",
$ diff lock.3.7.json lock.3.9.json
52c52
< "hash": "39be551f54bc4c59210f08326bc649806d0ca18b8c008975424023cda2568782",
---
> "hash": "39cdfcc1e1980477476434e6d3d7777bc2bbecff7fcd903f36b4ddb1b17283a5",
It's only consistent within 1 interpreter:
$ rm -rf ~/.pex
$ PEX_SCRIPT=pex3 python3.7 pex lock create --style universal --target-system linux --target-system mac --resolver-version pip-2020-resolver "git+<https://github.com/color/clr.git@a444a0612374a19f22e511b5e3514a60561e6160#egg=clr>" --indent 2 -o lock.3.7-2.json
$ diff lock.3.7.json lock.3.7-2.json
enough-analyst-54434
11/23/2022, 3:33 PMsparse-lifeguard-95737
11/23/2022, 3:43 PMgenerate-lockfiles
doesn’t change the expected hash in the lockfile when pants is running under python 3.9. looking at the ps
output of a running generate-lockfiles
, it appears to be running out of a 3.8 virtualenv. is there some extra “find a compatible interpreter step” in the lockfile-generation logic that we should copy over to the pex-packaging rule so the two are consistent?enough-analyst-54434
11/23/2022, 3:48 PMenough-analyst-54434
11/23/2022, 3:48 PMpip download
to get those sdists the resulting zips differ, when unpacked and the .git dir is ignored, which Pex does:
$ diff -x .git -r 3.7.dists/clr 3.9.dists/clr
Only in 3.7.dists/clr/.eggs: pytest_runner-6.0.0-py3.7.egg
Only in 3.9.dists/clr/.eggs: pytest_runner-6.0.0-py3.9.egg
enough-analyst-54434
11/23/2022, 3:49 PMenough-analyst-54434
11/23/2022, 3:51 PMenough-analyst-54434
11/23/2022, 3:51 PMenough-analyst-54434
11/23/2022, 3:52 PMenough-analyst-54434
11/23/2022, 3:52 PMenough-analyst-54434
11/23/2022, 3:53 PMsparse-lifeguard-95737
11/23/2022, 3:53 PMenough-analyst-54434
11/23/2022, 3:54 PMenough-analyst-54434
11/23/2022, 3:55 PMsparse-lifeguard-95737
11/23/2022, 3:57 PM./pants package
ultimately ends up generating/running a process that runs:
<python> ./pex <bunch-of-requirements> --lock <lockfile>
if we enforced that the <python>
injected was compatible with the interpreter constraints of <lockfile>
, would that “fix” it for the ./pants package
use-case? avoid the underlying issue in pexenough-analyst-54434
11/23/2022, 4:00 PMsparse-lifeguard-95737
11/23/2022, 4:01 PMenough-analyst-54434
11/23/2022, 4:06 PMenough-analyst-54434
11/23/2022, 4:06 PM$ curl -sSL <https://github.com/pantsbuild/pex/releases/download/v2.1.114/pex> -O
$ PEX_SCRIPT=pex3 python3.7 pex lock create --style universal --target-system linux --target-system mac --resolver-version pip-2020-resolver "git+<https://github.com/jsirois/clr.git@07d525764e6589a1059ee3977bbaefbb687c629a#egg=clr>" --indent 2 -o lock.3.7.json
$ PEX_SCRIPT=pex3 python3.8 pex lock create --style universal --target-system linux --target-system mac --resolver-version pip-2020-resolver "git+<https://github.com/jsirois/clr.git@07d525764e6589a1059ee3977bbaefbb687c629a#egg=clr>" --indent 2 -o lock.3.8.json
$ PEX_SCRIPT=pex3 python3.9 pex lock create --style universal --target-system linux --target-system mac --resolver-version pip-2020-resolver "git+<https://github.com/jsirois/clr.git@07d525764e6589a1059ee3977bbaefbb687c629a#egg=clr>" --indent 2 -o lock.3.9.json
$ diff lock.3.7.json lock.3.8.json
$ diff lock.3.7.json lock.3.9.json
$
enough-analyst-54434
11/23/2022, 4:08 PMenough-analyst-54434
11/23/2022, 4:14 PMenough-analyst-54434
11/23/2022, 4:16 PMsparse-lifeguard-95737
11/23/2022, 4:22 PMsparse-lifeguard-95737
11/23/2022, 4:23 PMenough-analyst-54434
11/23/2022, 4:25 PM