-
-
Notifications
You must be signed in to change notification settings - Fork 9.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
System brew.env not taking precedence when HOMEBREW_SYSTEM_ENV_TAKES_PRIORITY is set #18925
Comments
Acutally you can see this just with |
This functioned prior to this change going in, which looks to have intended to remove usage of The original loaded the env variable first from which is the desired behaviour. |
Can't reproduce:
When I remove
Tested with
|
Okay I have this:
Edit: |
What's the output of
when
? |
I get this:
Note that I can also unset that in
|
Try applying this patch to see if it helps: diff --git a/bin/brew b/bin/brew
index 58bc4f24a3..14c135f0f0 100755
--- a/bin/brew
+++ b/bin/brew
@@ -131,12 +131,12 @@ export_homebrew_env_file() {
}
# First, load the system-wide configuration.
+export_homebrew_env_file "/etc/homebrew/brew.env"
+
unset SYSTEM_ENV_TAKES_PRIORITY
if [[ -n "${HOMEBREW_SYSTEM_ENV_TAKES_PRIORITY-}" ]]
then
SYSTEM_ENV_TAKES_PRIORITY="1"
-else
- export_homebrew_env_file "/etc/homebrew/brew.env"
fi
# Next, load the prefix configuration
@@ -152,7 +152,7 @@ fi
export_homebrew_env_file "${HOMEBREW_USER_CONFIG_HOME}/brew.env"
-# If the system configuration takes priority, load it last.
+# If the system configuration takes priority, load it again to override any previous settings.
if [[ -n "${SYSTEM_ENV_TAKES_PRIORITY-}" ]]
then
export_homebrew_env_file "/etc/homebrew/brew.env" |
I made a fork for the same 👍 Does the trick |
Raised this: #18926 |
OH timing lol |
Thanks @carlocab |
brew doctor
outputVerification
brew doctor
output" above saysYour system is ready to brew.
and am still able to reproduce my issue.brew update
twice and am still able to reproduce my issue.brew install wget
. If they do, open an issue at https://github.com/Homebrew/homebrew-core/issues/new/choose instead.brew config
outputWhat were you trying to do (and why)?
Configure variables at the system level /etc/homebrew/brew.env so that they are not over-written by other configuration files.
What happened (include all command output)?
When running brew config with two environment files configured, the environment variables set in
/etc/homebrew/brew.env
are overridden by~/.homebrew/brew.env
, even though/etc/homebrew/brew.env
hasHOMEBREW_SYSTEM_ENV_TAKES_PRIORITY=1
set.What did you expect to happen?
When HOMEBREW_SYSTEM_ENV_TAKES_PRIORITY=1 is set in
/etc/homebrew/brew.env
any variable prefixed with HOMEBREW_ defined in/etc/homebrew/brew.env
should override definitions elsewhere.Step-by-step reproduction instructions (by running
brew
commands)The text was updated successfully, but these errors were encountered: