Homebrew / brew

🍺 The missing package manager for macOS (or Linux)
https://brew.sh
BSD 2-Clause "Simplified" License
41.08k stars 9.64k forks source link

Apple Silicon support in Homebrew #10152

Closed fxcoudert closed 2 years ago

fxcoudert commented 3 years ago

Current status

We now have a majority of our formulas bottled for Apple Silicon: 70%. However, not all software is ready for ARM processors on macOS, and since we ship what upstream releases, there will be some formulas that take a long time to be fixed, have a new release… and some which will never support ARM.

Our level of support is this: Homebrew strives to ship ARM bottles for software that does support ARM. We can't fix every software that's out there, and we won't accept feature requests like “formula Z does not support ARM can you fix it”. The most useful way you can help that software work on ARM is to open a bug report with the software developers.

What formulas are supported? The ones that have an ARM bottle, i.e. an arm64_big_sur line in the bottle block. You can also check online at https://formulae.brew.sh


How you can help

Also:


Current major blockers

We know these are not currently working, and are widely used. We are tracking their developers' progress and will be incorporating them as soon as possible:


PS: We had a previous gigantic issue tracking our work in previous months (before we roll out official support) at https://github.com/Homebrew/brew/issues/7857 If you're trying to build something from source, be sure to go check there if someone has tried before you :)

carlocab commented 3 years ago

There was a PR for ghc (8.10.2) here: https://github.com/Homebrew/homebrew-core/pull/65997

It may need to be rebased against master in the next day or so, as I think ghc 8.10.3 https://github.com/Homebrew/homebrew-core/pull/67284 will be ready to merge soon.

AddoSolutions commented 3 years ago

Just to confirm my understanding here, the Homebrew (the package manager) software itself is M1 ready, the installer script is pending Homebrew/install#373, and then there will be subsequent packages that require some hand-holding, however for the ~70% of packages out there that are ARM ready will be good to go with that MR?

There is a TON of info flying around and want just to verify understanding.

Mushroom commented 3 years ago

Would it be worth linking to the relevant PRs for the ones still in progress? (ie, https://github.com/Homebrew/homebrew-core/pull/67170 for QT) Scratch that, beat me to it while I was writing the comment!

Are there any formulas in particular that need help/work on? I'm happy to take a look at some, I'm new to macOS, but I know a lot about build systems and the arm architecture.

fxcoudert commented 3 years ago

@AddoSolutions yes, that sums it up nicely. We will communicate more clearly on this, in the next few days, through an official announcement.

@Mushroom if you could sort out Qt, you'd be a hero :)

Mushroom commented 3 years ago

@fxcoudert I'll try my best to try and reproduce that issue! If it helps I can provide a pre-built bottle? (minus webengine)

fxcoudert commented 3 years ago

@Mushroom no we'll only ship things we can build on our own machines, for reasons of security

Mushroom commented 3 years ago

@fxcoudert Understood, will try and investigate

r58Playz commented 3 years ago

x265 works. Both brew install and brew test are sucessful.

carlocab commented 3 years ago

There's a PR open for x265: https://github.com/Homebrew/homebrew-core/pull/67758

It'll take a while to get through CI.

sunilshah commented 3 years ago

This may be off-topic but it is not clear how to install brew safely on an M1 machine to run both Rosetta 2 and arm64 versions of brew packages. I already have brew running under Rosetta2.

Running installation script natively, gives


 /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
Homebrew is not (yet) supported on ARM processors!
Rerun the Homebrew installer under Rosetta 2.
If you really know what you are doing and are prepared for a very broken
experience you can use another installation option for installing on ARM:
  https://docs.brew.sh/Installation

The instructions on alternate installation are unclear-it merely states what not to do, rather than what to do step by step.

fxcoudert commented 3 years ago

@sunilshah The installer will be ready in a couple of days: https://github.com/Homebrew/install/pull/373

richiksc commented 3 years ago

@fxcoudert I had assumed that Homebrew/homebrew-core#67577 being merged meant that arm64 bottles would not be overwritten by new versions bottled by BrewTestBot. However, it looks like ARM bottles are still manually added and that BrewTestBot overrides ARM bottles - what is still needed in order for BrewTestBot to build arm64 bottles alongside the others and upload them together?

fxcoudert commented 3 years ago

@richiksc pull requests opened before I merged https://github.com/Homebrew/homebrew-core/pull/67577 might still erase ARM bottles, but I am keeping watch for those and rebuilding them. Is any bottle currently missing?

richiksc commented 3 years ago

@fxcoudert Oh, awesome! I didn't know that the bottles were built when the pull request is opened, not when the pull request is merged. Looking at some of the more recent BrewTestBot commits have it rebuilding and uploading :arm64_big_sur bottles 👍.

It looks like the most recent libxslt rebottle erased an ARM bottle, and all of the bottle update commits this morning from @dawidd6 also overrwrote ARM bottles.

fxcoudert commented 3 years ago

@richiksc please update (brew up), as I believe those are all fixed. I am tracking bottle regressions with a script :)

