Live data from Hacker News

Run x86 Apps (including homebrew) in the Terminal on Apple Silicon

notion.so

121–130 of 148 posts

Re: Run x86 Apps (including homebrew) in the Terminal on Apple Silicon

#121
post #16
post #2

That's not needed though, I manually extracted brew to /opt/homebrew per https://docs.brew.sh/Installation , and it works just fine in the native terminal. file htop returns htop: Mach-O 64-bit executable arm64 So this version of brew is compiling native arm64 code.

No, not even close. There is more that doesn't work than works. Of what I use, all I got was python3 and git. But no python3.8, no ffmpeg, no erlang, no gnutls, and on and on. https://github.com/Homebrew/brew/issues/7857

There is no need of homebrew to install ffmpeg on Apple Silicon. I could just ./configure and make on the DTK.

ffmpeg has so many configure options, I always avoid building it with brew.

Re: Run x86 Apps (including homebrew) in the Terminal on Apple Silicon

#122

Would running X86 require licensing? If Intel doesn't say anything then could Apple in a couple of years develop their own X86 CPU by turning Rosetta into a hardware solutions? Technically it should be possible - as Transmeta has done something similar, but cannot find if they got a license from Intel or it was not needed. https://en.wikipedia.org/wiki/Transmeta

It’s likely not what Apple needs, though. They probably need a solution they can maintain long enough to let the transition through, but not any longer. They’d drop support for x86 as soon as enough applications gain support and existing x86 products get dated. Maybe 5 years?

Re: Run x86 Apps (including homebrew) in the Terminal on Apple Silicon

#123
post #117
post #115

Earlier quoted context omitted.

I haven't tried this (don't have an M1 to hand!) but: iterm2 -> Preferences -> Profiles -> General Change the "Login Shell" drop down to "Command" and then enter `arch -x86_64 /usr/local/bin/zsh` or whatever your shell is.

Would `arch -x86_64 $SHELL` work?

In theory yes, since it inherits the shell env from the parent.

Haven't got the $$$ to test though.

EDIT: you could also craft an oneliner if $SHELL is not defined, something like:

`ps -T $$ | awk 'NR==2{print $NF}' | arch -x86_64 $0`

Re: Run x86 Apps (including homebrew) in the Terminal on Apple Silicon

#124
post #16

Earlier quoted context omitted.

No, not even close. There is more that doesn't work than works. Of what I use, all I got was python3 and git. But no python3.8, no ffmpeg, no erlang, no gnutls, and on and on. https://github.com/Homebrew/brew/issues/7857

There is no need of homebrew to install ffmpeg on Apple Silicon. I could just ./configure and make on the DTK. ffmpeg has so many configure options, I always avoid building it with brew.

Not all of the dependencies are ready (most notably, gnutls won't yet compile), so it would be the same result.

And for what I do, the default ffmpeg in Homebrew works fine.

Re: Run x86 Apps (including homebrew) in the Terminal on Apple Silicon

#125

I wonder if Nix on macOS could become a better homebrew-killer by supporting Apple Silicon first. We already do aarch64-linux natively and some iOS cross compilation, so that should give us a head start.

I recently began using Nix as such on my current MBP - I'm a big fan!

Re: Run x86 Apps (including homebrew) in the Terminal on Apple Silicon

#126
post #66

Earlier quoted context omitted.

Related issue[0]. I moved over from Homebrew to Nix around 5 months ago, haven't since needed to use Homebrew except for casks. [0] "Support for Apple Silicon (aarch64-darwin)" https://github.com/NixOS/nixpkgs/issues/95903

It can replace casks too, as mac apps can also be packaged in Nix.

Where can I find out how to do this?

Re: Run x86 Apps (including homebrew) in the Terminal on Apple Silicon

#127
post #42

I haven't kept up too much about how they did this. Is this ultimately just about faking uname(2) in the homebrew scripts? I would imagine Apple would make the mach-o loader transparently run rosetta when they see an x86 binary in response to execve(2). In other words, why doesn't it "just work"?

Homebrew is just Ruby, so there’s no way for macOS to independently know that it should present a fake x86 system to this particular Ruby script (or shell script). But when you run an x86 binary, it should just work like you describe.

But wouldn't it load the right ruby interpreter? And anything installed via homebrew, it would also know how to exec?

The only problem I see is if you have a mix of different architectures wrt libraries.

Re: Run x86 Apps (including homebrew) in the Terminal on Apple Silicon

#128

pkgsrc, 'the portable package manager', support Apple Silicon: http://pkgsrc.org/ No binary packages yet, but using it from source is pretty much a matter of downloading and extracting the 'current bz2', then: cd pkgrsc/bootstrap ./bootstrap --prefix=/opt/pkg The default prefix is /usr/pkg, but that's protected by macOS' SPI. You might want to add /opt/pkg/bin and sbin to your $PATH. Then to install a package: cd pkg…

Thanks so much for the comment - I was trying to do that with the stable source yesterday evening with no success. Saw your tweet too, but don't have Twitter to ask you over there.

Current source works fine

Re: Run x86 Apps (including homebrew) in the Terminal on Apple Silicon

#130

when software like brew finally becomes available on Apple Silicon natively. How can I delete all this stuff I need to download under Rosetta? I don't want to have duplicate stuff

You can replace `install.sh` in the install script with `uninstall.sh`
Post reply on HN