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

Homebrew and Apple Silicone (M1) #88

Open
rafo opened this issue Oct 1, 2022 · 19 comments
Open

Homebrew and Apple Silicone (M1) #88

rafo opened this issue Oct 1, 2022 · 19 comments
Labels
Funding needed help wanted Extra attention is needed

Comments

@rafo
Copy link

rafo commented Oct 1, 2022

Nice Project!

I finished a Homebrew Cask for Betterbird but didn't push it to the Homebrew repo since there is no Apple Silicone version of BB. Are there any plans or options for a M1 build?

@Betterbird
Copy link
Owner

Not really, unless someone funds it. We're doing the Intel build on a loaned Mac book which can disappear any minute. That was initially termed "experimental", and it's not notarised either. Apparently you can get Mac M1 in the cloud. https://aws.amazon.com/ec2/instance-types/mac/.

@Betterbird Betterbird added help wanted Extra attention is needed Funding needed labels Oct 1, 2022
@rafo
Copy link
Author

rafo commented Oct 1, 2022

Thanx for the quick reply. It would be a shame if this project for the Apple and Homebrew community failed because of this. Maybe I could help or compile it myself?  

@Betterbird
Copy link
Owner

What help did you have in mind? At a guess, we should compile the binaries we distribute yourselves. You have an M1/2 machine? Did you compile there successfully?

@rafo
Copy link
Author

rafo commented Oct 1, 2022

I could compile it myself on a M1, but didn't try it right now. I skimmed through your build.sh and https://firefox-source-docs.mozilla.org/setup/macos_build.html, and it didn't seem too complicated, but maybe that's just naïve.

@seanbperiod
Copy link

With no updates for 7+ months - just wondering if anyone has been able to successfully build a version with native Apple Silicon support? (if so, could you post a link? 😅)

@Betterbird
Copy link
Owner

We don't have the hardware, and BTW, the Intel Mac we use to compile is only on loan and can be withdrawn any day. Other than that, compiling shouldn't be a problem. It could even be done in the cloud via AWS:
https://aws.amazon.com/ec2/instance-types/mac/
If we read the linked pricing page https://aws.amazon.com/ec2/dedicated-hosts/pricing/ correctly, a Mac2 service is necessary (Mac1 being Intel based). As a dedicated host that costs $0.716 per hour with a 24 hour minimum, so $17 per build. Getting a beefy Linux machine in the cloud for an hour is around 50 Eurocent in comparison.

Last we checked, only 2% of users were on Mac, unclear how many of those were on M1/M2.

@rafo
Copy link
Author

rafo commented May 10, 2023

Last we checked, only 2% of users were on Mac, unclear how many of those were on M1/M2.

This is sometimes a chicken-and-egg problem. 🐔 But I understand your point of view.

@Betterbird
Copy link
Owner

We will use GitHub actions soon (#173). According to
#173 (comment)
this will be supported from Q3 2023.

@Arecsu
Copy link

Arecsu commented Oct 25, 2023

@Betterbird
Copy link
Owner

Thanks for letting us know. Sadly, building on Mac only works for the "full build from repo", not the "reduced build from source tarball" which we prefer, see Issue #175.

Upstream report here:
https://bugzilla.mozilla.org/show_bug.cgi?id=1847288#c1

They did answer here:
https://bugzilla.mozilla.org/show_bug.cgi?id=1847288#c2
Thanks for the info. Maby you can try disabling sccache on mac?

@sagudev could you look into it again?

@wrapper
Copy link

wrapper commented Dec 15, 2023

Just here to throw my hat in, would love to see apple silicon builds

@Betterbird
Copy link
Owner

Sure, see the comment before yours.

@shaul-pollak
Copy link

So I tried compiling on an M2 mac. In mozconfig-Mac I changed/added:
ac_add_options --target=aarch64-apple-darwin #changed
ac_add_options --host=aarch64-apple-darwin #added, not sure this is needed

Building fails with:
0:06.81 DEBUG: Executing: /Users/<>/.mozbuild/sccache/sccache /usr/bin/clang -isysroot /Users/<>/.mozbuild/MacOSX13.3.sdk -mmacosx-version-min=11.0 -std=gnu99 --target=arm64-apple-darwin -Wl,--version
0:06.81 ERROR: Failed to find an adequate linker

Any idea what can be done? ld does not support --version on mac

@sagudev
Copy link
Contributor

sagudev commented Jan 26, 2024

We got same thing in mozjs, one solution is to set default linker to lld-classic or to clang's lld or apply this patch: https://github.com/servo/mozjs/blob/main/mozjs-sys/etc/patches/0029-fix-ld64-detection.patch

@shaul-pollak
Copy link

changed to clangd's lld. works. Thanks @sagudev

@Betterbird
Copy link
Owner

We got same thing in mozjs, one solution is to set default linker to lld-classic or to clang's lld or apply this patch:

Has that been reported upstream at Mozilla. They build FF/TB for M1/M2, so why don't they have the issue? Or are they doing only cross-compiles for Mac on Linux?

@sagudev
Copy link
Contributor

sagudev commented Jan 26, 2024

Mozilla is using their own toolchains (clang) using mach. I planned to upstream https://github.com/servo/mozjs/blob/main/mozjs-sys/etc/patches/0029-fix-ld64-detection.patch but I forgot. I will open bug and fix later today.

@sagudev
Copy link
Contributor

sagudev commented Jan 26, 2024

Found relevant bug: https://bugzilla.mozilla.org/show_bug.cgi?id=1871153

@Betterbird
Copy link
Owner

Thanks. Maybe we should just add the patch to the project, I guess it won't break the other builds 😉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Funding needed help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

7 participants