So, how exactly do you compile the compiler?

it’s been almost two weeks since the stack corruption bugs were fixed, but for whatever reason, there have not been any nightly toolchains posted to swift.org containing the fix.

this is still a blocker for me, so i’ve been looking into building the swift compiler locally. however, the instructions on github seem out of date. i can only get as far as the

$ ./swift/utils/build-toolchain $BUNDLE_PREFIX

command in the README, which fails with

--- Building earlyswiftdriver ---
+ swift/swift-driver/Utilities/build-script-helper.py build --package-path swift/swift-driver --build-path swift/build/buildbot_linux/earlyswiftdriver-linux-x86_64 --configuration release --toolchain ~/.swiftenv --ninja-bin swift/build/buildbot_linux/ninja-build/ninja --cmake-bin /usr/bin/cmake --local_compiler_build
--- build-script-helper.py: error: [Errno 2] No such file or directory
ERROR: command terminated with a non-zero exit status 1, aborting

ERROR: command terminated with a non-zero exit status 1, aborting

symlinking .swiftenv to point to the toolchain does not work. how do you build the swift compiler locally?

6 Likes

Can you try the linux-specific instructions I added this summer, after making sure all those earlier prerequisites are there?

1 Like

You can also have the CI bot build a toolchain for you swift/ContinuousIntegration.md at main · apple/swift · GitHub

1 Like

those were the instructions i followed, and i already double checked dependencies and CMake version (3.21.3).

$ cmake --version
cmake version 3.21.3

CMake suite maintained and supported by Kitware (kitware.com/cmake).
$ python3 --version
Python 3.8.10
$ ninja --version
1.10.0
$ sccache --version
sccache 0.2.2
$ sudo apt-get -y install \
>   build-essential       \
>   clang                 \
>   cmake                 \
>   git                   \
>   icu-devtools          \
>   libcurl4-openssl-dev  \
>   libedit-dev           \
>   libicu-dev            \
>   libncurses5-dev       \
>   libpython3-dev        \
>   libsqlite3-dev        \
>   libxml2-dev           \
>   ninja-build           \
>   pkg-config            \
>   python                \
>   python-six            \
>   python2-dev           \
>   python3-six           \
>   python3-distutils     \
>   rsync                 \
>   swig                  \
>   systemtap-sdt-dev     \
>   tzdata                \
>   unzip                 \
>   uuid-dev

Reading package lists... Done
Building dependency tree       
Reading state information... Done
Note, selecting 'python-is-python2' instead of 'python'
icu-devtools is already the newest version (66.1-2ubuntu2).
libedit-dev is already the newest version (3.1-20191231-1).
libicu-dev is already the newest version (66.1-2ubuntu2).
libncurses5-dev is already the newest version (6.2-0ubuntu2).
libpython3-dev is already the newest version (3.8.2-0ubuntu2).
pkg-config is already the newest version (0.29.1-0ubuntu4).
python3-six is already the newest version (1.14.0-2).
rsync is already the newest version (3.1.3-8).
unzip is already the newest version (6.0-25ubuntu1).
clang is already the newest version (1:10.0-50~exp1).
ninja-build is already the newest version (1.10.0-1build1).
python-is-python2 is already the newest version (2.7.17-4).
python-six is already the newest version (1.14.0-2).
python2-dev is already the newest version (2.7.17-2ubuntu4).
swig is already the newest version (4.0.1-5build1).
systemtap-sdt-dev is already the newest version (4.2-3).
build-essential is already the newest version (12.8ubuntu1.1).
git is already the newest version (1:2.25.1-1ubuntu3.2).
libcurl4-openssl-dev is already the newest version (7.68.0-1ubuntu2.7).
libsqlite3-dev is already the newest version (3.31.1-4ubuntu0.2).
libxml2-dev is already the newest version (2.9.10+dfsg-5ubuntu0.20.04.1).
python3-distutils is already the newest version (3.8.10-0ubuntu1~20.04).
tzdata is already the newest version (2021a-2ubuntu0.20.04).
uuid-dev is already the newest version (2.34-0.1ubuntu9.1).
cmake is already the newest version (3.21.3-0kitware1ubuntu20.04.1).
0 upgraded, 0 newly installed, 0 to remove and 48 not upgraded.

