Compiler build fails (Multiple commands)

I have just forked and cloned master and tried running the build script with the following parameters.

./utils/build-script --release-debuginfo --xcode --clean

I'm getting this error.

Build system information
error: Multiple commands produce '/Users/myuser/workspace/swift-source/build/Xcode-    RelWithDebInfoAssert/swift-macosx-x86_64/RelWithDebInfo/lib/libBlocksRuntime.dylib':
1) Target 'BlocksRuntimeStub-macosx-arm64' has link command with output '/Users/myuser/workspace/swift-source/build/Xcode-RelWithDebInfoAssert/swift-macosx-x86_64/RelWithDebInfo/lib/libBlocksRuntime.dylib'
2) Target 'BlocksRuntimeStub-macosx-arm64e' has link command with output '/Users/myuser/workspace/swift-source/build/Xcode-RelWithDebInfoAssert/swift-macosx-x86_64/RelWithDebInfo/lib/libBlocksRuntime.dylib'
3) Target 'BlocksRuntimeStub-macosx-x86_64' has link command with output '/Users/myuser/workspace/swift-source/build/Xcode-RelWithDebInfoAssert/swift-macosx-x86_64/RelWithDebInfo/lib/libBlocksRuntime.dylib'

This is what I'm using:

  • M1
  • Xcode 12.3
  • cmake version 3.19.4
  • ninja 1.10.2

Any help would be welcome

That seems like a bug. Can you try adding --swift-darwin-supported-archs="$(uname -m)" and see if that fixes the issue? (Also, you may want to see the Getting Started guide in case you haven't already.)

Following the getting started guide and doing

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

I'm getting this error

    /Users/myuser/workspace/swift-source/swift/lib/LLVMPasses/LLVMMergeFunctions.cpp:686:54: error: no member named 'AArch64SubArch_E' in 'llvm::Triple'; did you mean
      'AArch64SubArch_arm64e'?
    ptrAuthEnabled = (triple.getSubArch() == Triple::AArch64SubArch_E);
                                             ~~~~~~~~^~~~~~~~~~~~~~~~
                                                     AArch64SubArch_arm64e
In file included from /Users/myuser/workspace/swift-source/swift/lib/LLVMPasses/LLVMMergeFunctions.cpp:42:
/Users/myuser/workspace/swift-source/llvm-project/llvm/include/llvm/ADT/Triple.h:134:5: note: 'AArch64SubArch_arm64e' declared here
    AArch64SubArch_arm64e,
    ^
1 error generated.

If I clean the build folder and run

./utils/build-script --release-debuginfo --swift-darwin-supported-archs="$(uname -m)" --Xcode

I'll get this...

The following build commands failed:
	CompileC /Users/eduardodias/workspace/swift-source/build/Xcode-RelWithDebInfoAssert/swift-macosx-x86_64/lib/LLVMPasses/Swift.build/RelWithDebInfo/swiftLLVMPasses.build/Objects-normal/x86_64/LLVMMergeFunctions.o /Users/eduardodias/workspace/swift-source/swift/lib/LLVMPasses/LLVMMergeFunctions.cpp normal x86_64 c++ com.apple.compilers.llvm.clang.1_0.compiler
(1 failure)
ERROR: command terminated with a non-zero exit status 65, aborting

Should I raise a ticket for that @Varun_Gandhi ?