sunilshah commented 3 years ago

@fxcoudert

Thanks for the response. Please let me know when I should try the native installer.

richiksc commented 3 years ago

@sunilshah, if you don't want to wait, you can also use the untar method of installation. This is what I have been using, and it has worked well - it essentially does what the installer script does, but manually.

mkdir opt
cd opt
mkdir homebrew && curl -L https://github.com/Homebrew/brew/tarball/master | tar xz --strip 1 -C homebrew

After Homebrew installs, make sure to add /opt/homebrew/bin to your PATH in ~/.zshrc. I tried .zshenv but since that gets called before the system PATH is loaded /usr/bin will be in front, and you won't be able to use the Homebrew versions of pre-installed executables like git.

briandunn commented 3 years ago

regarding packages that build and pass on m1: brew install luajit -s --HEAD works on my machine.

gpetrov commented 3 years ago

wow great work @fxcoudert ! qt and imagemagick are pouring just fine now from bottles!

just imagemagick complains about linking each time - even if it wasn't installed yet:

==> Downloading https://homebrew.bintray.com/bottles/imagemagick-7.0.10-53.arm64_big_sur.bottle.tar.gz
Already downloaded: /Users/george/Library/Caches/Homebrew/downloads/e86686b1c7b12ce418b291e0787d36e2484bae499dfded16fa8ed8eb16390614--imagemagick-7.0.10-53.arm64_big_sur.bottle.tar.gz
==> Pouring imagemagick-7.0.10-53.arm64_big_sur.bottle.tar.gz
Error: The `brew link` step did not complete successfully
The formula built, but is not symlinked into /opt/homebrew
Could not symlink lib/libMagickCore-7.Q16HDRI.8.dylib
Target /opt/homebrew/lib/libMagickCore-7.Q16HDRI.8.dylib
already exists. You may want to remove it:
  rm '/opt/homebrew/lib/libMagickCore-7.Q16HDRI.8.dylib'

To force the link and overwrite all conflicting files:
  brew link --overwrite imagemagick

To list all files that would be deleted:
  brew link --overwrite --dry-run imagemagick

Possible conflicting files are:
/opt/homebrew/lib/libMagickCore-7.Q16HDRI.8.dylib
==> Summary
🍺  /opt/homebrew/Cellar/imagemagick/7.0.10-53: 797 files, 32.0MB

and a bottle for vips - would be also nice, but the compile is also not fully working, maybe due to old bug https://github.com/libvips/libvips/issues/125 or mixed dependencies because vips actually went on auto install when installing imagemagick, while it has image magic as dependency and not imagemagick vips .. maybe somehow a circular dependency?

dyld: Library not loaded: @rpath/libomp.dylib
  Referenced from: /private/tmp/vips-20201227-9001-88cql0/vips-8.10.5/libvips/.libs/introspect
  Reason: image not found
