From 6cbfc60c06ed07b6deb5231070742ef66039ba9e Mon Sep 17 00:00:00 2001 From: John Sirois Date: Fri, 15 Nov 2024 16:26:23 -0800 Subject: [PATCH] Hacky stab in the dark #2. --- pex/pex_info.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pex/pex_info.py b/pex/pex_info.py index 58b7d0803..957d4d33e 100644 --- a/pex/pex_info.py +++ b/pex/pex_info.py @@ -151,6 +151,7 @@ def __init__(self, info=None): self._excluded = OrderedSet(self._pex_info.get("excluded", ())) # type: OrderedSet[str] self._overridden = OrderedSet(self._pex_info.get("overridden", ())) # type: OrderedSet[str] + self._backup_pex_root = safe_mkdtemp() def _get_safe(self, key): if key not in self._pex_info: @@ -510,14 +511,13 @@ def pex_root(self): # type: () -> str pex_root = os.path.realpath(os.path.expanduser(self.raw_pex_root)) if not can_write_dir(pex_root): - tmp_root = os.path.realpath(safe_mkdtemp()) + tmp_root = os.path.realpath(self._backup_pex_root) pex_warnings.warn( "PEX_ROOT is configured as {pex_root} but that path is un-writeable, " "falling back to a temporary PEX_ROOT of {tmp_root} which will hurt " "performance.".format(pex_root=pex_root, tmp_root=tmp_root) ) pex_root = self._pex_info["pex_root"] = tmp_root - os.environ["PEX_ROOT"] = pex_root return pex_root @pex_root.setter