./utils/build-toolchain $BUNDLE_PREFIX fails

Hi all,

I'm trying to make a swift toolchain with the following command: ./utils/build-toolchain $BUNDLE_PREFIX. It goes on for a while, before it exits with an error code, I include the error message at the bottom.

Is anyone able to help?

Cheers
Marcel

FAILED: source/Symbol/CMakeFiles/lldbSymbol.dir/SwiftASTContext.cpp.o
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++ -DGTEST_HAS_RTTI=0 -DHAVE_ROUND -DLIBXML2_DEFINED -DLLDB_CONFIGURATION_RELEASE -DLLDB_USE_OS_LOG -D_DEBUG -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -Isource/Symbol -I/Users/bubulkowanorka/projects/swift-source/lldb/source/Symbol -Iinclude -I/Users/bubulkowanorka/projects/swift-source/lldb/include -I/Users/bubulkowanorka/projects/swift-source/llvm/include -I/Users/bubulkowanorka/projects/swift-source/build/buildbot_osx/llvm-macosx-x86_64/include -I/Users/bubulkowanorka/projects/swift-source/llvm/tools/clang/include -I/Users/bubulkowanorka/projects/swift-source/build/buildbot_osx/llvm-macosx-x86_64/tools/clang/include -I/Users/bubulkowanorka/projects/swift-source/build/buildbot_osx/swift-macosx-x86_64/include -I/Users/bubulkowanorka/projects/swift-source/swift/include -I/Users/bubulkowanorka/projects/swift-source/lldb/source -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/usr/include/python2.7 -I/Users/bubulkowanorka/projects/swift-source/lldb/tools/clang/include -I../clang/include -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/usr/include/libxml2 -I/Users/bubulkowanorka/projects/swift-source/lldb/source/. -fPIC -fvisibility-inlines-hidden -Werror=date-time -Werror=unguarded-availability-new -std=c++11 -w -fdiagnostics-color -Wno-deprecated-declarations -Wno-unknown-pragmas -Wno-strict-aliasing -Wno-deprecated-register -Wno-vla-extension -O3 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk -UNDEBUG -fno-exceptions -fno-rtti -Wno-dollar-in-identifier-extension -MD -MT source/Symbol/CMakeFiles/lldbSymbol.dir/SwiftASTContext.cpp.o -MF source/Symbol/CMakeFiles/lldbSymbol.dir/SwiftASTContext.cpp.o.d -o source/Symbol/CMakeFiles/lldbSymbol.dir/SwiftASTContext.cpp.o -c /Users/bubulkowanorka/projects/swift-source/lldb/source/Symbol/SwiftASTContext.cpp
/Users/bubulkowanorka/projects/swift-source/lldb/source/Symbol/SwiftASTContext.cpp:582:34: error: no member named 'enumerateSetBits' in 'swift::ClusteredBitVector'
auto enumerator = m_tag_bits.enumerateSetBits();
~~~~~~~~~~ ^
/Users/bubulkowanorka/projects/swift-source/lldb/source/Symbol/SwiftASTContext.cpp:1309:38: error: no member named 'MissingShadowedModule' in 'swift::serialization::Status'
case swift::serialization::Status::MissingShadowedModule:
~~~~~~~~~~~~~~~~~~~~~~~~~~^
/Users/bubulkowanorka/projects/swift-source/lldb/source/Symbol/SwiftASTContext.cpp:3012:40: error: allocating an object of abstract class type 'lldb_private::StoringDiagnosticConsumer'
m_diagnostic_consumer_ap.reset(new StoringDiagnosticConsumer(*this));
^
/Users/bubulkowanorka/projects/swift-source/swift/include/swift/AST/DiagnosticConsumer.h:106:3: note: unimplemented pure virtual method 'handleDiagnostic' in 'StoringDiagnosticConsumer'
handleDiagnostic(SourceManager &SM, SourceLoc Loc, DiagnosticKind Kind,
^
/Users/bubulkowanorka/projects/swift-source/lldb/source/Symbol/SwiftASTContext.cpp:3866:38: error: non-const lvalue reference to type 'swift::MemoryBufferSerializedModuleLoader' cannot bind to a value of unrelated type 'swift::SerializedModuleLoader *'
if (swift::parseASTSection(sml, section_data_ref, llvm_modules)) {
^

/Users/bubulkowanorka/projects/swift-source/swift/include/swift/ASTSectionImporter/ASTSectionImporter.h:32:60: note: passing argument to parameter 'Loader' here
bool parseASTSection(MemoryBufferSerializedModuleLoader &Loader,
^
/Users/bubulkowanorka/projects/swift-source/lldb/source/Symbol/SwiftASTContext.cpp:3902:40: error: non-const lvalue reference to type 'swift::MemoryBufferSerializedModuleLoader' cannot bind to a value of unrelated type 'swift::SerializedModuleLoader *'
if (swift::parseASTSection(sml, section_data_ref, swift_modules)) {
^

/Users/bubulkowanorka/projects/swift-source/swift/include/swift/ASTSectionImporter/ASTSectionImporter.h:32:60: note: passing argument to parameter 'Loader' here
bool parseASTSection(MemoryBufferSerializedModuleLoader &Loader,
^
/Users/bubulkowanorka/projects/swift-source/lldb/source/Symbol/SwiftASTContext.cpp:8301:67: error: no member named 'All' in 'swift::OptionSet<swift::ModuleDecl::ImportFilterKind, unsigned int>'
swift::ModuleDecl::ImportFilter::All);
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
6 errors generated.

What type of toolchain are you trying to build? master, 5.1, etc?

I would make sure you are using the correct set of corresponding sources.

Can you try this:

./swift/utils/update-checkout --scheme swift-5.1-branch --reset-to-remote --clone

That should give you a clean 5.1 setup with all of the right branches/tags/etc. Then try build-toolchain.

1 Like

To be a little more specific, that sounds like your LLDB sources are out of sync with your Swift sources. A regular utils/update-checkout (no arguments) can help bring everything back in sync on your current branches, at the cost of probably needing to build everything again.

1 Like

Hey guys,

That was the problem indeed! Running utils/update-checkout --clone fixed the issue. Thanks a bunch!