Command '['./introspect', '--introspect-dump=/private/tmp/tmp-introspectk3brwabp/functions.txt,/private/tmp/tmp-introspectk3brwabp/dump.xml']' died with <Signals.SIGABRT: 6>.
make[2]: *** [Vips-8.0.gir] Error 1
make[1]: *** [install-recursive] Error 1
make: *** [install-recursive] Error 1
fxcoudert commented 3 years ago

@gpetrov imagemagick is complaining about conflict with a file from itself? How weird. Can you reproduce on a clean install, and open a brew bug about it, please? Please fill all the template info.

fxcoudert commented 3 years ago

@briandunn we don't bottle HEAD builds, so let's keep this issue about stable versions

gpetrov commented 3 years ago

after cleaning my weird read only libs, I could successfully install imagemagick and vips!

so all good! Maybe you can make a bottle of vips @fxcoudert - it compiles all fine!

==> Downloading https://github.com/libvips/libvips/releases/download/v8.10.5/vips-8.10.5.tar.gz
Already downloaded: /Users/george/Library/Caches/Homebrew/downloads/e8752c98d6977d23909b94c1d3ee31e2c21afda72fa95eeb140bbbbde0add7c8--vips-8.10.5.tar.gz
==> ./configure --prefix=/opt/homebrew/Cellar/vips/8.10.5 --with-magick
==> make install
🍺  /opt/homebrew/Cellar/vips/8.10.5: 167 files, 14.0MB, built in 1 minute 6 seconds
Removing: /Users/george/Library/Caches/Homebrew/vips--8.10.2.tar.gz... (18.6MB)
fxcoudert commented 3 years ago

@gpetrov mozjpeg test currently fails, a rpath issue. Trying to fix in https://github.com/Homebrew/homebrew-core/pull/67811

gpetrov commented 3 years ago

weird mozjpeg did compile all well to me before, anyway now it is pouring just fine from bottle:

==> Downloading https://homebrew.bintray.com/bottles/mozjpeg-4.0.0.arm64_big_sur.bottle.1.tar.gz
==> Downloading from https://d29vzk4ow07wi7.cloudfront.net/b76cd545bd4829c589107a5c723086bda97d9060dd76d5b2626d45502b279487?response-content
######################################################################## 100.0%
==> Reinstalling mozjpeg 
==> Pouring mozjpeg-4.0.0.arm64_big_sur.bottle.1.tar.gz
==> Caveats
mozjpeg is keg-only, which means it was not symlinked into /opt/homebrew,
because mozjpeg is not linked to prevent conflicts with the standard libjpeg.

If you need to have mozjpeg first in your PATH run:
  echo 'export PATH="/opt/homebrew/opt/mozjpeg/bin:$PATH"' >> ~/.zshrc

For compilers to find mozjpeg you may need to set:
  export LDFLAGS="-L/opt/homebrew/opt/mozjpeg/lib"
  export CPPFLAGS="-I/opt/homebrew/opt/mozjpeg/include"

For pkg-config to find mozjpeg you may need to set:
  export PKG_CONFIG_PATH="/opt/homebrew/opt/mozjpeg/lib/pkgconfig"

==> Summary
🍺  /opt/homebrew/Cellar/mozjpeg/4.0.0: 40 files, 2.6MB
vom513 commented 3 years ago

mpg123 builds from source (manually) on AS. I used the same ./configure flags as the forumula, just changing '--with-cpu=x86-64' to '--with-cpu=aarch64'. Afterwards I tested by playing a network stream for a bit.

I don't know enough about Ruby / forumlas to try to do this on my own. I would guess what's needed is some small bit of detection code in the forumla to set this arg depending on what CPU we are running under ?

carlocab commented 3 years ago

@vom513, you may wish to have a look at macvim:

https://github.com/Homebrew/homebrew-core/blob/035e2e359d863addc84a2ff905e694f20f5c09a4/Formula/macvim.rb#L57

vom513 commented 3 years ago

@vom513, you may wish to have a look at macvim:

https://github.com/Homebrew/homebrew-core/blob/035e2e359d863addc84a2ff905e694f20f5c09a4/Formula/macvim.rb#L57

