Skip to content

Commit

Permalink
Upgrade to Pex 2.1.18. (pantsbuild#10938)
Browse files Browse the repository at this point in the history
This brings several fixes including a new --tmpdir option we use to fix
relative TMPDIR use.

Fixes pantsbuild#10936
  • Loading branch information
jsirois authored Oct 9, 2020
1 parent a1521c3 commit f678abf
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 10 deletions.
2 changes: 1 addition & 1 deletion 3rdparty/python/constraints.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ mypy==0.782
mypy-extensions==0.4.3
packaging==20.4
pathspec==0.8.0
pex==2.1.17
pex==2.1.18
pip==18.1
pluggy==0.13.1
psutil==5.7.0
Expand Down
2 changes: 1 addition & 1 deletion 3rdparty/python/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ mypy==0.782

packaging==20.4
pathspec==0.8.0
pex==2.1.17
pex==2.1.18
psutil==5.7.0
pystache==0.5.4
# This should be kept in sync with `pytest.py`.
Expand Down
19 changes: 11 additions & 8 deletions src/python/pants/backend/python/util_rules/pex_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ class PexBinary(ExternalTool):

options_scope = "download-pex-bin"
name = "pex"
default_version = "v2.1.17"
default_version = "v2.1.18"

@classproperty
def default_known_versions(cls):
Expand All @@ -41,8 +41,8 @@ def default_known_versions(cls):
(
cls.default_version,
plat,
"df836ddd102d8fc9fb390cc4c7fc478caf5afa1600cbdeb7753b185e27a6a8b0",
"2673293",
"3a47dcbcf49294c06439fdda50675546edc9ea09a116c4c57ee5a8e337a63509",
"2678219",
)
)
for plat in ["darwin", "linux"]
Expand Down Expand Up @@ -133,17 +133,20 @@ async def setup_pex_cli_process(
*cert_args,
"--pex-root",
pex_root_path,
python=request.python,
)
env = {
# Ensure Pex and its subprocesses create temporary files in the the process execution
# sandbox. It may make sense to do this generally for Processes, but in the short term we
# have known use cases where /tmp is too small to hold large wheel downloads Pex is asked to
# perform. Making the TMPDIR local to the sandbox allows control via
# --local-execution-root-dir for the local case and should work well with remote cases where
# a remoting implementation has to allow for processes producing large binaries in a
# sandbox to support reasonable workloads.
"TMPDIR": tmpdir,
# sandbox to support reasonable workloads. Communicating TMPDIR via --tmpdir instead of via
# environment variable allows Pex to absolutize the path ensuring subprocesses that change
# CWD can find the TMPDIR.
"--tmpdir",
tmpdir,
python=request.python,
)
env = {
**pex_env.environment_dict(python_configured=request.python is not None),
**python_native_code.environment_dict,
**(request.extra_env or {}),
Expand Down

0 comments on commit f678abf

Please sign in to comment.