Skip to content

Commit

Permalink
Always include interpreter constraints in PEXes.
Browse files Browse the repository at this point in the history
Previously we left them off for internal only PEXes. Leaving them does
no harm since PEX uses the current interpreter if it matches constraints
and it aids in the debugability of process chroots.

[ci skip-rust]
[ci skip-build-wheels]
  • Loading branch information
jsirois committed Mar 18, 2021
1 parent f432658 commit f95eb9b
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions src/python/pants/backend/python/util_rules/pex.py
Original file line number Diff line number Diff line change
Expand Up @@ -534,16 +534,14 @@ async def build_pex(
# constraints.
argv.extend(request.platforms.generate_pex_arg_list())
else:
argv.extend(request.interpreter_constraints.generate_pex_arg_list())
# NB: If it's an internal_only PEX, we do our own lookup of the interpreter based on the
# interpreter constraints, and then will run the PEX with that specific interpreter. We
# will have already validated that there were no platforms.
# Otherwise, we let Pex resolve the constraints.
if request.internal_only:
python = await Get(
PythonExecutable, PexInterpreterConstraints, request.interpreter_constraints
)
else:
argv.extend(request.interpreter_constraints.generate_pex_arg_list())

argv.append("--no-emit-warnings")

Expand Down

0 comments on commit f95eb9b

Please sign in to comment.