i was able to bypass the earlyswiftdriver issue by adding the --skip-early-swift-driver flag to build-presets.ini, but now it is failing with the following errors:

FAILED: lib/Option/CMakeFiles/swiftOption.dir/SanitizerOptions.cpp.o 
.swiftenv/shims/clang++ -DCMARK_STATIC_DEFINE -DGTEST_HAS_RTTI=0 -D_DEBUG -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -Itools/sources/swift/build/buildbot_linux/swift-linux-x86_64/lib/Option -Itools/sources/swift/swift/lib/Option -Itools/sources/swift/build/buildbot_linux/swift-linux-x86_64/include -Itools/sources/swift/swift/include -Itools/sources/swift/llvm-project/llvm/include -Itools/sources/swift/build/buildbot_linux/llvm-linux-x86_64/include -Itools/sources/swift/llvm-project/clang/include -Itools/sources/swift/build/buildbot_linux/llvm-linux-x86_64/tools/clang/include -Itools/sources/swift/cmark/src -Itools/sources/swift/build/buildbot_linux/cmark-linux-x86_64/src -Itools/sources/swift/swift-corelibs-libdispatch/src/BlocksRuntime -Itools/sources/swift/swift-corelibs-libdispatch -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 -fdiagnostics-color -ffunction-sections -fdata-sections -Werror=switch -Wdocumentation -Wimplicit-fallthrough -Wunreachable-code -Woverloaded-virtual -DOBJC_OLD_DISPATCH_PROTOTYPES=0 -O3   -fno-exceptions -fno-rtti -Werror=gnu -UNDEBUG -target x86_64-unknown-linux-gnu -O2 -g0 -march=core2 -std=c++14 -MD -MT lib/Option/CMakeFiles/swiftOption.dir/SanitizerOptions.cpp.o -MF lib/Option/CMakeFiles/swiftOption.dir/SanitizerOptions.cpp.o.d -o lib/Option/CMakeFiles/swiftOption.dir/SanitizerOptions.cpp.o -c tools/sources/swift/swift/lib/Option/SanitizerOptions.cpp
In file included from tools/sources/swift/swift/lib/Option/SanitizerOptions.cpp:19:
tools/sources/swift/swift/include/swift/Basic/Platform.h:19:10: fatal error: 'clang/Basic/DarwinSDKInfo.h' file not found
#include "clang/Basic/DarwinSDKInfo.h"
         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 error generated.
