We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 4d05279 commit 505bbdaCopy full SHA for 505bbda
1 file changed
src/portable_python/__init__.py
@@ -680,6 +680,16 @@ def compile(self):
680
runez.decompress(path, self.m_src_build, simplify=True)
681
682
env_vars = self._get_env_vars()
683
+ if not PPG.config.get_value("allow-homebrew"):
684
+ # Remove any mention of /opt/homebrew from PATH (reduce chances of dynamic links to homebrew)
685
+ path_env_var = env_vars.get("PATH")
686
+ if path_env_var:
687
+ _paths = os.environ.get("PATH", "").split(":")
688
+ _revised = [p for p in _paths if not p.startswith("/opt/homebrew")]
689
+ if _revised != _paths:
690
+ LOG.info("Removed /opt/homebrew mentions from PATH")
691
+ env_vars["PATH"] = runez.joined(_revised, delimiter=":")
692
+
693
prev_env_vars = {}
694
for var_name, value in env_vars.items():
695
LOG.info("env %s=%s", var_name, runez.short(value, size=2048))
0 commit comments