Thanks for the pointer, I see the variable being used for CPU - #{Hardware::CPU.arch}

However when trying this, compilation fails as the CPU arch is set to arm64 not aarch64:

michele@scambox Downloads % brew install -s mpg123.rb
==> Downloading https://www.mpg123.de/download/mpg123-1.26.4.tar.bz2
Already downloaded: /Users/michele/Library/Caches/Homebrew/downloads/d164078a0bb044671ca6ffcf2438ccd286382cd0e7cc91cbdcaced2885c3bd7d--mpg123-1.26.4.tar.bz2
==> ./configure --prefix=/opt/homebrew/Cellar/mpg123/1.26.4 --with-default-audio=coreaudio --with-module-suffix=.so --with-cpu=arm64

Which results in:

configure: error: Unknown CPU type 'arm64'
carlocab commented 3 years ago

Ah, yes. What happens when you drop the --with-cpu flag? It may be simpler to just do that. If that doesn't work, something like this might:

if Hardware::CPU.arm?
  args << "--with-cpu=aarch64"
else
  args << "--with-cpu=x86-64"
end
vom513 commented 3 years ago

Ah, yes. What happens when you drop the --with-cpu flag? It may be simpler to just do that. If that doesn't work, something like this might:

if Hardware::CPU.arm?
  args << "--with-cpu=aarch64"
else
  args << "--with-cpu=x86-64"
end

Yep that works (the if/else). Thanks. I'd personally say not to drop the cpu flag completely - as it enables optimization code for decoding.

Now I'm going to try to figure out the bump / pr command...

EDIT: Well I'm out of my depth here. I think I understand what the bump-formula-pr command does at a high level - but I don't know how to drive it (i.e. additional args, file arg, etc).

I have the mpg123.rb formula file edited to build on AS. If someone would be so kind as to clue me in on what to run to do the bump/pr correctly I would be grateful. Thanks.

fxcoudert commented 3 years ago

Thanks for the information, mpg123 fix is there: https://github.com/Homebrew/homebrew-core/pull/67814

Mushroom commented 3 years ago

Investigated mono - I think we need to cherry-pick this patch https://github.com/mono/mono/commit/ae983fe58fd5f8e48624efed7ce1070fc61e54ab

For whatever reason mono stopped splitting off a branch every 2 months for their releases back in February, and just cherry picks some commits on top of that very old branch - this was not one of them, and it appears to make cherry picking things increasingly impractical.

Building master works perfectly fine.

I tried to apply the patch and it mostly works (with various offsets), but fails on mini-runtime.c. I would investigate more, but I will unfortunately be away from an M1 machine until the 3rd/4th of Jan - just didn't want any duplication of effort if someone wants to dig further.

robertchin commented 3 years ago

Hi can add a bottle for aften. The PR for Apple Silicon support was merged in a two weeks or so ago so it builds and runs fine.

fxcoudert commented 3 years ago

@robertchin There is already an ARM bottle for aften, since 2020-12-22

gpetrov commented 3 years ago

Any luck with docker-machine? Getting some go errors, not sure if it is go or docker-machine itself:

> brew install -s docker-machine   
==> Cloning https://github.com/docker/machine.git
Updating /Users/george/Library/Caches/Homebrew/docker-machine--git
==> Checking out tag v0.16.2
HEAD is now at bd45ab13 Bump version to 0.16.2
HEAD is now at bd45ab13 Bump version to 0.16.2
==> make build
Last 15 lines from /Users/george/Library/Logs/Homebrew/docker-machine/01.make:

go: cannot find main module, but found Gopkg.lock in /private/tmp/docker-machine-20201228-23277-wyaiq1/src/github.com/docker/machine
    to create a module there, run:
    go mod init
go build \
    -o /private/tmp/docker-machine-20201228-23277-wyaiq1/src/github.com/docker/machine/bin/docker-machine \
     -tags "" \
    -ldflags "-X `go list ./version`.GitCommit=`git rev-parse --short HEAD 2>/dev/null` -w -s"  ./cmd/docker-machine
