Skip to content

Commit

Permalink
Hacky stab in the dark #2.
Browse files Browse the repository at this point in the history
  • Loading branch information
jsirois committed Nov 16, 2024
1 parent 04e90cd commit 6cbfc60
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pex/pex_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 6cbfc60

Please sign in to comment.