[6/1047][  0%][2.642s] Building CXX object lib/Basic/CMakeFiles/swiftBasic.dir/FileSystem.cpp.o
FAILED: lib/Basic/CMakeFiles/swiftBasic.dir/FileSystem.cpp.o 
.swiftenv/shims/clang++ -DCMARK_STATIC_DEFINE -DGTEST_HAS_RTTI=0 -D_DEBUG -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -Itools/sources/swift/build/buildbot_linux/swift-linux-x86_64/lib/Basic -Itools/sources/swift/swift/lib/Basic -Itools/sources/swift/build/buildbot_linux/swift-linux-x86_64/include -Itools/sources/swift/swift/include -Itools/sources/swift/llvm-project/llvm/include -Itools/sources/swift/build/buildbot_linux/llvm-linux-x86_64/include -Itools/sources/swift/llvm-project/clang/include -Itools/sources/swift/build/buildbot_linux/llvm-linux-x86_64/tools/clang/include -Itools/sources/swift/cmark/src -Itools/sources/swift/build/buildbot_linux/cmark-linux-x86_64/src -Itools/sources/swift/swift-corelibs-libdispatch/src/BlocksRuntime -Itools/sources/swift/swift-corelibs-libdispatch -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 -fdiagnostics-color -ffunction-sections -fdata-sections -Werror=switch -Wdocumentation -Wimplicit-fallthrough -Wunreachable-code -Woverloaded-virtual -DOBJC_OLD_DISPATCH_PROTOTYPES=0 -O3   -fno-exceptions -fno-rtti -Werror=gnu -UNDEBUG -target x86_64-unknown-linux-gnu -O2 -g0 -march=core2 -std=c++14 -MD -MT lib/Basic/CMakeFiles/swiftBasic.dir/FileSystem.cpp.o -MF lib/Basic/CMakeFiles/swiftBasic.dir/FileSystem.cpp.o.d -o lib/Basic/CMakeFiles/swiftBasic.dir/FileSystem.cpp.o -c tools/sources/swift/swift/lib/Basic/FileSystem.cpp
tools/sources/swift/swift/lib/Basic/FileSystem.cpp:104:24: error: no matching function for call to 'createUniqueFile'
  std::error_code EC = fs::createUniqueFile(tempPath, fd, tempPath,
                       ^~~~~~~~~~~~~~~~~~~~
tools/sources/swift/llvm-project/llvm/include/llvm/Support/FileSystem.h:807:17: note: candidate function not viable: requires at most 4 arguments, but 5 were provided
std::error_code createUniqueFile(const Twine &Model, int &ResultFD,
                ^
tools/sources/swift/llvm-project/llvm/include/llvm/Support/FileSystem.h:813:17: note: candidate function not viable: requires at most 3 arguments, but 5 were provided
std::error_code createUniqueFile(const Twine &Model,
                ^
1 error generated.
[7/1047][  0%][3.107s] Building CXX object lib/LLVMPasses/CMakeFiles/swiftLLVMPasses.dir/LLVMSwiftRCIdentity.cpp.o
FAILED: lib/LLVMPasses/CMakeFiles/swiftLLVMPasses.dir/LLVMSwiftRCIdentity.cpp.o 
.swiftenv/shims/clang++ -DCMARK_STATIC_DEFINE -DGTEST_HAS_RTTI=0 -DSWIFT_LLVM_SUPPORT_IS_AVAILABLE -D_DEBUG -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -Itools/sources/swift/build/buildbot_linux/swift-linux-x86_64/lib/LLVMPasses -Itools/sources/swift/swift/lib/LLVMPasses -Itools/sources/swift/build/buildbot_linux/swift-linux-x86_64/include -Itools/sources/swift/swift/include -Itools/sources/swift/llvm-project/llvm/include -Itools/sources/swift/build/buildbot_linux/llvm-linux-x86_64/include -Itools/sources/swift/llvm-project/clang/include -Itools/sources/swift/build/buildbot_linux/llvm-linux-x86_64/tools/clang/include -Itools/sources/swift/cmark/src -Itools/sources/swift/build/buildbot_linux/cmark-linux-x86_64/src -Itools/sources/swift/swift-corelibs-libdispatch/src/BlocksRuntime -Itools/sources/swift/swift-corelibs-libdispatch -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 -fdiagnostics-color -ffunction-sections -fdata-sections -Werror=switch -Wdocumentation -Wimplicit-fallthrough -Wunreachable-code -Woverloaded-virtual -DOBJC_OLD_DISPATCH_PROTOTYPES=0 -O3   -fno-exceptions -fno-rtti -Werror=gnu -UNDEBUG -target x86_64-unknown-linux-gnu -O2 -g0 -march=core2 -std=c++14 -MD -MT lib/LLVMPasses/CMakeFiles/swiftLLVMPasses.dir/LLVMSwiftRCIdentity.cpp.o -MF lib/LLVMPasses/CMakeFiles/swiftLLVMPasses.dir/LLVMSwiftRCIdentity.cpp.o.d -o lib/LLVMPasses/CMakeFiles/swiftLLVMPasses.dir/LLVMSwiftRCIdentity.cpp.o -c tools/sources/swift/swift/lib/LLVMPasses/LLVMSwiftRCIdentity.cpp
In file included from tools/sources/swift/swift/lib/LLVMPasses/LLVMSwiftRCIdentity.cpp:13:
tools/sources/swift/swift/include/swift/LLVMPasses/Passes.h:37:13: error: no type named 'SimpleAAQueryInfo' in namespace 'llvm'
      llvm::SimpleAAQueryInfo AAQI;
      ~~~~~~^
1 error generated.
[8/1047][  0%][3.329s] Building CXX object lib/LLVMPasses/CMakeFiles/swiftLLVMPasses.dir/LLVMSwiftAA.cpp.o
FAILED: lib/LLVMPasses/CMakeFiles/swiftLLVMPasses.dir/LLVMSwiftAA.cpp.o 
.swiftenv/shims/clang++ -DCMARK_STATIC_DEFINE -DGTEST_HAS_RTTI=0 -DSWIFT_LLVM_SUPPORT_IS_AVAILABLE -D_DEBUG -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -Itools/sources/swift/build/buildbot_linux/swift-linux-x86_64/lib/LLVMPasses -Itools/sources/swift/swift/lib/LLVMPasses -Itools/sources/swift/build/buildbot_linux/swift-linux-x86_64/include -Itools/sources/swift/swift/include -Itools/sources/swift/llvm-project/llvm/include -Itools/sources/swift/build/buildbot_linux/llvm-linux-x86_64/include -Itools/sources/swift/llvm-project/clang/include -Itools/sources/swift/build/buildbot_linux/llvm-linux-x86_64/tools/clang/include -Itools/sources/swift/cmark/src -Itools/sources/swift/build/buildbot_linux/cmark-linux-x86_64/src -Itools/sources/swift/swift-corelibs-libdispatch/src/BlocksRuntime -Itools/sources/swift/swift-corelibs-libdispatch -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 -fdiagnostics-color -ffunction-sections -fdata-sections -Werror=switch -Wdocumentation -Wimplicit-fallthrough -Wunreachable-code -Woverloaded-virtual -DOBJC_OLD_DISPATCH_PROTOTYPES=0 -O3   -fno-exceptions -fno-rtti -Werror=gnu -UNDEBUG -target x86_64-unknown-linux-gnu -O2 -g0 -march=core2 -std=c++14 -MD -MT lib/LLVMPasses/CMakeFiles/swiftLLVMPasses.dir/LLVMSwiftAA.cpp.o -MF lib/LLVMPasses/CMakeFiles/swiftLLVMPasses.dir/LLVMSwiftAA.cpp.o.d -o lib/LLVMPasses/CMakeFiles/swiftLLVMPasses.dir/LLVMSwiftAA.cpp.o -c tools/sources/swift/swift/lib/LLVMPasses/LLVMSwiftAA.cpp
In file included from tools/sources/swift/swift/lib/LLVMPasses/LLVMSwiftAA.cpp:13:
tools/sources/swift/swift/include/swift/LLVMPasses/Passes.h:37:13: error: no type named 'SimpleAAQueryInfo' in namespace 'llvm'
      llvm::SimpleAAQueryInfo AAQI;
      ~~~~~~^
1 error generated.
[9/1047][  0%][4.057s] Building CXX object lib/LLVMPasses/CMakeFiles/swiftLLVMPasses.dir/LLVMARCContract.cpp.o
FAILED: lib/LLVMPasses/CMakeFiles/swiftLLVMPasses.dir/LLVMARCContract.cpp.o 
.swiftenv/shims/clang++ -DCMARK_STATIC_DEFINE -DGTEST_HAS_RTTI=0 -DSWIFT_LLVM_SUPPORT_IS_AVAILABLE -D_DEBUG -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -Itools/sources/swift/build/buildbot_linux/swift-linux-x86_64/lib/LLVMPasses -Itools/sources/swift/swift/lib/LLVMPasses -Itools/sources/swift/build/buildbot_linux/swift-linux-x86_64/include -Itools/sources/swift/swift/include -Itools/sources/swift/llvm-project/llvm/include -Itools/sources/swift/build/buildbot_linux/llvm-linux-x86_64/include -Itools/sources/swift/llvm-project/clang/include -Itools/sources/swift/build/buildbot_linux/llvm-linux-x86_64/tools/clang/include -Itools/sources/swift/cmark/src -Itools/sources/swift/build/buildbot_linux/cmark-linux-x86_64/src -Itools/sources/swift/swift-corelibs-libdispatch/src/BlocksRuntime -Itools/sources/swift/swift-corelibs-libdispatch -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 -fdiagnostics-color -ffunction-sections -fdata-sections -Werror=switch -Wdocumentation -Wimplicit-fallthrough -Wunreachable-code -Woverloaded-virtual -DOBJC_OLD_DISPATCH_PROTOTYPES=0 -O3   -fno-exceptions -fno-rtti -Werror=gnu -UNDEBUG -target x86_64-unknown-linux-gnu -O2 -g0 -march=core2 -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 tools/sources/swift/swift/lib/LLVMPasses/LLVMARCContract.cpp
In file included from tools/sources/swift/swift/lib/LLVMPasses/LLVMARCContract.cpp:14:
tools/sources/swift/swift/include/swift/LLVMPasses/Passes.h:37:13: error: no type named 'SimpleAAQueryInfo' in namespace 'llvm'
      llvm::SimpleAAQueryInfo AAQI;
      ~~~~~~^
1 error generated.
[10/1047][  0%][4.136s] Building CXX object lib/LLVMPasses/CMakeFiles/swiftLLVMPasses.dir/LLVMInlineTree.cpp.o
FAILED: lib/LLVMPasses/CMakeFiles/swiftLLVMPasses.dir/LLVMInlineTree.cpp.o 
.swiftenv/shims/clang++ -DCMARK_STATIC_DEFINE -DGTEST_HAS_RTTI=0 -DSWIFT_LLVM_SUPPORT_IS_AVAILABLE -D_DEBUG -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -Itools/sources/swift/build/buildbot_linux/swift-linux-x86_64/lib/LLVMPasses -Itools/sources/swift/swift/lib/LLVMPasses -Itools/sources/swift/build/buildbot_linux/swift-linux-x86_64/include -Itools/sources/swift/swift/include -Itools/sources/swift/llvm-project/llvm/include -Itools/sources/swift/build/buildbot_linux/llvm-linux-x86_64/include -Itools/sources/swift/llvm-project/clang/include -Itools/sources/swift/build/buildbot_linux/llvm-linux-x86_64/tools/clang/include -Itools/sources/swift/cmark/src -Itools/sources/swift/build/buildbot_linux/cmark-linux-x86_64/src -Itools/sources/swift/swift-corelibs-libdispatch/src/BlocksRuntime -Itools/sources/swift/swift-corelibs-libdispatch -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 -fdiagnostics-color -ffunction-sections -fdata-sections -Werror=switch -Wdocumentation -Wimplicit-fallthrough -Wunreachable-code -Woverloaded-virtual -DOBJC_OLD_DISPATCH_PROTOTYPES=0 -O3   -fno-exceptions -fno-rtti -Werror=gnu -UNDEBUG -target x86_64-unknown-linux-gnu -O2 -g0 -march=core2 -std=c++14 -MD -MT lib/LLVMPasses/CMakeFiles/swiftLLVMPasses.dir/LLVMInlineTree.cpp.o -MF lib/LLVMPasses/CMakeFiles/swiftLLVMPasses.dir/LLVMInlineTree.cpp.o.d -o lib/LLVMPasses/CMakeFiles/swiftLLVMPasses.dir/LLVMInlineTree.cpp.o -c tools/sources/swift/swift/lib/LLVMPasses/LLVMInlineTree.cpp
In file included from tools/sources/swift/swift/lib/LLVMPasses/LLVMInlineTree.cpp:24:
tools/sources/swift/swift/include/swift/LLVMPasses/Passes.h:37:13: error: no type named 'SimpleAAQueryInfo' in namespace 'llvm'
      llvm::SimpleAAQueryInfo AAQI;
      ~~~~~~^
1 error generated.
[11/1047][  1%][4.477s] Building CXX object lib/LLVMPasses/CMakeFiles/swiftLLVMPasses.dir/LLVMARCOpts.cpp.o
FAILED: lib/LLVMPasses/CMakeFiles/swiftLLVMPasses.dir/LLVMARCOpts.cpp.o 
.swiftenv/shims/clang++ -DCMARK_STATIC_DEFINE -DGTEST_HAS_RTTI=0 -DSWIFT_LLVM_SUPPORT_IS_AVAILABLE -D_DEBUG -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -Itools/sources/swift/build/buildbot_linux/swift-linux-x86_64/lib/LLVMPasses -Itools/sources/swift/swift/lib/LLVMPasses -Itools/sources/swift/build/buildbot_linux/swift-linux-x86_64/include -Itools/sources/swift/swift/include -Itools/sources/swift/llvm-project/llvm/include -Itools/sources/swift/build/buildbot_linux/llvm-linux-x86_64/include -Itools/sources/swift/llvm-project/clang/include -Itools/sources/swift/build/buildbot_linux/llvm-linux-x86_64/tools/clang/include -Itools/sources/swift/cmark/src -Itools/sources/swift/build/buildbot_linux/cmark-linux-x86_64/src -Itools/sources/swift/swift-corelibs-libdispatch/src/BlocksRuntime -Itools/sources/swift/swift-corelibs-libdispatch -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 -fdiagnostics-color -ffunction-sections -fdata-sections -Werror=switch -Wdocumentation -Wimplicit-fallthrough -Wunreachable-code -Woverloaded-virtual -DOBJC_OLD_DISPATCH_PROTOTYPES=0 -O3   -fno-exceptions -fno-rtti -Werror=gnu -UNDEBUG -target x86_64-unknown-linux-gnu -O2 -g0 -march=core2 -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 tools/sources/swift/swift/lib/LLVMPasses/LLVMARCOpts.cpp
In file included from tools/sources/swift/swift/lib/LLVMPasses/LLVMARCOpts.cpp:20:
tools/sources/swift/swift/include/swift/LLVMPasses/Passes.h:37:13: error: no type named 'SimpleAAQueryInfo' in namespace 'llvm'
      llvm::SimpleAAQueryInfo AAQI;
      ~~~~~~^
1 error generated.
[12/1047][  1%][4.715s] Building CXX object lib/LLVMPasses/CMakeFiles/swiftLLVMPasses.dir/LLVMMergeFunctions.cpp.o
FAILED: lib/LLVMPasses/CMakeFiles/swiftLLVMPasses.dir/LLVMMergeFunctions.cpp.o 
.swiftenv/shims/clang++ -DCMARK_STATIC_DEFINE -DGTEST_HAS_RTTI=0 -DSWIFT_LLVM_SUPPORT_IS_AVAILABLE -D_DEBUG -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -Itools/sources/swift/build/buildbot_linux/swift-linux-x86_64/lib/LLVMPasses -Itools/sources/swift/swift/lib/LLVMPasses -Itools/sources/swift/build/buildbot_linux/swift-linux-x86_64/include -Itools/sources/swift/swift/include -Itools/sources/swift/llvm-project/llvm/include -Itools/sources/swift/build/buildbot_linux/llvm-linux-x86_64/include -Itools/sources/swift/llvm-project/clang/include -Itools/sources/swift/build/buildbot_linux/llvm-linux-x86_64/tools/clang/include -Itools/sources/swift/cmark/src -Itools/sources/swift/build/buildbot_linux/cmark-linux-x86_64/src -Itools/sources/swift/swift-corelibs-libdispatch/src/BlocksRuntime -Itools/sources/swift/swift-corelibs-libdispatch -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 -fdiagnostics-color -ffunction-sections -fdata-sections -Werror=switch -Wdocumentation -Wimplicit-fallthrough -Wunreachable-code -Woverloaded-virtual -DOBJC_OLD_DISPATCH_PROTOTYPES=0 -O3   -fno-exceptions -fno-rtti -Werror=gnu -UNDEBUG -target x86_64-unknown-linux-gnu -O2 -g0 -march=core2 -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 tools/sources/swift/swift/lib/LLVMPasses/LLVMMergeFunctions.cpp
In file included from tools/sources/swift/swift/lib/LLVMPasses/LLVMMergeFunctions.cpp:31:
tools/sources/swift/swift/include/swift/LLVMPasses/Passes.h:37:13: error: no type named 'SimpleAAQueryInfo' in namespace 'llvm'
      llvm::SimpleAAQueryInfo AAQI;
      ~~~~~~^
1 error generated.
ninja: build stopped: subcommand failed.
ERROR: command terminated with a non-zero exit status 1, aborting

ERROR: command terminated with a non-zero exit status 1, aborting

i do not have commit access to the swift project. :(

I guess you can search for a recent commit in which that command has been used. Such as [Concurrency] Limit queue width with set_width SPI call on linux by ktoso · Pull Request #39732 · apple/swift · GitHub for a Linux build (11 hours ago) or [DO NOT MERGE] Dummy PR for CI testing by ahoppen · Pull Request #37710 · apple/swift · GitHub for a macOS one (3 days ago).

1 Like

Alright, there can be such issues when building trunk, which is why I only build from snapshot tags that passed the full CI. Unfortunately, the last one was 9 days ago, which is why you're stuck building a random commit from trunk.

@xAlien95 has a good suggestion, those CI-built toolchains are worth trying instead.

1 Like

it looks like all of those Linux toolchains are for 16.04. i need 20.04…

update, i managed to get a local toolchain built, after rerunning update-checkout.

Terms of Service

Privacy Policy

Cookie Policy