-
-
Notifications
You must be signed in to change notification settings - Fork 9.8k
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: re-exec self under Rosetta if needed #9287
bin/brew: re-exec self under Rosetta if needed #9287
Conversation
As discussed in Homebrew#9177, we've reserved /usr/local as the prefix to use on Apple Silicon Macs for an Intel installation of Homebrew to be run under Rosetta. If a user has a /usr/local installation on an Apple Silicon Mac, and executes /usr/local/bin/brew, we should make sure we're running that copy of brew as Intel under emulation in order to avoid confusion. This makes that change.
Review period will end on 2020-11-26 at 01:48:37 UTC. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A few concerns:
- Will this succeed if Rosetta isn't installed?
- This will avoid the existing prefix messaging from ever being displayed for
/usr/local
which is undesirable. - If the existing
/usr/local
had some ARM software installed in it this will produce confusing errors later on. - I'd rather we avoided hardcoding
/usr/local
in another place here. - It feels like there's a bit of overlap here with Check flavour to prevent mixed architectures #9126.
An alternate approach I'd rather (which overlaps with #9126) is changing or tweaking the existing error messages to make it more clear what needs to be done and how to do it. Doing so automatically without prompt or notification seems dangerous. Perhaps having an environment variable which has this behaviour (in brew.sh
not bin/brew
) would be an acceptable workaround after #9126 is finished and merged (or closed)
Review period ended. |
Closing in favour of #9418 ❤️ |
brew style
with your changes locally?brew tests
with your changes locally?brew man
locally and committed any changes?As discussed in #9177, we've reserved
/usr/local
as the prefix to use on Apple Silicon Macs for an Intel installation of Homebrew to be run under Rosetta.If a user has a
/usr/local
installation on an Apple Silicon Mac, and executes/usr/local/bin/brew
, we should make sure we're running that copy ofbrew
as Intel under emulation in order to avoid confusion. This makes that change.cc #9126
cc @claui, @MikeMcQuaid