Hello, I'm once again trying to build the compiler, this time using ninja:
utils/build-script --skip-ios --skip-watchos --skip-tvos --skip-build-benchmarks --skip-test-cmark --swift-darwin-supported-archs "$(uname -m)" --sccache --release-debuginfo --swift-disable-dead-stripping --test
Relevant part of build log
- /opt/homebrew/bin/cmake --build /Users/simonjavora/Documents/Work/iOS/swift-project/build/Ninja-RelWithDebInfoAssert/swift-macosx-arm64 -- -j10 all swift-test-stdlib-macosx-arm64
[47/1232][ 3%][1.316s] Building CXX object lib/LLVMPasses/CMakeFiles/swiftLLVMPasses.dir/LLVMARCOpts.cpp.o
FAILED: lib/LLVMPasses/CMakeFiles/swiftLLVMPasses.dir/LLVMARCOpts.cpp.o
/opt/homebrew/bin/sccache /Users/simonjavora/Downloads/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++ -DCMARK_STATIC_DEFINE -DGTEST_HAS_RTTI=0 -DSWIFT_ENABLE_RUNTIME_FUNCTION_COUNTERS -DSWIFT_LLVM_SUPPORT_IS_AVAILABLE -D_DEBUG -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -I/Users/simonjavora/Documents/Work/iOS/swift-project/build/Ninja-RelWithDebInfoAssert/swift-macosx-arm64/lib/LLVMPasses -I/Users/simonjavora/Documents/Work/iOS/swift-project/swift/lib/LLVMPasses -I/Users/simonjavora/Documents/Work/iOS/swift-project/build/Ninja-RelWithDebInfoAssert/swift-macosx-arm64/include -I/Users/simonjavora/Documents/Work/iOS/swift-project/swift/include -I/Users/simonjavora/Documents/Work/iOS/swift-project/llvm-project/llvm/include -I/Users/simonjavora/Documents/Work/iOS/swift-project/build/Ninja-RelWithDebInfoAssert/llvm-macosx-arm64/include -I/Users/simonjavora/Documents/Work/iOS/swift-project/llvm-project/clang/include -I/Users/simonjavora/Documents/Work/iOS/swift-project/build/Ninja-RelWithDebInfoAssert/llvm-macosx-arm64/tools/clang/include -I/Users/simonjavora/Documents/Work/iOS/swift-project/cmark/src -I/Users/simonjavora/Documents/Work/iOS/swift-project/build/Ninja-RelWithDebInfoAssert/cmark-macosx-arm64/src -Wno-unknown-warning-option -Werror=unguarded-availability-new -fno-stack-protector -fPIC -fvisibility-inlines-hidden -Werror=date-time -Werror=unguarded-availability-new -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wmissing-field-initializers -Wimplicit-fallthrough -Wcovered-switch-default -Wno-class-memaccess -Wno-noexcept-type -Wnon-virtual-dtor -Wdelete-non-virtual-dtor -Wsuggest-override -Wstring-conversion -Wmisleading-indentation -fdiagnostics-color -Werror=switch -Wdocumentation -Wimplicit-fallthrough -Wunreachable-code -Woverloaded-virtual -DOBJC_OLD_DISPATCH_PROTOTYPES=0 -O2 -DNDEBUG -arch arm64 -isysroot /Users/simonjavora/Downloads/Xcode-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.0.sdk -fno-exceptions -fno-rtti -Werror=gnu -Werror=c++98-compat-extra-semi -UNDEBUG -target arm64-apple-macosx10.9 -isysroot /Users/simonjavora/Downloads/Xcode-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.0.sdk -arch arm64 -F/../../../Developer/Library/Frameworks -O2 -g -std=c++14 -MD -MT lib/LLVMPasses/CMakeFiles/swiftLLVMPasses.dir/LLVMARCOpts.cpp.o -MF lib/LLVMPasses/CMakeFiles/swiftLLVMPasses.dir/LLVMARCOpts.cpp.o.d -o lib/LLVMPasses/CMakeFiles/swiftLLVMPasses.dir/LLVMARCOpts.cpp.o -c /Users/simonjavora/Documents/Work/iOS/swift-project/swift/lib/LLVMPasses/LLVMARCOpts.cpp
In file included from /Users/simonjavora/Documents/Work/iOS/swift-project/swift/lib/LLVMPasses/LLVMARCOpts.cpp:21:
/Users/simonjavora/Documents/Work/iOS/swift-project/swift/lib/LLVMPasses/ARCEntryPointBuilder.h:256:25: error: no member named 'addFnAttribute' in 'llvm::AttributeList'
AttrList = AttrList.addFnAttribute(M.getContext(), Attribute::NoUnwind);
~~~~~~~~ ^
1 error generated.
[48/1232][ 3%][1.333s] Building CXX object lib/LLVMPasses/CMakeFiles/swiftLLVMPasses.dir/LLVMARCContract.cpp.o
FAILED: lib/LLVMPasses/CMakeFiles/swiftLLVMPasses.dir/LLVMARCContract.cpp.o
/opt/homebrew/bin/sccache /Users/simonjavora/Downloads/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++ -DCMARK_STATIC_DEFINE -DGTEST_HAS_RTTI=0 -DSWIFT_ENABLE_RUNTIME_FUNCTION_COUNTERS -DSWIFT_LLVM_SUPPORT_IS_AVAILABLE -D_DEBUG -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -I/Users/simonjavora/Documents/Work/iOS/swift-project/build/Ninja-RelWithDebInfoAssert/swift-macosx-arm64/lib/LLVMPasses -I/Users/simonjavora/Documents/Work/iOS/swift-project/swift/lib/LLVMPasses -I/Users/simonjavora/Documents/Work/iOS/swift-project/build/Ninja-RelWithDebInfoAssert/swift-macosx-arm64/include -I/Users/simonjavora/Documents/Work/iOS/swift-project/swift/include -I/Users/simonjavora/Documents/Work/iOS/swift-project/llvm-project/llvm/include -I/Users/simonjavora/Documents/Work/iOS/swift-project/build/Ninja-RelWithDebInfoAssert/llvm-macosx-arm64/include -I/Users/simonjavora/Documents/Work/iOS/swift-project/llvm-project/clang/include -I/Users/simonjavora/Documents/Work/iOS/swift-project/build/Ninja-RelWithDebInfoAssert/llvm-macosx-arm64/tools/clang/include -I/Users/simonjavora/Documents/Work/iOS/swift-project/cmark/src -I/Users/simonjavora/Documents/Work/iOS/swift-project/build/Ninja-RelWithDebInfoAssert/cmark-macosx-arm64/src -Wno-unknown-warning-option -Werror=unguarded-availability-new -fno-stack-protector -fPIC -fvisibility-inlines-hidden -Werror=date-time -Werror=unguarded-availability-new -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wmissing-field-initializers -Wimplicit-fallthrough -Wcovered-switch-default -Wno-class-memaccess -Wno-noexcept-type -Wnon-virtual-dtor -Wdelete-non-virtual-dtor -Wsuggest-override -Wstring-conversion -Wmisleading-indentation -fdiagnostics-color -Werror=switch -Wdocumentation -Wimplicit-fallthrough -Wunreachable-code -Woverloaded-virtual -DOBJC_OLD_DISPATCH_PROTOTYPES=0 -O2 -DNDEBUG -arch arm64 -isysroot /Users/simonjavora/Downloads/Xcode-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.0.sdk -fno-exceptions -fno-rtti -Werror=gnu -Werror=c++98-compat-extra-semi -UNDEBUG -target arm64-apple-macosx10.9 -isysroot /Users/simonjavora/Downloads/Xcode-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.0.sdk -arch arm64 -F/../../../Developer/Library/Frameworks -O2 -g -std=c++14 -MD -MT lib/LLVMPasses/CMakeFiles/swiftLLVMPasses.dir/LLVMARCContract.cpp.o -MF lib/LLVMPasses/CMakeFiles/swiftLLVMPasses.dir/LLVMARCContract.cpp.o.d -o lib/LLVMPasses/CMakeFiles/swiftLLVMPasses.dir/LLVMARCContract.cpp.o -c /Users/simonjavora/Documents/Work/iOS/swift-project/swift/lib/LLVMPasses/LLVMARCContract.cpp
In file included from /Users/simonjavora/Documents/Work/iOS/swift-project/swift/lib/LLVMPasses/LLVMARCContract.cpp:15:
/Users/simonjavora/Documents/Work/iOS/swift-project/swift/lib/LLVMPasses/ARCEntryPointBuilder.h:256:25: error: no member named 'addFnAttribute' in 'llvm::AttributeList'
AttrList = AttrList.addFnAttribute(M.getContext(), Attribute::NoUnwind);
~~~~~~~~ ^
1 error generated.
[50/1232][ 4%][1.514s] Building CXX object lib/LLVMPasses/CMakeFiles/swiftLLVMPasses.dir/LLVMMergeFunctions.cpp.o
FAILED: lib/LLVMPasses/CMakeFiles/swiftLLVMPasses.dir/LLVMMergeFunctions.cpp.o
/opt/homebrew/bin/sccache /Users/simonjavora/Downloads/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++ -DCMARK_STATIC_DEFINE -DGTEST_HAS_RTTI=0 -DSWIFT_ENABLE_RUNTIME_FUNCTION_COUNTERS -DSWIFT_LLVM_SUPPORT_IS_AVAILABLE -D_DEBUG -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -I/Users/simonjavora/Documents/Work/iOS/swift-project/build/Ninja-RelWithDebInfoAssert/swift-macosx-arm64/lib/LLVMPasses -I/Users/simonjavora/Documents/Work/iOS/swift-project/swift/lib/LLVMPasses -I/Users/simonjavora/Documents/Work/iOS/swift-project/build/Ninja-RelWithDebInfoAssert/swift-macosx-arm64/include -I/Users/simonjavora/Documents/Work/iOS/swift-project/swift/include -I/Users/simonjavora/Documents/Work/iOS/swift-project/llvm-project/llvm/include -I/Users/simonjavora/Documents/Work/iOS/swift-project/build/Ninja-RelWithDebInfoAssert/llvm-macosx-arm64/include -I/Users/simonjavora/Documents/Work/iOS/swift-project/llvm-project/clang/include -I/Users/simonjavora/Documents/Work/iOS/swift-project/build/Ninja-RelWithDebInfoAssert/llvm-macosx-arm64/tools/clang/include -I/Users/simonjavora/Documents/Work/iOS/swift-project/cmark/src -I/Users/simonjavora/Documents/Work/iOS/swift-project/build/Ninja-RelWithDebInfoAssert/cmark-macosx-arm64/src -Wno-unknown-warning-option -Werror=unguarded-availability-new -fno-stack-protector -fPIC -fvisibility-inlines-hidden -Werror=date-time -Werror=unguarded-availability-new -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wmissing-field-initializers -Wimplicit-fallthrough -Wcovered-switch-default -Wno-class-memaccess -Wno-noexcept-type -Wnon-virtual-dtor -Wdelete-non-virtual-dtor -Wsuggest-override -Wstring-conversion -Wmisleading-indentation -fdiagnostics-color -Werror=switch -Wdocumentation -Wimplicit-fallthrough -Wunreachable-code -Woverloaded-virtual -DOBJC_OLD_DISPATCH_PROTOTYPES=0 -O2 -DNDEBUG -arch arm64 -isysroot /Users/simonjavora/Downloads/Xcode-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.0.sdk -fno-exceptions -fno-rtti -Werror=gnu -Werror=c++98-compat-extra-semi -UNDEBUG -target arm64-apple-macosx10.9 -isysroot /Users/simonjavora/Downloads/Xcode-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.0.sdk -arch arm64 -F/../../../Developer/Library/Frameworks -O2 -g -std=c++14 -MD -MT lib/LLVMPasses/CMakeFiles/swiftLLVMPasses.dir/LLVMMergeFunctions.cpp.o -MF lib/LLVMPasses/CMakeFiles/swiftLLVMPasses.dir/LLVMMergeFunctions.cpp.o.d -o lib/LLVMPasses/CMakeFiles/swiftLLVMPasses.dir/LLVMMergeFunctions.cpp.o -c /Users/simonjavora/Documents/Work/iOS/swift-project/swift/lib/LLVMPasses/LLVMMergeFunctions.cpp
/Users/simonjavora/Documents/Work/iOS/swift-project/swift/lib/LLVMPasses/LLVMMergeFunctions.cpp:1291:36: error: no member named 'getParamAttrs' in 'llvm::AttributeList'
NewArgAttrs.push_back(NewPAL.getParamAttrs(ParamIdx));
~~~~~~ ^
/Users/simonjavora/Documents/Work/iOS/swift-project/swift/lib/LLVMPasses/LLVMMergeFunctions.cpp:1318:52: error: no member named 'getRetAttrs' in 'llvm::AttributeList'
NewPAL.getRetAttrs(),
~~~~~~ ^
2 errors generated.
[56/1232][ 4%][4.325s] Building CXX object lib/Localization/CMakeFiles/swiftLocalization.dir/LocalizationFormat.cpp.o
ninja: build stopped: subcommand failed.
ERROR: command terminated with a non-zero exit status 1, aborting
The first error seems to be
/Users/simonjavora/Documents/Work/iOS/swift-project/swift/lib/LLVMPasses/ARCEntryPointBuilder.h:256:25: error: no member named 'addFnAttribute' in 'llvm::AttributeList'
AttrList = AttrList.addFnAttribute(M.getContext(), Attribute::NoUnwind);
~~~~~~~~ ^
I haven't seen this error around anywhere, so no idea what it could even mean. I am using the Xcode version found on ci.swift.org on an M1 Pro. Can anybody help?
More on frustration with building the compiler
From my point of view, getting the compiler to even build is a big barrier to entry for newcomers (hi!). As an iOS developer, I'm quite used to Xcode, so obviously I wanted to use the --xcode
option at first. I've never been able to successfully build the compiler that way and I'm starting to wonder whether it works for anyone.
There is at least one post that suggest that using ninja is preferred anyway, but if that's the case, I don't understand why the --xcode
option is even offered... threads about build errors with this option come up fairly often (1, 2, 3), libswift isn't available when building with --xcode
, which I was very interested in since it meant being able to write Swift and not C++, etc...
It is demotivating to set aside the free time and disk space to try to learn enough of the compiler to be able to contribute only to be stopped before the I can even get started.