go: cannot find main module, but found Gopkg.lock in /private/tmp/docker-machine-20201228-23277-wyaiq1/src/github.com/docker/machine
    to create a module there, run:
    go mod init
go: cannot find main module, but found Gopkg.lock in /private/tmp/docker-machine-20201228-23277-wyaiq1/src/github.com/docker/machine
    to create a module there, run:
    go mod init
make: *** [/private/tmp/docker-machine-20201228-23277-wyaiq1/src/github.com/docker/machine/bin/docker-machine] Error 1
raphaelc2009 commented 3 years ago

Will it install amd64 casks and bottles if an arm version is unavailable? or will we need 2 homebrew installations?

fxcoudert commented 3 years ago

For formulas, the ARM homebrew will only install ARM bottles. For casks, you'd need to ask at homebrew-casks.

raphaelc2009 commented 3 years ago

Okay thanks. I that case will we be able to have 2 homebrew installs, one for arm and the other for amd64?

richiksc commented 3 years ago

Okay thanks. I that case will we be able to have 2 homebrew installs, one for arm and the other for amd64?

@raphaelc2009, yes, this blog post explains how to manage both a Rosetta and ARM installation of Homebrew: https://soffes.blog/homebrew-on-apple-silicon

kamelie1706 commented 3 years ago

How to prevent the 2 installations interact to each others?

