Failed to build main branch on Apple M1
- Dominant language
- C++
- Stars
- 30.5k
- Forks
- 5.9k
- PR merge metrics
- No merged PRs in 30d
Description
Hello folks,
I'm having a build failure when trying to build the main branch on an Apple M1 computer, build fails with message:
```
ninja: build stopped: subcommand failed.
Command '['/opt/homebrew/opt/cmake/bin/cmake', '--build', '/private/var/folders/m0/t9vnf_6x66xgspg0gbjvwp700000gn/T/fbcode_builder_getdeps-ZUsersZsergiolemosZLibraryZMobile DocumentsZcom~apple~CloudDocsZstudiesZcppZfollyZbuildZfbcode_builder/build/folly', '--target', 'install', '--config', 'Release', '-j', '10']' returned non-zero exit status 1.
!! Failed
```
The actual error seems to be:
```
In file included from /Users/sergiolemos/Library/Mobile Documents/com~apple~CloudDocs/studies/cpp/folly/folly/experimental/test/EliasFanoCodingTest.cpp:25:
/Users/sergiolemos/Library/Mobile Documents/com~apple~CloudDocs/studies/cpp/folly/folly/experimental/EliasFanoCoding.h:43:2: error: EliasFanoCoding.h requires x86_64
#error EliasFanoCoding.h requires x86_64
^
2 warnings and 1 error generated.
```
Which comes from here: https://github.com/facebook/folly/blob/1f2e92bf1a36a020157a366d48e52c720c669606/folly/experimental/EliasFanoCoding.h#L42
Installing Folly from `brew` works correctly. My system is:
```
uname -a
Darwin New-MacBook-Pro.local 21.3.0 Darwin Kernel Version 21.3.0: Wed Jan 5 21:37:58 PST 2022; root:xnu-8019.80.24~20/RELEASE_ARM64_T6000 arm64
```
I've tried to search previous issues with this same message, but could not find any. Is it a known compatibility issue with Apple M1 architecture? Is there any known mitigation to allow building from source ?
Much appreciate the time.
Contributor guide
Research direction
Start with folly/experimental/EliasFanoCoding.h at the x86_64 guard and folly/experimental/test/EliasFanoCodingTest.cpp, then reproduce the reported CMake build on an Apple M1. Check how this source build handles the architecture and verify completion when the main branch builds successfully on arm64 without this error.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cmake, cpp, macos
- Domain
- build-system, operating-systems
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100