Fix test_doctor_shows_trust on macOS outside sandbox

Change-Id: I1fd456a8c5563ba63f795bc4e41811ebeaec9c73
This commit is contained in:
Felix Uhl
2026-04-17 21:36:17 +02:00
parent 15c95b95d6
commit 32f48682de
+6 -2
View File
@@ -221,8 +221,12 @@ class ManagedEnv:
if platform.system() == "Darwin":
# Darwin / Apple behaves differently and requires _NIX_TEST_NO_SANDBOX to be set for whatever reason
self._env |= {"_NIX_TEST_NO_SANDBOX": "1"}
# copy global path to maintain features usually provided by busybox
[self.path.append(p) for p in global_path.split(":") if Path(p).exists()]
# Copy coreutils from the global path to maintain availability of commands that are not part of
# XCode Developer Tools and provided by busybox on Linux, which does not build on Darwin
for p in global_path.split(":"):
if Path(p).exists() and "coreutils" in p:
self.path.append(p)
break
def set_env(self, name: str, value: str):
if name in self.dirs.get_env_keys():