I have this set in my profile `export PATH="/opt/homebrew/bin:/opt/homebrew/opt:$PATH" alias abrew='arch -arm64 /opt/homebrew/bin/brew' alias ibrew='arch -x86_64 /usr/local/bin/brew'

x86 config

HOMEBREW_VERSION: 2.7.1
ORIGIN: https://github.com/Homebrew/brew
HEAD: fdb71a5cb3029da2ef74d7e09c40575bbfb4ec72
Last commit: 7 hours ago
Core tap ORIGIN: https://github.com/Homebrew/homebrew-core
Core tap HEAD: 9ba239a162c83a19c296f28ef76be34a2190df2f
Core tap last commit: 17 minutes ago
Core tap branch: master
HOMEBREW_PREFIX: /usr/local
HOMEBREW_CASK_OPTS: []
HOMEBREW_MAKE_JOBS: 8
Homebrew Ruby: 2.6.3 => /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/bin/ruby
CPU: octa-core 64-bit westmere
Clang: 12.0 build 1200
Git: 2.24.3 => /Library/Developer/CommandLineTools/usr/bin/git
Curl: 7.64.1 => /usr/bin/curl
macOS: 11.1-x86_64
CLT: 12.3.0.0.1.1607026830
Xcode: 12.3
Rosetta 2: true

arm config

HOMEBREW_VERSION: 2.7.1
ORIGIN: https://github.com/Homebrew/brew
HEAD: fdb71a5cb3029da2ef74d7e09c40575bbfb4ec72
Last commit: 7 hours ago
Core tap ORIGIN: https://github.com/Homebrew/homebrew-core
Core tap HEAD: 9ba239a162c83a19c296f28ef76be34a2190df2f
Core tap last commit: 18 minutes ago
Core tap branch: master
HOMEBREW_PREFIX: /opt/homebrew
HOMEBREW_CASK_OPTS: []
HOMEBREW_MAKE_JOBS: 8
Homebrew Ruby: 2.6.3 => /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/bin/ruby
CPU: octa-core 64-bit arm_firestorm_icestorm
Clang: 12.0 build 1200
Git: 2.24.3 => /Library/Developer/CommandLineTools/usr/bin/git
Curl: 7.64.1 => /usr/bin/curl
macOS: 11.1-arm64
CLT: 12.3.0.0.1.1607026830
Xcode: 12.3
Rosetta 2: false

Is that enough?

raphaelc2009 commented 3 years ago

thanks

aimileus commented 3 years ago

Any luck with docker-machine? Getting some go errors, not sure if it is go or docker-machine itself:

@gpetrov If https://github.com/Homebrew/homebrew-core/pull/67891 gets merged docker-machine itself should be working, but most drivers still need work.

kamelie1706 commented 3 years ago

Is there a way to search a package filter by a specific "bottle" from brew command line? I could find the filter --macports but that does not make a difference between arm and intel. Same need for "info" ...

So far the only way to check I could find is the website ... did I miss something? https://formulae.brew.sh/

carlocab commented 3 years ago

@kamelie1706

rg -l ':arm64_big_sur' $(brew --repo homebrew/core) | xargs -I{} basename {} .rb

or, just with grep

grep -Rl ':arm64_big_sur' $(brew --repo homebrew/core) | xargs -I{} basename {} .rb
kamelie1706 commented 3 years ago

@carlocab Thx!

elbamos commented 3 years ago

Okay thanks. I that case will we be able to have 2 homebrew installs, one for arm and the other for amd64?

@raphaelc2009, yes, this blog post explains how to manage both a Rosetta and ARM installation of Homebrew: https://soffes.blog/homebrew-on-apple-silicon

@richiksc I actually found the stuff on that blogpost to be pretty inaccurate, and frankly counterproductive to getting two homebrews working side by side. The only method I found that worked reliably and consistently, was to create a separate iTerm2 profile where the call to the login shell was prefixed by arch.

@raphaelc2009 Its likely that many of the items in cask will handle the arm transition on their own. Either by using universal binaries, or universal installers that select the arm or x86 versions at install time.

richiksc commented 3 years ago

@richiksc I actually found the stuff on that blogpost to be pretty inaccurate, and frankly counterproductive to getting two homebrews working side by side. The only method I found that worked reliably and consistently, was to create a separate iTerm2 profile where the call to the login shell was prefixed by arch.

@elbamos Interesting. I never actually installed brew under Rosetta 2 - I went with native ARM from day 1, installing via the untar method to /opt/homebrew. However, the method described in the blog post makes logical sense to me - have two homebrews installed in different directories so that ARM and Intel formulae install to different directories, and create aliases to run the Intel brew under Rosetta 2. It seems like @kamelie1706 got the method described in the blog post to work. Again, the blog post is quite outdated (compared to the state of Homebrew support on arm today). I don't use iTerm2 so using iTerm profiles was not something I considered.

@sunilshah, the installer script from https://brew.sh should work natively now, since Homebrew/install#373 has been merged.

elbamos commented 3 years ago

A couple of issues arose. One was that, since homebrew drops a link into /usr/local to brew, it wasn’t straightforward to control which brew you were using. The two versions fought with each other in detecting paths.

A second issue is that calling arch before launching brew wasn’t sticky. Some subprocesses launched by brew inherited their arch from the shell instead of from the brew command.

Calling arch when launching the login shell resolved it. But then you hit the issue of, what’s the point of two brew installations on the same machine?

On Dec 28, 2020, at 1:51 PM, Richik SC notifications@github.com wrote:

 @richiksc I actually found the stuff on that blogpost to be pretty inaccurate, and frankly counterproductive to getting two homebrews working side by side. The only method I found that worked reliably and consistently, was to create a separate iTerm2 profile where the call to the login shell was prefixed by arch.

@elbamos Interesting. I never actually installed brew under Rosetta 2 - I went with native ARM from day 1, installing via the untar method to /opt/homebrew. However, the method described in the blog post makes logical sense to me - have two homebrews installed in different directories so that ARM and Intel formulae install to different directories, and create aliases to run the Intel brew under Rosetta 2. It seems like @kamelie1706 got the method described in the blog post to work. Again, the blog post is quite outdated (compared to the state of Homebrew support on arm today). I don't use iTerm2 so using iTerm profiles was not something I considered.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or unsubscribe.

brentward commented 3 years ago

I'm getting postinstall errors when installing openssl@1.1 and gnutls. It seems like the openssl bottle is supposed to be ready so I'm not sure if this is appropriate to report or not. Are other people having this same issue?

Both of them seem to be failing doing the same thing which is it can't find the security command when run in backticks like this: certs_list = `security find-certificate -a -p #{keychains.join(" ")}`

