cool-easter-32542
10/26/2023, 11:46 PMsrc/python/pants/backend/python/util_rules/pex_test.py::test_interpreter_constraints test sometimes fails with `No supported version of Pip is compatible with the given targets`:
_________________________ test_interpreter_constraints _________________________
rule_runner = RuleRunner(build_root=/tmp/_BUILD_ROOTlz0ula6c)
def test_interpreter_constraints(rule_runner: RuleRunner) -> None:
constraints = InterpreterConstraints(["CPython>=2.7,<3", "CPython>=3.6"])
> pex_info = create_pex_and_get_pex_info(
rule_runner, interpreter_constraints=constraints, internal_only=False
)
src/python/pants/backend/python/util_rules/pex_test.py:422:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
src/python/pants/backend/python/util_rules/pex_test_utils.py:159: in create_pex_and_get_pex_info
return create_pex_and_get_all_data(
src/python/pants/backend/python/util_rules/pex_test_utils.py:140: in create_pex_and_get_all_data
pex = rule_runner.request(Pex, [request])
src/python/pants/testutil/rule_runner.py:401: in request
result = assert_single_element(self.scheduler.product_request(output_type, [params]))
src/python/pants/engine/internals/scheduler.py:582: in product_request
return self.execute(request)
src/python/pants/engine/internals/scheduler.py:523: in execute
self._raise_on_error([t for _, t in throws])
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pants.engine.internals.scheduler.SchedulerSession object at 0x7f91dc27d8b0>
throws = [Throw(exc=ProcessExecutionFailure("Process 'Building test.pex' failed with exit code 1.\nstdout:\n\nstderr:\nNo suppo...oot for inspection.\n', engine_traceback=[('pants.backend.python.util_rules.pex.create_pex', None), ('select', None)])]
def _raise_on_error(self, throws: list[Throw]) -> NoReturn:
exception_noun = pluralize(len(throws), "Exception")
others_msg = f"\n(and {len(throws) - 1} more)\n" if len(throws) > 1 else ""
> raise ExecutionError(
f"{exception_noun} encountered:\n\n"
f"{throws[0].render(self._scheduler.include_trace_on_error)}\n"
f"{others_msg}",
wrapped_exceptions=tuple(t.exc for t in throws),
)
E pants.engine.internals.scheduler.ExecutionError: 1 Exception encountered:
E
E Engine traceback:
E in select
E ..
E in pants.backend.python.util_rules.pex.create_pex
E ..
E
E Traceback (most recent call last):
E File "src/python/pants/backend/python/util_rules/pex.py", line 815, in create_pex
E result = await Get(BuildPexResult, PexRequest, request)
E File "src/python/pants/engine/internals/selectors.py", line 122, in __await__
E result = yield self
E pants.engine.process.ProcessExecutionFailure: Process 'Building test.pex' failed with exit code 1.
E stdout:
E
E stderr:
E No supported version of Pip is compatible with the given targets:
E cp27-cp27mu-manylinux_2_31_x86_64 interpreter at /usr/bin/python2.7
E cp310-cp310-manylinux_2_31_x86_64 interpreter at /opt/hostedtoolcache/Python/3.10.13/x64/bin/python3.10
E cp311-cp311-manylinux_2_31_x86_64 interpreter at /opt/hostedtoolcache/Python/3.11.6/x64/bin/python3.11
E cp312-cp312-manylinux_2_31_x86_64 interpreter at /opt/hostedtoolcache/Python/3.12.0/x64/bin/python3.12
E cp37-cp37m-manylinux_2_31_x86_64 interpreter at /opt/hostedtoolcache/Python/3.7.17/x64/bin/python3.7
E cp38-cp38-manylinux_2_31_x86_64 interpreter at /opt/hostedtoolcache/Python/3.8.18/x64/bin/python3.8
E cp38-cp38-manylinux_2_31_x86_64 interpreter at /usr/bin/python3.8
E cp39-cp39-manylinux_2_31_x86_64 interpreter at /home/runner/.cache/pants/named_caches/pex_root/venvs/4bfbfcbc6a986fea6cde0d5d7c4efc6d60ea46f5/ec5c5a4408c4e23ea619544b8d413402fd66780f/bin/python3.9
E cp39-cp39-manylinux_2_31_x86_64 interpreter at /opt/hostedtoolcache/Python/3.9.18/x64/bin/python3.9
E
E
E
E Use `--keep-sandboxes=on_failure` to preserve the process chroot for inspection.
src/python/pants/engine/internals/scheduler.py:507: ExecutionError
- generated xml file: src.python.pants.backend.python.util_rules.pex_test.py.tests.xml -
=========================== short test summary info ============================
FAILED src/python/pants/backend/python/util_rules/pex_test.py::test_interpreter_constraints
Examples:
• https://github.com/pantsbuild/pants/actions/runs/6660364237/job/18102045568 (#20102)
• https://github.com/pantsbuild/pants/actions/runs/6659967051/job/18102086696 (#20101)
• https://github.com/pantsbuild/pants/actions/runs/6658225473/job/18094724006 (189d20a on main)
Pants version
Various near-current main commits.
OS
Linux
Additional info
#19879 (comment) may have relevant/related background, suggesting that this could be caused by tests interacting to have an appropriate pip version preinstalled into a shared cache. The exact symptom was different there, although the pip has since been upgraded to 2.1.148 (#20048).
pantsbuild/pantscool-easter-32542
10/30/2023, 5:40 PM