M1 Build Failure (Xcode)

I have successfully cloned the swift repo locally with:

mdkir swift-project && cd swift-project
git clone git@github.com:apple/swift.git swift
cd swift
utils/update-checkout --clone-with-ssh

I satisfy all the dependency requirements: cmake, python3, ninja and sccache 0.2.13, Xcode 13.2.1.

But now, I am unable to build the repo using:

utils/build-script --skip-build-benchmarks \
  --skip-ios --skip-watchos --skip-tvos --swift-darwin-supported-archs "$(uname -m)" \
  --sccache --release-debuginfo --swift-disable-dead-stripping --test \

I hope you can help me identify what is going wrong: Swift OS Repo Build output ยท GitHub

It looks like several tests have failed in the LastTest.log. Thanks

Great news!! I feel like a real compiler hacker now :sunglasses:.

I resolved the build issues using advice from this thread: Building Swift compiler from source fails when not using Ninja - #16 by ksluder and Build failure on Apple Silicon M1 Mac Mini - #9 by hpwooten.

While I couldn't get the build to pass with the --test flag, I discovered that there's a live Swift bug re: the getting started steps for this exact error message! - Issue Navigator - Swift

The main culprit was my python3 binary was x86-64 rather than arm64. I also had to use the --bootstrapping=off flag as suggested in the above thread.


1 Like