The results when running the postinstall are:

/opt/homebrew/Library/Homebrew/brew.rb (Formulary::FormulaLoader): loading /opt/homebrew/Library/Taps/homebrew/homebrew-core/Formula/openssl@1.1.rb
==> Postinstalling openssl@1.1
/usr/bin/sandbox-exec -f /private/tmp/homebrew20201228-48470-9frc4f.sb nice ruby -W0 -I $LOAD_PATH -- /opt/homebrew/Library/Homebrew/postinstall.rb /opt/homebrew/Library/Taps/homebrew/homebrew-core/Formula/openssl@1.1.rb
Warning: The post-install step did not complete successfully
You can try again using `brew postinstall openssl@1.1`
==> An exception occurred within a child process:
  Errno::ENOENT: No such file or directory - security

/opt/homebrew/Library/Taps/homebrew/homebrew-core/Formula/openssl@1.1.rb:124:in ``'
/opt/homebrew/Library/Taps/homebrew/homebrew-core/Formula/openssl@1.1.rb:124:in `macos_post_install'
/opt/homebrew/Library/Homebrew/extend/os/mac/on_os.rb:8:in `on_macos'
/opt/homebrew/Library/Taps/homebrew/homebrew-core/Formula/openssl@1.1.rb:115:in `post_install'
/opt/homebrew/Library/Homebrew/formula.rb:1062:in `block (2 levels) in run_post_install'
/opt/homebrew/Library/Homebrew/formula.rb:904:in `with_logging'
/opt/homebrew/Library/Homebrew/formula.rb:1061:in `block in run_post_install'
/opt/homebrew/Library/Homebrew/utils.rb:530:in `with_env'
/opt/homebrew/Library/Homebrew/formula.rb:1050:in `run_post_install'
/opt/homebrew/Library/Homebrew/postinstall.rb:22:in `<main>'

my config is:

HOMEBREW_VERSION: 2.7.1
ORIGIN: https://github.com/Homebrew/brew
HEAD: fdb71a5cb3029da2ef74d7e09c40575bbfb4ec72
Last commit: 13 hours ago
Core tap ORIGIN: https://github.com/Homebrew/homebrew-core
Core tap HEAD: 2af2fafebea189349aa152702e2a67003bd92e7e
Core tap last commit: 3 hours ago
Core tap branch: master
HOMEBREW_PREFIX: /opt/homebrew
HOMEBREW_CASK_OPTS: []
HOMEBREW_MAKE_JOBS: 8
Homebrew Ruby: 2.6.3 => /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/bin/ruby
CPU: octa-core 64-bit arm_firestorm_icestorm
Clang: 12.0 build 1200
Git: 2.24.3 => /Library/Developer/CommandLineTools/usr/bin/git
Curl: 7.64.1 => /usr/bin/curl
macOS: 11.1-arm64
CLT: 12.3.0.0.1.1607026830
Xcode: N/A
Rosetta 2: false
fxcoudert commented 3 years ago

@brentward please open a new issue, fill in all the requested information, and we'll investigate. Thanks for the report!

kamelie1706 commented 3 years ago

@elbamos I actually found the stuff on that blogpost to be pretty inaccurate, and frankly counterproductive to getting two homebrews working side by side. The only method I found that worked reliably and consistently, was to create a separate iTerm2 profile where the call to the login shell was prefixed by arch.

If I understand it right, this is needed only when we execute brew for formula/programs installation/maintenance? by login shell, do you mean you need to log in a specific environment at a time or I could launch 2 terminals with 2 environments during one login session?

So far I have used only arm package (thx raspberry pi success many are already available even if not optimised for m1 ....) and I keep the intel setup only for try and play ....

Of course I have no aim to install the same app in both environment but the risk is there if they depend on other programs (ex: python) :-(