Skip to content
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

bin/brew: fix tracking of original paths with brew-in-brew calls #17421

Merged
merged 1 commit into from
Jun 4, 2024

Conversation

Bo98
Copy link
Member

@Bo98 Bo98 commented Jun 4, 2024

When running something that invokes brew-within-brew, such as brew update, the original PATH normally stored in HOMEBREW_PATH is lost. This is because we block HOMEBREW_PATH from being set from the user environment.

Instead, special case it to allow HOMEBREW_PATH to be set if HOMEBREW_BREW_FILE is also set which is likely to only ever happen when called within brew.

This fixes system Ruby detection not working consistently and sometimes failing for brew update but not other commands.

@Bo98
Copy link
Member Author

Bo98 commented Jun 4, 2024

Should also fix the PATH warnings here: https://github.com/Homebrew/homebrew-portable-ruby/actions/runs/9360846916

Copy link
Member

@MikeMcQuaid MikeMcQuaid left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @Bo98!

@MikeMcQuaid MikeMcQuaid merged commit 62f2e33 into master Jun 4, 2024
25 checks passed
@MikeMcQuaid MikeMcQuaid deleted the original-path-fix branch June 4, 2024 07:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants