browser icon indicating copy to clipboard operation
browser copied to clipboard

M1 arm64 MacOS Build

Open mobedoor opened this issue 2 years ago • 7 comments

Hello. I'd like to request arm64 builds for the M1/M2 architecture. Thank you.

mobedoor avatar Aug 13 '23 06:08 mobedoor

I do not have an m# device to test / use. I am open to accepting a PR with m1 cross compiling.

trickypr avatar Aug 16 '23 01:08 trickypr

We need CI setup for automated builds. Again, I would be happy to accept a PR that adds it to alpha.yml.

trickypr avatar Oct 27 '23 23:10 trickypr

What can we do to fix this

Machine:- M1Pro Mac OSX OS - MacOS Sonoma

00:00:01 checking for vcs source checkout... git
00:00:01 checking for a shell... /bin/sh
00:00:01 checking for host system type... aarch64-apple-darwin23.0.0
00:00:01 checking for target system type... aarch64-apple-darwin23.0.0
00:00:01 checking whether cross compiling... no
00:00:01 checking for Python 3... /Users/ameyhk/.mozbuild/srcdirs/engine-63b365b29506/_virtualenvs/build/bin/python (3.9.6)
00:00:01 checking for git... /opt/local/bin/git
00:00:01 checking for Git version... 2.42.0
00:00:01 checking for sparse checkout... no
00:00:01 checking for wget... not found
00:00:01 checking for ccache... not found
00:00:01 Using target sysroot in /Users/ameyhk/.mozbuild/MacOSX14.0.sdk
00:00:01 Using host sysroot in /Users/ameyhk/.mozbuild/MacOSX14.0.sdk
00:00:01 checking for the target C compiler... /usr/bin/clang
00:00:04 checking whether the target C compiler can be used... yes
00:00:04 checking the target C compiler version... 14.0.0.or.more
00:00:04 checking the target C compiler works... yes
00:00:04 checking for the target C++ compiler... /usr/bin/clang++
00:00:04 checking whether the target C++ compiler can be used... yes
00:00:04 checking the target C++ compiler version... 14.0.0.or.more
00:00:04 checking the target C++ compiler works... yes
00:00:04 checking for the host C compiler... /usr/bin/clang
00:00:04 checking whether the host C compiler can be used... yes
00:00:04 checking the host C compiler version... 14.0.0.or.more
00:00:04 checking the host C compiler works... yes
00:00:04 checking for the host C++ compiler... /usr/bin/clang++
00:00:04 checking whether the host C++ compiler can be used... yes
00:00:04 checking the host C++ compiler version... 14.0.0.or.more
00:00:04 checking the host C++ compiler works... yes
00:00:05 checking for target linker...
00:00:05 DEBUG: Executing: `/usr/bin/clang -isysroot /Users/ameyhk/.mozbuild/MacOSX14.0.sdk -mmacosx-version-min=11.0 -std=gnu99 --target=arm64-apple-darwin -Wl,--version`
00:00:05 ERROR: Failed to find an adequate linker
00:00:05  Config object not found by mach.
00:00:05 *** Fix above errors and then restart with "./mach build"

00:00:05 Total build time: 5 seconds.
✨  Done in 6.07s.` 

arcoirislabs avatar Oct 28 '23 10:10 arcoirislabs

You are missing a linker. I presume this is still distributed as some part of XCode, but I don't have a (modern) mac to debug.

trickypr avatar Oct 29 '23 09:10 trickypr

We were able to fix it. We simply used gluon cmd to create a new project and imported all the patches and ran gluon build. We are able to build now for M1 ARM

Steps

  1. gluon setup-project. Select Firefox stable
  2. Copy the gluon.json in the directory. Also replace the src and configs
  3. For first time, run gluon download && gluon bootstrap && gluon import
  4. For subsequent builds run gluon build && gluon build --ui
  5. Then run gluon run

Cheers!!

arcoirislabs avatar Oct 31 '23 10:10 arcoirislabs

We were able to fix it. We simply used gluon cmd to create a new project and imported all the patches and ran gluon build. We are able to build now for M1 ARM

Steps

1. `gluon setup-project`. Select Firefox stable

2. Copy the gluon.json in the directory. Also replace the src and configs

3. For first time, run `gluon download && gluon bootstrap && gluon import`

4. For subsequent builds run `gluon build && gluon build --ui`

5. Then run `gluon run`

Cheers!!

Whilst I appreciate the steps, we need a functional CI for building MacOS build. Please feel free to create a pr updating .github/workflows/alpha.yml to add a build for MacOS.

trickypr avatar Nov 06 '23 05:11 trickypr

@arcoirislabs can you explain further? I'm trying to build on an M1 mac, and struggling to follow your steps.

asleepynerd avatar May 29 '24 13:05 asleepynerd