File tree Expand file tree Collapse file tree 1 file changed +10
-0
lines changed
Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Original file line number Diff line number Diff line change @@ -680,6 +680,16 @@ def compile(self):
680680 runez .decompress (path , self .m_src_build , simplify = True )
681681
682682 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+
683693 prev_env_vars = {}
684694 for var_name , value in env_vars .items ():
685695 LOG .info ("env %s=%s" , var_name , runez .short (value , size = 2048 ))
You can’t perform that action at this time.
0 commit comments