Skip to content

SourceLoc.h:251:1: error: too many template parameters in template redeclaration #60675

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Closed
advancedwebdeveloper opened this issue Aug 20, 2022 · 7 comments
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. build error Errors when building the toolchain, not regular Swift code

Comments

@advancedwebdeveloper
Copy link

advancedwebdeveloper commented Aug 20, 2022

Hello.

I have downloaded the latest Swift's release (of version 5.6.2).
Also installed Clang 14.

Log
> yantitarenko5@yangelia:~/Desktop/swift$ 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
> [utils/build-script] NOTE: Using toolchain default
> Ensuring the sccache server is running...
> + /snap/bin/sccache --show-stats
> + cmake --version
> + mkdir -p /home/yantitarenko5/Desktop/build/Ninja-RelWithDebInfoAssert
> -- Warning: {} Host toolchain could not locate a compiler to build swift-driver. (Try `--skip-early-swift-driver`)
> --- Building cmark ---
> + mkdir -p /home/yantitarenko5/Desktop/build/Ninja-RelWithDebInfoAssert/cmark-linux-x86_64
> + /usr/bin/cmake --build /home/yantitarenko5/Desktop/build/Ninja-RelWithDebInfoAssert/cmark-linux-x86_64 --config RelWithDebInfo -- all
> [0/1][  0%][0.000s] Re-running CMake...
> CMake Deprecation Warning at extensions/CMakeLists.txt:1 (cmake_minimum_required):
>   Compatibility with CMake < 2.8.12 will be removed from a future version of
>   CMake.
> 
>   Update the VERSION argument <min> value or use a ...<max> suffix to tell
>   CMake that the project does not need compatibility with older versions.
> 
> 
> -- Configuring done
> -- Generating done
> -- Build files have been written to: /home/yantitarenko5/Desktop/build/Ninja-RelWithDebInfoAssert/cmark-linux-x86_64
> ninja: no work to do.
> --- Running tests for cmark ---
> + /usr/bin/cmake --build /home/yantitarenko5/Desktop/build/Ninja-RelWithDebInfoAssert/cmark-linux-x86_64 --config RelWithDebInfo -- api_test
> ninja: no work to do.
> --- test ---
> + env CTEST_OUTPUT_ON_FAILURE=ON /usr/bin/cmake --build /home/yantitarenko5/Desktop/build/Ninja-RelWithDebInfoAssert/cmark-linux-x86_64 --config RelWithDebInfo -- test
> [0/1][  0%][0.000s] Running tests...
> Test project /home/yantitarenko5/Desktop/build/Ninja-RelWithDebInfoAssert/cmark-linux-x86_64
>       Start  1: api_test
>  1/13 Test  #1: api_test ...............................   Passed    0.28 sec
>       Start  2: html_normalization
>  2/13 Test  #2: html_normalization .....................   Passed    0.11 sec
>       Start  3: spectest_library
>  3/13 Test  #3: spectest_library .......................   Passed    0.14 sec
>       Start  4: pathological_tests_library
>  4/13 Test  #4: pathological_tests_library .............   Passed    5.61 sec
>       Start  5: roundtriptest_library
>  5/13 Test  #5: roundtriptest_library ..................   Passed    0.43 sec
>       Start  6: entity_library
>  6/13 Test  #6: entity_library .........................   Passed    0.14 sec
>       Start  7: spectest_executable
>  7/13 Test  #7: spectest_executable ....................   Passed    0.90 sec
>       Start  8: smartpuncttest_executable
>  8/13 Test  #8: smartpuncttest_executable ..............   Passed    0.11 sec
>       Start  9: extensions_executable
>  9/13 Test  #9: extensions_executable ..................   Passed    0.12 sec
>       Start 10: roundtrip_extensions_executable
> 10/13 Test #10: roundtrip_extensions_executable ........   Passed    0.22 sec
>       Start 11: option_table_prefer_style_attributes
> 11/13 Test #11: option_table_prefer_style_attributes ...   Passed    0.08 sec
>       Start 12: option_full_info_string
> 12/13 Test #12: option_full_info_string ................   Passed    0.09 sec
>       Start 13: regressiontest_executable
> 13/13 Test #13: regressiontest_executable ..............   Passed    0.13 sec
> 
> 100% tests passed, 0 tests failed out of 13
> 
> Total Test time (real) =   8.36 sec
> --- test finished ---
> --- Finished tests for cmark ---
> Building the standard library for: 
> symlinking the system headers (/usr/include/c++) into the local clang build directory (/home/yantitarenko5/Desktop/build/Ninja-RelWithDebInfoAssert/llvm-linux-x86_64/include).
> + ln -s -f /usr/include/c++ /home/yantitarenko5/Desktop/build/Ninja-RelWithDebInfoAssert/llvm-linux-x86_64/include
> + /usr/bin/cmake --build /home/yantitarenko5/Desktop/build/Ninja-RelWithDebInfoAssert/llvm-linux-x86_64 -- -j2 all
> [0/3][  0%][0.000s] Performing build step for 'compiler-rt'
> [0/1][  0%][0.000s] Performing build step for 'libcxx_fuzzer_x86_64'
> ninja: no work to do.
> [1/3][ 33%][0.132s] No install step for 'compiler-rt'
> [3/3][100%][0.242s] Completed 'compiler-rt'
> + /usr/bin/cmake --build /home/yantitarenko5/Desktop/build/Ninja-RelWithDebInfoAssert/swift-linux-x86_64 -- -j2 all
> [1/1132][  0%][0.035s] Performing build step for 'libdispatch-linux-x86_64'
> ninja: no work to do.
> [2/1130][  0%][1.377s] Building CXX object lib/Basic/CMakeFiles/swiftBasic.dir/BasicBridging.cpp.o
> FAILED: lib/Basic/CMakeFiles/swiftBasic.dir/BasicBridging.cpp.o 
> /snap/bin/sccache /usr/bin/clang++ -DCMARK_STATIC_DEFINE -DGTEST_HAS_RTTI=0 -DSWIFT_ENABLE_RUNTIME_FUNCTION_COUNTERS -DSWIFT_THREADING_LINUX -D_DEBUG -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -I/home/yantitarenko5/Desktop/build/Ninja-RelWithDebInfoAssert/swift-linux-x86_64/lib/Basic -I/home/yantitarenko5/Desktop/swift/lib/Basic -I/home/yantitarenko5/Desktop/build/Ninja-RelWithDebInfoAssert/swift-linux-x86_64/include -I/home/yantitarenko5/Desktop/swift/include -I/home/yantitarenko5/Desktop/llvm-project/llvm/include -I/home/yantitarenko5/Desktop/build/Ninja-RelWithDebInfoAssert/llvm-linux-x86_64/include -I/home/yantitarenko5/Desktop/llvm-project/clang/include -I/home/yantitarenko5/Desktop/build/Ninja-RelWithDebInfoAssert/llvm-linux-x86_64/tools/clang/include -I/home/yantitarenko5/Desktop/cmark/src/include -I/home/yantitarenko5/Desktop/build/Ninja-RelWithDebInfoAssert/cmark-linux-x86_64/src -I/home/yantitarenko5/Desktop/swift-corelibs-libdispatch/src/BlocksRuntime -I/home/yantitarenko5/Desktop/swift-corelibs-libdispatch -Wno-unknown-warning-option -Werror=unguarded-availability-new -fno-stack-protector -fPIC -fno-semantic-interposition -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 -ffunction-sections -fdata-sections -Werror=switch -Wdocumentation -Wimplicit-fallthrough -Wunreachable-code -Woverloaded-virtual -DOBJC_OLD_DISPATCH_PROTOTYPES=0 -O2 -DNDEBUG  -fno-exceptions -fno-rtti -Werror=gnu -Werror=c++98-compat-extra-semi -UNDEBUG -gsplit-dwarf -target x86_64-unknown-linux-gnu -O2 -g -march=core2 -std=c++14 -MD -MT lib/Basic/CMakeFiles/swiftBasic.dir/BasicBridging.cpp.o -MF lib/Basic/CMakeFiles/swiftBasic.dir/BasicBridging.cpp.o.d -o lib/Basic/CMakeFiles/swiftBasic.dir/BasicBridging.cpp.o -c /home/yantitarenko5/Desktop/swift/lib/Basic/BasicBridging.cpp
> In file included from /home/yantitarenko5/Desktop/swift/lib/Basic/BasicBridging.cpp:13:
> In file included from /home/yantitarenko5/Desktop/swift/include/swift/Basic/BridgingUtils.h:16:
> In file included from /home/yantitarenko5/Desktop/swift/include/swift/Basic/BasicBridging.h:17:
> /home/yantitarenko5/Desktop/swift/include/swift/Basic/SourceLoc.h:251:1: **error: too many template parameters in template redeclaration**
> template <typename T, typename Enable> struct DenseMapInfo;
> ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> /home/yantitarenko5/Desktop/llvm-project/llvm/include/llvm/ADT/StringRef.h:38:3: note: previous template declaration is here
>   template <typename T> struct DenseMapInfo;
>   ^~~~~~~~~~~~~~~~~~~~~
> 1 error generated.
> [3/1130][  0%][9.799s] Building CXX object lib/ASTSectionImporter/CMakeFiles/swiftASTSectionImporter.dir/ASTSectionImporter.cpp.o
> FAILED: lib/ASTSectionImporter/CMakeFiles/swiftASTSectionImporter.dir/ASTSectionImporter.cpp.o 
> /snap/bin/sccache /usr/bin/clang++ -DCMARK_STATIC_DEFINE -DGTEST_HAS_RTTI=0 -DSWIFT_ENABLE_RUNTIME_FUNCTION_COUNTERS -DSWIFT_LLVM_SUPPORT_IS_AVAILABLE -DSWIFT_THREADING_LINUX -D_DEBUG -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -I/home/yantitarenko5/Desktop/build/Ninja-RelWithDebInfoAssert/swift-linux-x86_64/lib/ASTSectionImporter -I/home/yantitarenko5/Desktop/swift/lib/ASTSectionImporter -I/home/yantitarenko5/Desktop/build/Ninja-RelWithDebInfoAssert/swift-linux-x86_64/include -I/home/yantitarenko5/Desktop/swift/include -I/home/yantitarenko5/Desktop/llvm-project/llvm/include -I/home/yantitarenko5/Desktop/build/Ninja-RelWithDebInfoAssert/llvm-linux-x86_64/include -I/home/yantitarenko5/Desktop/llvm-project/clang/include -I/home/yantitarenko5/Desktop/build/Ninja-RelWithDebInfoAssert/llvm-linux-x86_64/tools/clang/include -I/home/yantitarenko5/Desktop/cmark/src/include -I/home/yantitarenko5/Desktop/build/Ninja-RelWithDebInfoAssert/cmark-linux-x86_64/src -I/home/yantitarenko5/Desktop/swift-corelibs-libdispatch/src/BlocksRuntime -I/home/yantitarenko5/Desktop/swift-corelibs-libdispatch -Wno-unknown-warning-option -Werror=unguarded-availability-new -fno-stack-protector -fPIC -fno-semantic-interposition -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 -ffunction-sections -fdata-sections -Werror=switch -Wdocumentation -Wimplicit-fallthrough -Wunreachable-code -Woverloaded-virtual -DOBJC_OLD_DISPATCH_PROTOTYPES=0 -O2 -DNDEBUG  -fno-exceptions -fno-rtti -Werror=gnu -Werror=c++98-compat-extra-semi -UNDEBUG -gsplit-dwarf -target x86_64-unknown-linux-gnu -O2 -g -march=core2 -std=c++14 -MD -MT lib/ASTSectionImporter/CMakeFiles/swiftASTSectionImporter.dir/ASTSectionImporter.cpp.o -MF lib/ASTSectionImporter/CMakeFiles/swiftASTSectionImporter.dir/ASTSectionImporter.cpp.o.d -o lib/ASTSectionImporter/CMakeFiles/swiftASTSectionImporter.dir/ASTSectionImporter.cpp.o -c /home/yantitarenko5/Desktop/swift/lib/ASTSectionImporter/ASTSectionImporter.cpp
> In file included from /home/yantitarenko5/Desktop/swift/lib/ASTSectionImporter/ASTSectionImporter.cpp:19:
> In file included from /home/yantitarenko5/Desktop/swift/lib/ASTSectionImporter/../Serialization/ModuleFormat.h:22:
> In file included from /home/yantitarenko5/Desktop/swift/include/swift/AST/Decl.h:20:
> In file included from /home/yantitarenko5/Desktop/swift/include/swift/AST/AccessScope.h:17:
> In file included from /home/yantitarenko5/Desktop/swift/include/swift/AST/DeclContext.h:31:
> /home/yantitarenko5/Desktop/swift/include/swift/Basic/SourceLoc.h:251:1: **error: too many template parameters in template redeclaration**
> template <typename T, typename Enable> struct DenseMapInfo;
> ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> /home/yantitarenko5/Desktop/llvm-project/llvm/include/llvm/ADT/PointerIntPair.h:25:1: note: previous template declaration is here
> template <typename T> struct DenseMapInfo;
> ^~~~~~~~~~~~~~~~~~~~~
> In file included from /home/yantitarenko5/Desktop/swift/lib/ASTSectionImporter/ASTSectionImporter.cpp:19:
> In file included from /home/yantitarenko5/Desktop/swift/lib/ASTSectionImporter/../Serialization/ModuleFormat.h:22:
> In file included from /home/yantitarenko5/Desktop/swift/include/swift/AST/Decl.h:21:
> In file included from /home/yantitarenko5/Desktop/swift/include/swift/AST/Attr.h:28:
> /home/yantitarenko5/Desktop/swift/include/swift/Basic/Located.h:58:1: **error: too many template parameters in template redeclaration**
> template <typename T, typename Enable> struct DenseMapInfo;
> ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> /home/yantitarenko5/Desktop/llvm-project/llvm/include/llvm/ADT/PointerIntPair.h:25:1: note: previous template declaration is here
> template <typename T> struct DenseMapInfo;
> ^~~~~~~~~~~~~~~~~~~~~
> In file included from /home/yantitarenko5/Desktop/swift/lib/ASTSectionImporter/ASTSectionImporter.cpp:19:
> In file included from /home/yantitarenko5/Desktop/swift/lib/ASTSectionImporter/../Serialization/ModuleFormat.h:22:
> In file included from /home/yantitarenko5/Desktop/swift/include/swift/AST/Decl.h:21:
> In file included from /home/yantitarenko5/Desktop/swift/include/swift/AST/Attr.h:32:
> /home/yantitarenko5/Desktop/swift/include/swift/AST/AutoDiff.h:708:1: **error: too many template parameters in template redeclaration**
> template <typename T, typename Enable> struct DenseMapInfo;
> ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> /home/yantitarenko5/Desktop/llvm-project/llvm/include/llvm/ADT/APInt.h:34:1: note: previous template declaration is here
> template <typename T> struct DenseMapInfo;
> ^~~~~~~~~~~~~~~~~~~~~
> In file included from /home/yantitarenko5/Desktop/swift/lib/ASTSectionImporter/ASTSectionImporter.cpp:20:
> In file included from /home/yantitarenko5/Desktop/swift/include/swift/AST/ASTContext.h:21:
> In file included from /home/yantitarenko5/Desktop/swift/include/swift/AST/Evaluator.h:26:
> /home/yantitarenko5/Desktop/swift/include/swift/Basic/LangOptions.h:540:42: **error: too few arguments to function call, expected 3, have 1**
>         Target.getMacOSXVersion(OSVersion);
>         ~~~~~~~~~~~~~~~~~~~~~~~          ^
> /home/yantitarenko5/Desktop/llvm-project/llvm/include/llvm/ADT/Triple.h:361:8: note: 'getMacOSXVersion' declared here
>   bool getMacOSXVersion(unsigned &Major, unsigned &Minor,
>        ^
> In file included from /home/yantitarenko5/Desktop/swift/lib/ASTSectionImporter/ASTSectionImporter.cpp:20:
> In file included from /home/yantitarenko5/Desktop/swift/include/swift/AST/ASTContext.h:21:
> In file included from /home/yantitarenko5/Desktop/swift/include/swift/AST/Evaluator.h:26:
> /home/yantitarenko5/Desktop/swift/include/swift/Basic/LangOptions.h:543:37: **error: too few arguments to function call, expected 3, have 0**
>         return Target.getiOSVersion();
>                ~~~~~~~~~~~~~~~~~~~~ ^
> /home/yantitarenko5/Desktop/llvm-project/llvm/include/llvm/ADT/Triple.h:366:8: note: 'getiOSVersion' declared here
>   void getiOSVersion(unsigned &Major, unsigned &Minor,
>        ^
> In file included from /home/yantitarenko5/Desktop/swift/lib/ASTSectionImporter/ASTSectionImporter.cpp:20:
> In file included from /home/yantitarenko5/Desktop/swift/include/swift/AST/ASTContext.h:21:
> In file included from /home/yantitarenko5/Desktop/swift/include/swift/AST/Evaluator.h:26:
> /home/yantitarenko5/Desktop/swift/include/swift/Basic/LangOptions.h:543:16: **error: no viable conversion from returned value of type 'void' to function return type 'llvm::VersionTuple'**
>         return Target.getiOSVersion();
>                ^~~~~~~~~~~~~~~~~~~~~~
> /home/yantitarenko5/Desktop/llvm-project/llvm/include/llvm/Support/VersionTuple.h:29:7: note: candidate constructor (the implicit copy constructor) not viable: cannot convert argument of incomplete type 'void' to 'const llvm::VersionTuple &' for 1st argument
> class VersionTuple {
>       ^
> /home/yantitarenko5/Desktop/llvm-project/llvm/include/llvm/Support/VersionTuple.h:29:7: note: candidate constructor (the implicit move constructor) not viable: cannot convert argument of incomplete type 'void' to 'llvm::VersionTuple &&' for 1st argument
> /home/yantitarenko5/Desktop/llvm-project/llvm/include/llvm/Support/VersionTuple.h:46:12: note: explicit constructor is not a candidate
>   explicit VersionTuple(unsigned Major)
>            ^
> In file included from /home/yantitarenko5/Desktop/swift/lib/ASTSectionImporter/ASTSectionImporter.cpp:20:
> In file included from /home/yantitarenko5/Desktop/swift/include/swift/AST/ASTContext.h:21:
> In file included from /home/yantitarenko5/Desktop/swift/include/swift/AST/Evaluator.h:26:
> /home/yantitarenko5/Desktop/swift/include/swift/Basic/LangOptions.h:545:36: **error: too few arguments to function call, expected 3, have 0**
>         return Target.getOSVersion();
>                ~~~~~~~~~~~~~~~~~~~ ^
> /home/yantitarenko5/Desktop/llvm-project/llvm/include/llvm/ADT/Triple.h:347:8: note: 'getOSVersion' declared here
>   void getOSVersion(unsigned &Major, unsigned &Minor, unsigned &Micro) const;
>        ^
> In file included from /home/yantitarenko5/Desktop/swift/lib/ASTSectionImporter/ASTSectionImporter.cpp:20:
> In file included from /home/yantitarenko5/Desktop/swift/include/swift/AST/ASTContext.h:21:
> In file included from /home/yantitarenko5/Desktop/swift/include/swift/AST/Evaluator.h:26:
> /home/yantitarenko5/Desktop/swift/include/swift/Basic/LangOptions.h:545:16: **error: no viable conversion from returned value of type 'void' to function return type 'llvm::VersionTuple'**
>         return Target.getOSVersion();
>                ^~~~~~~~~~~~~~~~~~~~~
> /home/yantitarenko5/Desktop/llvm-project/llvm/include/llvm/Support/VersionTuple.h:29:7: note: candidate constructor (the implicit copy constructor) not viable: cannot convert argument of incomplete type 'void' to 'const llvm::VersionTuple &' for 1st argument
> class VersionTuple {
>       ^
> /home/yantitarenko5/Desktop/llvm-project/llvm/include/llvm/Support/VersionTuple.h:29:7: note: candidate constructor (the implicit move constructor) not viable: cannot convert argument of incomplete type 'void' to 'llvm::VersionTuple &&' for 1st argument
> /home/yantitarenko5/Desktop/llvm-project/llvm/include/llvm/Support/VersionTuple.h:46:12: note: explicit constructor is not a candidate
>   explicit VersionTuple(unsigned Major)
>            ^
> 8 errors generated.
> ninja: build stopped: subcommand failed.
> --- Build Script Analyzer ---
> Build Script Log: /home/yantitarenko5/Desktop/build/.build_script_log
> Build Percentage 	 Build Duration (sec) 	 Build Phase
> ================ 	 ==================== 	 ===========
> 50.8%             	 10.19                 	 linux-x86_64-swift-build
> 42.0%             	 8.43                  	 Running tests for cmark
> 6.4%              	 1.29                  	 linux-x86_64-llvm-build
> 0.8%              	 0.16                  	 Building cmark
> Total Duration: 20.07
> Traceback (most recent call last):
>   File "/home/yantitarenko5/Desktop/swift/utils/swift_build_support/swift_build_support/shell.py", line 88, in call
>     subprocess.check_call(command, env=_env, stderr=stderr)
>   File "/usr/lib/python3.10/subprocess.py", line 369, in check_call
>     raise CalledProcessError(retcode, cmd)
> subprocess.CalledProcessError: Command '['/home/yantitarenko5/Desktop/swift/utils/build-script-impl', '--workspace', '/home/yantitarenko5/Desktop', '--build-dir', '/home/yantitarenko5/Desktop/build/Ninja-RelWithDebInfoAssert', '--install-prefix', '/usr', '--host-target', 'linux-x86_64', '--stdlib-deployment-targets=', '--host-cc', '/usr/bin/clang', '--host-cxx', '/usr/bin/clang++', '--darwin-xcrun-toolchain', 'default', '--darwin-deployment-version-osx=10.9', '--darwin-deployment-version-ios=7.0', '--darwin-deployment-version-tvos=9.0', '--darwin-deployment-version-watchos=2.0', '--cmake', '/usr/bin/cmake', '--cmark-build-type', 'RelWithDebInfo', '--llvm-build-type', 'RelWithDebInfo', '--swift-build-type', 'RelWithDebInfo', '--swift-stdlib-build-type', 'RelWithDebInfo', '--lldb-build-type', 'RelWithDebInfo', '--foundation-build-type', 'RelWithDebInfo', '--libdispatch-build-type', 'RelWithDebInfo', '--libicu-build-type', 'RelWithDebInfo', '--xctest-build-type', 'RelWithDebInfo', '--llbuild-build-type', 'RelWithDebInfo', '--swift-enable-assertions', 'true', '--swift-stdlib-enable-assertions', 'true', '--swift-analyze-code-coverage', 'false', '--llbuild-enable-assertions', 'true', '--lldb-assertions', 'true', '--cmake-generator', 'Ninja', '--cross-compile-append-host-target-to-destdir', 'true', '--build-jobs', '2', '--common-cmake-options=-G Ninja -DCMAKE_C_COMPILER_LAUNCHER:PATH=/snap/bin/sccache -DCMAKE_CXX_COMPILER_LAUNCHER:PATH=/snap/bin/sccache -DCMAKE_C_COMPILER:PATH=/usr/bin/clang -DCMAKE_CXX_COMPILER:PATH=/usr/bin/clang++ -DCMAKE_Swift_COMPILER:PATH= -DCMAKE_LIBTOOL:PATH= -DCMAKE_AR:PATH=/usr/bin/ar -DCMAKE_RANLIB:PATH=/usr/bin/ranlib -DLLVM_VERSION_MAJOR:STRING=13 -DLLVM_VERSION_MINOR:STRING=0 -DLLVM_VERSION_PATCH:STRING=0 -DCLANG_VERSION_MAJOR:STRING=13 -DCLANG_VERSION_MINOR:STRING=0 -DCLANG_VERSION_PATCH:STRING=0 -DCMAKE_MAKE_PROGRAM=/usr/bin/ninja', '--build-args=-j2', '--dsymutil-jobs', '1', '--llvm-cmake-options=-DLLVM_ENABLE_ASSERTIONS:BOOL=TRUE -DLLVM_TARGETS_TO_BUILD=X86;ARM;AArch64;PowerPC;SystemZ;Mips', '--swift-cmake-options=-DCMAKE_EXPORT_COMPILE_COMMANDS=TRUE -DSWIFT_FORCE_OPTIMIZED_TYPECHECKER:BOOL=FALSE -DSWIFT_STDLIB_ENABLE_STDLIBCORE_EXCLUSIVITY_CHECKING:BOOL=FALSE -DSWIFT_ENABLE_EXPERIMENTAL_DIFFERENTIABLE_PROGRAMMING:BOOL=TRUE -DSWIFT_ENABLE_EXPERIMENTAL_CONCURRENCY:BOOL=TRUE -DSWIFT_ENABLE_EXPERIMENTAL_DISTRIBUTED:BOOL=TRUE -DSWIFT_STDLIB_STATIC_PRINT=FALSE -DSWIFT_FREESTANDING_IS_DARWIN:BOOL=FALSE -DSWIFT_STDLIB_BUILD_PRIVATE:BOOL=TRUE -DSWIFT_STDLIB_ENABLE_UNICODE_DATA=TRUE -DSWIFT_TOOLS_LD64_LTO_CODEGEN_ONLY_FOR_SUPPORTING_TARGETS:BOOL=FALSE', '--build-stdlib-deployment-targets', 'all', '--ninja-bin=/usr/bin/ninja', '--install-destdir', '/home/yantitarenko5/Desktop/build/Ninja-RelWithDebInfoAssert/toolchain-linux-x86_64', '--skip-build-benchmarks', '--skip-build-foundation', '--skip-build-xctest', '--skip-build-lldb', '--skip-build-llbuild', '--skip-build-libcxx', '--skip-build-libdispatch', '--skip-build-libicu', '--skip-build-libxml2', '--skip-build-zlib', '--skip-build-curl', '--build-swift-dynamic-stdlib', '--build-swift-dynamic-sdk-overlay', '--skip-build-android', '--skip-test-benchmarks', '--android-deploy-device-path', '/data/local/tmp', '--extra-cmake-options=-DSWIFT_DARWIN_SUPPORTED_ARCHS:STRING=x86_64 -DSWIFT_DISABLE_DEAD_STRIPPING:BOOL=TRUE', '--llvm-lit-args=-sv', '--llvm-install-components=llvm-cov;llvm-profdata;IndexStore;clang;clang-resource-headers;compiler-rt;clangd;lld', '--only-execute', 'linux-x86_64-swift-build']' returned non-zero exit status 1.
> 
> During handling of the above exception, another exception occurred:
> 
> Traceback (most recent call last):
>   File "/home/yantitarenko5/Desktop/swift/utils/build-script", line 720, in <module>
>     exit_code = main()
>   File "/home/yantitarenko5/Desktop/swift/utils/build-script", line 715, in main
>     return main_normal()
>   File "/home/yantitarenko5/Desktop/swift/utils/build-script", line 671, in main_normal
>     invocation.execute()
>   File "/home/yantitarenko5/Desktop/swift/utils/swift_build_support/swift_build_support/build_script_invocation.py", line 693, in execute
>     self._execute_impl(pipeline, all_hosts, perform_epilogue_opts)
>   File "/home/yantitarenko5/Desktop/swift/utils/swift_build_support/swift_build_support/build_script_invocation.py", line 739, in _execute_impl
>     self._execute_build_action(host_target, product_class)
>   File "/home/yantitarenko5/Desktop/swift/utils/swift_build_support/swift_build_support/build_script_invocation.py", line 770, in _execute_build_action
>     self._execute_action(action_name)
>   File "/home/yantitarenko5/Desktop/swift/utils/swift_build_support/swift_build_support/build_script_invocation.py", line 798, in _execute_action
>     shell.call_without_sleeping(
>   File "/home/yantitarenko5/Desktop/swift/utils/swift_build_support/swift_build_support/shell.py", line 111, in call_without_sleeping
>     call(command, env=env, dry_run=dry_run, echo=echo)
>   File "/home/yantitarenko5/Desktop/swift/utils/swift_build_support/swift_build_support/shell.py", line 90, in call
>     _fatal_error(
>   File "/home/yantitarenko5/Desktop/swift/utils/swift_build_support/swift_build_support/shell.py", line 34, in _fatal_error
>     raise SystemExit('ERROR: {}\n'.format(message))
> SystemExit: ERROR: command terminated with a non-zero exit status 1, aborting
> 
> 
> During handling of the above exception, another exception occurred:
> 
> Traceback (most recent call last):
>   File "/home/yantitarenko5/Desktop/swift/utils/build-script", line 722, in <module>
>     os._exit(e.code)
> TypeError: 'str' object cannot be interpreted as an integer
> 
@advancedwebdeveloper advancedwebdeveloper added the bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. label Aug 20, 2022
@theblixguy
Copy link
Collaborator

theblixguy commented Aug 20, 2022

I got the same error yesterday, I fixed it by doing a clean build and reconfiguring by passing --clean --reconfigure. However, I was on main and not a older release of Swift. I also had to run update-checkout twice, I don’t know if that helped.

@benpious
Copy link
Contributor

I got the same error yesterday, I fixed it by doing a clean build and reconfiguring by passing --clean --reconfigure. However, I was on main and not a older release of Swift. I also had to run update-checkout twice, I don’t know if that helped.

Do you have the specific command you ran by any chance?

I am also having this issue, and running

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 --clean --reconfigure

doesn't fix it even after repeatedly running update-checkout. I'm wondering if maybe it's not cleaning the llvm build for whatever reason.

@theblixguy
Copy link
Collaborator

theblixguy commented Aug 30, 2022

Do you have the specific command you ran by any chance?

I build with:

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

In this case, I also passed --clean and --reconfigure. You could also try manually deleting the build folder or even deleting your whole checkout and start from scratch.

I run update-checkout like this:

./utils/update-checkout --clone-with-ssh

@AnthonyLatsis
Copy link
Collaborator

AnthonyLatsis commented Aug 30, 2022

I had this just now, and it was a clean build, so my first thought was that either my checkout was out of sync or sccache was misbehaving. I first ran update-checkout again, this time passing --clone-with-ssh, which, curiously, failed at the very end and spat out what seems to be an unrelated attribute error (whatever), repeated the build-script invocation, and voilà.

I use the same command as Suyash sans the explicit bootstrapping mode, and also prefer manually deleting the build folder as an alternative to --clean. I do not believe any of this counts though.

@benpious
Copy link
Contributor

benpious commented Sep 1, 2022

Thanks @theblixguy @AnthonyLatsis, it seems that --clone-with-ssh magically fixes it. It even fails for me at the end, too.

@advancedwebdeveloper
Copy link
Author

Let me check

@asl
Copy link
Contributor

asl commented Apr 27, 2025

Should this be closed?

@AnthonyLatsis AnthonyLatsis added the build error Errors when building the toolchain, not regular Swift code label Apr 27, 2025
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. build error Errors when building the toolchain, not regular Swift code
Projects
None yet
Development

No branches or pull requests

5 participants