Closed Bug 1704126 Opened 3 years ago Closed 3 years ago

mach bootstrap on M1 fails with "killed: 9"

Categories

(Firefox Build System :: Bootstrap Configuration, defect)

ARM64
macOS
defect

Tracking

(firefox89 fixed)

RESOLVED FIXED
89 Branch
Tracking Status
firefox89 --- fixed

People

(Reporter: lth, Assigned: glandium)

Details

Attachments

(2 files)

I followed these instructions: https://docs.google.com/document/d/1N5yfEVEISofMmjAxfj3xXONGwyQYBSilsfXqux_M6TM/edit?usp=sharing. Since I had followed older instructions, I uninstalled rust as explained. I then tried to bootstrap in my (updated, but not clean) tree. Mach quits with "Killed: 9".

Reinstalling rust does not fix the problem, FWIW.

A few questions for you:

  • Can you post the log? Perhaps there's information that will help determine the failure cause in the log.
  • Can you reproduce the failure on a clean central?
  • What's in your mozconfig?
Flags: needinfo?(lhansen)
Attached file log

I am having the same issue.

Seems that there needs to be a os check for M1 Macs built into one of the scripts that mach bootstrap calls.

I am continuing to search for it, but have yet to find it.

I fixed this issue by individually running the following commands:

'brew install terminal-notifier'
'brew install watchman'
'brew install gnu-tar'

After that, './mach bootstrap' works perfectly.

Thanks! I did the same, but with an interesting wrinkle: I already had watchman installed, and in order to get bootstrap to work I had to 'brew reinstall watchman', ie, something was not right about that package.

Flags: needinfo?(lhansen)

Glandium, you're more familiar with M1 Macs than me - do you have a better idea of what's going on here?

Flags: needinfo?(mh+mozilla)

Your python is x86-64, not arm64. If it were arm64, it wouldn't try to install stuff from homebrew at all. We should detect this situation, since, other than causing these sorts of problems, it has a huge impact on build times.

Flags: needinfo?(mh+mozilla)

Weird, since all the pythons seem to have an arm64 personality:

$ file /usr/bin/python
/usr/bin/python: Mach-O universal binary with 2 architectures: [x86_64:Mach-O 64-bit executable x86_64] [arm64e:Mach-O 64-bit executable arm64e]
/usr/bin/python (for architecture x86_64):	Mach-O 64-bit executable x86_64
/usr/bin/python (for architecture arm64e):	Mach-O 64-bit executable arm64e

$ file /usr/bin/python2
/usr/bin/python2: Mach-O universal binary with 2 architectures: [x86_64:Mach-O 64-bit executable x86_64] [arm64e:Mach-O 64-bit executable arm64e]
/usr/bin/python2 (for architecture x86_64):	Mach-O 64-bit executable x86_64
/usr/bin/python2 (for architecture arm64e):	Mach-O 64-bit executable arm64e

$ file /opt/homebrew/bin/python3
/opt/homebrew/bin/python3: Mach-O 64-bit executable arm64

Does which python3 point to one of those?

(In reply to Mike Hommey [:glandium] from comment #11)

Does which python3 point to one of those?

Yes, it does:

$ which python3
/opt/homebrew/bin/python3
$ ls -l /opt/homebrew/bin/python3
lrwxr-xr-x  1 lhansen  admin  38 Apr 12 08:54 /opt/homebrew/bin/python3 -> ../Cellar/python@3.9/3.9.4/bin/python3
$ file /opt/homebrew/bin/python3
/opt/homebrew/bin/python3: Mach-O 64-bit executable arm64

Then I guess your tree is old?

(In reply to Mike Hommey [:glandium] from comment #13)

Then I guess your tree is old?

It shouldn't be, because I updated on Friday last week in order to do some testing. It was old before that, I had probably not updated in several weeks (not primary dev system). I noticed the build instructions had changed, so ...

What does python3 -c "import platform; print(platform.machine())" say?

Flags: needinfo?(lhansen)

(In reply to Mike Hommey [:glandium] from comment #15)

What does python3 -c "import platform; print(platform.machine())" say?

$ python3 -c "import platform; print(platform.machine())"
arm64
Flags: needinfo?(lhansen)

As per discussion on Matrix yesterday, it's not clear what was wrong but it works now, and it must have been a stale x86-64 python. I'll make bootstrap fail if it's run with an emulated python.

Assignee: nobody → mh+mozilla
Status: NEW → ASSIGNED
Pushed by mh@glandium.org:
https://hg.mozilla.org/integration/autoland/rev/fb11e35d4f73
Make mach create-mach-environment fail when running under Rosetta. r=firefox-build-system-reviewers,mhentges
Pushed by nerli@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/ffc825cc89d2
Fix lint failure r=fix CLOSED TREE
Status: ASSIGNED → RESOLVED
Closed: 3 years ago
Resolution: --- → FIXED
Target Milestone: --- → 89 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: