How to install both Intel & Apple Silicon versions of formulae? #2141
-
[I spent 45 minutes looking over the documentation for answers to this and another 15 looking over discussions here.] I want to be able to build both Intel and Apple Silicon versions of my apps in my CI system which runs on Intel Macs. Therefore I need to install both versions of my app's dependencies. After I install Brew - actually the CI provider already has Brew installed - how can I install both versions of the dependencies. Some specific questions:
P.S. I do not understand the statements that sudo is not necessary. It is necessary on macOS when writing to |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
None of this is possible, ARM macs can emulate x86 instructions but not the other way around.
It's only needed for the installer because that will adjust the permissions of the relevant folders. |
Beta Was this translation helpful? Give feedback.
-
Yes, formulae are installed in a prefix
You can
There's no easy way to check this right now.
I don't think it would do what you need, but if it did, it would put it under
On Apple Silicon (Homebrew installed on an Apple Silicon system, not Homebrew installing an Apple Silicon package), formulae are installed in a prefix Generally, the use case you're asking for is unsupported. Right now it's not possible to install two different arches of the same formula in Homebrew without renaming one or the other. We've also considered shipping fat binaries/libraries in the past (back in the days of The libraries/software that Homebrew ships was never intended to be used/distributed outside of the Homebrew ecosystem, and due to the necessary core tool and CI changes that would be needed to support other uses (e.g. for redistribution by developers), I think it would be unlikely to happen. Maybe a better place to get what you need would be |
Beta Was this translation helpful? Give feedback.
Yes, formulae are installed in a prefix
/usr/local/Cellar/<package_name>/<version_name>
and then symlinks are made into/usr/local
, e.g./usr/local/Cellar/cmake/3.21.0/bin/cmake -> /usr/local/bin/cmake
. They're also symlinked into an unversioned "opt-prefix",/usr/local/Cellar/cmake/3.21.0/bin/cmake -> /usr/local/opt/cmake/bin/cmake
.You can
brew fetch <package> --bottle-tag <arch>
, e.g.brew fetch cmake --bott…