Swift compiler building error after cloning the repo

Sounds good to me, but I don't know who decides that, maybe @mishal_shah? I see that there are currently three build presets that set it, but all are for macOS and I don't know if there is CI running them.

What do you think about installing a Debug Swift CI? @mishal_shah

Hi everyone,
i was trying to rebuild the project but after installing ubuntu linux.
and used this flag to build

utils/build-script --release-debuginfo --debug-swift -j6

then after a while i got this error

: && /usr/local/bin/swift/usr/bin/clang++ -Wno-unknown-warning-option -Werror=unguarded-availability-new -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-noexcept-type -Wnon-virtual-dtor -Wdelete-non-virtual-dtor -Wsuggest-override -Wstring-conversion -Wmisleading-indentation -Wctad-maybe-unsupported -fdiagnostics-color -g -target x86_64-unknown-linux-gnu -fuse-ld=gold -Xlinker --build-id=sha1 tools/swift-ast-script/CMakeFiles/swift-ast-script.dir/ASTScriptConfiguration.cpp.o tools/swift-ast-script/CMakeFiles/swift-ast-script.dir/ASTScriptParser.cpp.o tools/swift-ast-script/CMakeFiles/swift-ast-script.dir/ASTScriptEvaluator.cpp.o tools/swift-ast-script/CMakeFiles/swift-ast-script.dir/swift-ast-script.cpp.o -o bin/swift-ast-script -L/home/ziad/GSoC/Swift/build/Ninja+cmark-DebugAssert+llvm-ReleaseAssert+swift-DebugAssert+stdlib-Release/llvm-linux-x86_64/./lib   -L/usr/local/bin/swift/usr/lib/swift/linux   -L/usr/local/bin/swift/usr/lib/swift/linux/x86_64   -L/home/ziad/GSoC/Swift/build/Ninja+cmark-DebugAssert+llvm-ReleaseAssert+swift-DebugAssert+stdlib-Release/swift-linux-x86_64/lib -Wl,-rpath,"\$ORIGIN/../lib/swift/linux:\$ORIGIN/../lib/swift/host/compiler"  -lpthread  -ldl  /usr/local/bin/swift/usr/lib/swift/linux/x86_64/swiftrt.o  -lswiftCore  lib/libswiftAST.a  lib/libswiftFrontendTool.a  lib/libswiftDependencyScan.a  lib/libswiftDependencyScanImpl.a  lib/libswiftImmediate.a  /home/ziad/GSoC/Swift/build/Ninja+cmark-DebugAssert+llvm-ReleaseAssert+swift-DebugAssert+stdlib-Release/llvm-linux-x86_64/lib/libLLVMMCJIT.a  /home/ziad/GSoC/Swift/build/Ninja+cmark-DebugAssert+llvm-ReleaseAssert+swift-DebugAssert+stdlib-Release/llvm-linux-x86_64/lib/libLLVMOrcJIT.a  /home/ziad/GSoC/Swift/build/Ninja+cmark-DebugAssert+llvm-ReleaseAssert+swift-DebugAssert+stdlib-Release/llvm-linux-x86_64/lib/libLLVMExecutionEngine.a  /home/ziad/GSoC/Swift/build/Ninja+cmark-DebugAssert+llvm-ReleaseAssert+swift-DebugAssert+stdlib-Release/llvm-linux-x86_64/lib/libLLVMRuntimeDyld.a  /home/ziad/GSoC/Swift/build/Ninja+cmark-DebugAssert+llvm-ReleaseAssert+swift-DebugAssert+stdlib-Release/llvm-linux-x86_64/lib/libLLVMJITLink.a  /home/ziad/GSoC/Swift/build/Ninja+cmark-DebugAssert+llvm-ReleaseAssert+swift-DebugAssert+stdlib-Release/llvm-linux-x86_64/lib/libLLVMOrcTargetProcess.a  /home/ziad/GSoC/Swift/build/Ninja+cmark-DebugAssert+llvm-ReleaseAssert+swift-DebugAssert+stdlib-Release/llvm-linux-x86_64/lib/libLLVMOrcShared.a  lib/libswiftIndex.a  lib/libswiftMigrator.a  lib/libswiftPrintAsClang.a  lib/libswiftFrontend.a  lib/libswiftConstExtract.a  lib/libswiftAPIDigester.a  lib/libswiftLocalization.a  lib/libswiftSymbolGraphGen.a  lib/libswiftIRGen.a  lib/libswiftLLVMPasses.a  lib/libswiftIDE.a  lib/libswiftDriver.a  lib/libswiftIDEUtilsBridging.a  lib/swift/host/compiler/lib_CompilerSwiftIDEUtils.so  lib/libswiftSILGen.a  lib/libswiftSILOptimizer.a  lib/libswiftSerialization.a  lib/libswiftSIL.a  lib/libswiftSema.a  lib/libswiftSerialization.a  lib/libswiftSIL.a  lib/libswiftSema.a  lib/libswiftOption.a  lib/libswiftClangImporter.a  lib/libswiftParse.a  lib/libswiftMacroEvaluation.a  lib/libswiftAST.a  lib/libswiftASTGen.a  lib/libswiftAST.a  lib/libswiftASTGen.a  /home/ziad/GSoC/Swift/build/Ninja+cmark-DebugAssert+llvm-ReleaseAssert+swift-DebugAssert+stdlib-Release/llvm-linux-x86_64/lib/libLLVMX86CodeGen.a  /home/ziad/GSoC/Swift/build/Ninja+cmark-DebugAssert+llvm-ReleaseAssert+swift-DebugAssert+stdlib-Release/llvm-linux-x86_64/lib/libLLVMX86AsmParser.a  /home/ziad/GSoC/Swift/build/Ninja+cmark-DebugAssert+llvm-ReleaseAssert+swift-DebugAssert+stdlib-Release/llvm-linux-x86_64/lib/libLLVMX86Desc.a  /home/ziad/GSoC/Swift/build/Ninja+cmark-DebugAssert+llvm-ReleaseAssert+swift-DebugAssert+stdlib-Release/llvm-linux-x86_64/lib/libLLVMX86Disassembler.a  /home/ziad/GSoC/Swift/build/Ninja+cmark-DebugAssert+llvm-ReleaseAssert+swift-DebugAssert+stdlib-Release/llvm-linux-x86_64/lib/libLLVMX86Info.a  /home/ziad/GSoC/Swift/build/Ninja+cmark-DebugAssert+llvm-ReleaseAssert+swift-DebugAssert+stdlib-Release/llvm-linux-x86_64/lib/libLLVMARMCodeGen.a  /home/ziad/GSoC/Swift/build/Ninja+cmark-DebugAssert+llvm-ReleaseAssert+swift-DebugAssert+stdlib-Release/llvm-linux-x86_64/lib/libLLVMARMAsmParser.a  /home/ziad/GSoC/Swift/build/Ninja+cmark-DebugAssert+llvm-ReleaseAssert+swift-DebugAssert+stdlib-Release/llvm-linux-x86_64/lib/libLLVMARMDisassembler.a  /home/ziad/GSoC/Swift/build/Ninja+cmark-DebugAssert+llvm-ReleaseAssert+swift-DebugAssert+stdlib-Release/llvm-linux-x86_64/lib/libLLVMARMDesc.a  /home/ziad/GSoC/Swift/build/Ninja+cmark-DebugAssert+llvm-ReleaseAssert+swift-DebugAssert+stdlib-Release/llvm-linux-x86_64/lib/libLLVMARMInfo.a  /home/ziad/GSoC/Swift/build/Ninja+cmark-DebugAssert+llvm-ReleaseAssert+swift-DebugAssert+stdlib-Release/llvm-linux-x86_64/lib/libLLVMARMUtils.a  /home/ziad/GSoC/Swift/build/Ninja+cmark-DebugAssert+llvm-ReleaseAssert+swift-DebugAssert+stdlib-Release/llvm-linux-x86_64/lib/libLLVMAArch64CodeGen.a  /home/ziad/GSoC/Swift/build/Ninja+cmark-DebugAssert+llvm-ReleaseAssert+swift-DebugAssert+stdlib-Release/llvm-linux-x86_64/lib/libLLVMAArch64AsmParser.a  /home/ziad/GSoC/Swift/build/Ninja+cmark-DebugAssert+llvm-ReleaseAssert+swift-DebugAssert+stdlib-Release/llvm-linux-x86_64/lib/libLLVMAArch64Disassembler.a  /home/ziad/GSoC/Swift/build/Ninja+cmark-DebugAssert+llvm-ReleaseAssert+swift-DebugAssert+stdlib-Release/llvm-linux-x86_64/lib/libLLVMAArch64Desc.a  /home/ziad/GSoC/Swift/build/Ninja+cmark-DebugAssert+llvm-ReleaseAssert+swift-DebugAssert+stdlib-Release/llvm-linux-x86_64/lib/libLLVMAArch64Info.a  /home/ziad/GSoC/Swift/build/Ninja+cmark-DebugAssert+llvm-ReleaseAssert+swift-DebugAssert+stdlib-Release/llvm-linux-x86_64/lib/libLLVMAArch64Utils.a  /home/ziad/GSoC/Swift/build/Ninja+cmark-DebugAssert+llvm-ReleaseAssert+swift-DebugAssert+stdlib-Release/llvm-linux-x86_64/lib/libLLVMPowerPCCodeGen.a  /home/ziad/GSoC/Swift/build/Ninja+cmark-DebugAssert+llvm-ReleaseAssert+swift-DebugAssert+stdlib-Release/llvm-linux-x86_64/lib/libLLVMPowerPCAsmParser.a  /home/ziad/GSoC/Swift/build/Ninja+cmark-DebugAssert+llvm-ReleaseAssert+swift-DebugAssert+stdlib-Release/llvm-linux-x86_64/lib/libLLVMPowerPCDesc.a  /home/ziad/GSoC/Swift/build/Ninja+cmark-DebugAssert+llvm-ReleaseAssert+swift-DebugAssert+stdlib-Release/llvm-linux-x86_64/lib/libLLVMPowerPCDisassembler.a  /home/ziad/GSoC/Swift/build/Ninja+cmark-DebugAssert+llvm-ReleaseAssert+swift-DebugAssert+stdlib-Release/llvm-linux-x86_64/lib/libLLVMPowerPCInfo.a  /home/ziad/GSoC/Swift/build/Ninja+cmark-DebugAssert+llvm-ReleaseAssert+swift-DebugAssert+stdlib-Release/llvm-linux-x86_64/lib/libLLVMSystemZCodeGen.a  /home/ziad/GSoC/Swift/build/Ninja+cmark-DebugAssert+llvm-ReleaseAssert+swift-DebugAssert+stdlib-Release/llvm-linux-x86_64/lib/libLLVMSystemZAsmParser.a  /home/ziad/GSoC/Swift/build/Ninja+cmark-DebugAssert+llvm-ReleaseAssert+swift-DebugAssert+stdlib-Release/llvm-linux-x86_64/lib/libLLVMSystemZDisassembler.a  /home/ziad/GSoC/Swift/build/Ninja+cmark-DebugAssert+llvm-ReleaseAssert+swift-DebugAssert+stdlib-Release/llvm-linux-x86_64/lib/libLLVMSystemZDesc.a  /home/ziad/GSoC/Swift/build/Ninja+cmark-DebugAssert+llvm-ReleaseAssert+swift-DebugAssert+stdlib-Release/llvm-linux-x86_64/lib/libLLVMSystemZInfo.a  /home/ziad/GSoC/Swift/build/Ninja+cmark-DebugAssert+llvm-ReleaseAssert+swift-DebugAssert+stdlib-Release/llvm-linux-x86_64/lib/libLLVMMipsCodeGen.a  /home/ziad/GSoC/Swift/build/Ninja+cmark-DebugAssert+llvm-ReleaseAssert+swift-DebugAssert+stdlib-Release/llvm-linux-x86_64/lib/libLLVMMipsAsmParser.a  /home/ziad/GSoC/Swift/build/Ninja+cmark-DebugAssert+llvm-ReleaseAssert+swift-DebugAssert+stdlib-Release/llvm-linux-x86_64/lib/libLLVMMipsDesc.a  /home/ziad/GSoC/Swift/build/Ninja+cmark-DebugAssert+llvm-ReleaseAssert+swift-DebugAssert+stdlib-Release/llvm-linux-x86_64/lib/libLLVMMipsDisassembler.a  /home/ziad/GSoC/Swift/build/Ninja+cmark-DebugAssert+llvm-ReleaseAssert+swift-DebugAssert+stdlib-Release/llvm-linux-x86_64/lib/libLLVMMipsInfo.a  /home/ziad/GSoC/Swift/build/Ninja+cmark-DebugAssert+llvm-ReleaseAssert+swift-DebugAssert+stdlib-Release/llvm-linux-x86_64/lib/libLLVMRISCVCodeGen.a  /home/ziad/GSoC/Swift/build/Ninja+cmark-DebugAssert+llvm-ReleaseAssert+swift-DebugAssert+stdlib-Release/llvm-linux-x86_64/lib/libLLVMGlobalISel.a  /home/ziad/GSoC/Swift/build/Ninja+cmark-DebugAssert+llvm-ReleaseAssert+swift-DebugAssert+stdlib-Release/llvm-linux-x86_64/lib/libLLVMRISCVAsmParser.a  /home/ziad/GSoC/Swift/build/Ninja+cmark-DebugAssert+llvm-ReleaseAssert+swift-DebugAssert+stdlib-Release/llvm-linux-x86_64/lib/libLLVMRISCVDisassembler.a  /home/ziad/GSoC/Swift/build/Nin
lib/libswiftMacroEvaluation.a(Macros.swift.o):Macros.swift.o:function $s20swiftMacroEvaluation018expandFreestandingB013diagEnginePtr05macroH017discriminatorText03rawB4Role010sourceFileH00n8LocationH0017expandedSourceOutH0SiSv_SVSPys4Int8VGs5UInt8VSVSPyANGSgSpySo16BridgedStringRefVGtF:(.text.$s20swiftMacroEvaluation018expandFreestandingB013diagEnginePtr05macroH017discriminatorText03rawB4Role010sourceFileH00n8LocationH0017expandedSourceOutH0SiSv_SVSPys4Int8VGs5UInt8VSVSPyANGSgSpySo16BridgedStringRefVGtF+0x5bb): error: undefined reference to '$ss27_allocateUninitializedArrayySayxG_BptBwlFyp_Tg5'
lib/libswiftASTGen.a(Bridge.swift.o):Bridge.swift.o:function $s22_CompilerSwiftIfConfig12VersionTupleV11swiftASTGenE7bridgedSo07BridgedeF0Vvg:(.text.$s22_CompilerSwiftIfConfig12VersionTupleV11swiftASTGenE7bridgedSo07BridgedeF0Vvg+0x3a): error: undefined reference to '$sSa5countSivgSi_Tg5'
lib/libswiftASTGen.a(Bridge.swift.o):Bridge.swift.o:function $s22_CompilerSwiftIfConfig12VersionTupleV11swiftASTGenE7bridgedSo07BridgedeF0Vvg:(.text.$s22_CompilerSwiftIfConfig12VersionTupleV11swiftASTGenE7bridgedSo07BridgedeF0Vvg+0x7e): error: undefined reference to '$sSayxSicigSi_Tg5'
lib/libswiftASTGen.a(Bridge.swift.o):Bridge.swift.o:function $s22_CompilerSwiftIfConfig12VersionTupleV11swiftASTGenE7bridgedSo07BridgedeF0Vvg:(.text.$s22_CompilerSwiftIfConfig12VersionTupleV11swiftASTGenE7bridgedSo07BridgedeF0Vvg+0x148): error: undefined reference to '$sSayxSicigSi_Tg5'
lib/libswiftASTGen.a(Bridge.swift.o):Bridge.swift.o:function $s22_CompilerSwiftIfConfig12VersionTupleV11swiftASTGenE7bridgedSo07BridgedeF0Vvg:(.text.$s22_CompilerSwiftIfConfig12VersionTupleV11swiftASTGenE7bridgedSo07BridgedeF0Vvg+0x26c): error: undefined reference to '$sSayxSicigSi_Tg5'
lib/libswiftASTGen.a(Bridge.swift.o):Bridge.swift.o:function $s22_CompilerSwiftIfConfig12VersionTupleV11swiftASTGenE7bridgedSo07BridgedeF0Vvg:(.text.$s22_CompilerSwiftIfConfig12VersionTupleV11swiftASTGenE7bridgedSo07BridgedeF0Vvg+0x390): error: undefined reference to '$sSayxSicigSi_Tg5'
lib/libswiftASTGen.a(DiagnosticsBridge.swift.o):DiagnosticsBridge.swift.o:function $s11swiftASTGen19addQueuedDiagnostic20queuedDiagnosticsPtr011perFrontende5StateH04text8severity4cLoc12categoryName17documentationPath015highlightRangesH0012numHighlightT013fixItsUntypedySv_SvSo16BridgedStringRefVSo0zE8SeverityVSo0z6SourceN0VA2NSPySo0Z15CharSourceRangeVGSgSiSo0Z8ArrayRefVtF:(.text.$s11swiftASTGen19addQueuedDiagnostic20queuedDiagnosticsPtr011perFrontende5StateH04text8severity4cLoc12categoryName17documentationPath015highlightRangesH0012numHighlightT013fixItsUntypedySv_SvSo16BridgedStringRefVSo0zE8SeverityVSo0z6SourceN0VA2NSPySo0Z15CharSourceRangeVGSgSiSo0Z8ArrayRefVtF+0x97a): error: undefined reference to '$sSlss16IndexingIteratorVyxG0B0RtzrlE04makeB0ACyFSnySiG_Tg5'
lib/libswiftASTGen.a(DiagnosticsBridge.swift.o):DiagnosticsBridge.swift.o:function $s11swiftASTGen19addQueuedDiagnostic20queuedDiagnosticsPtr011perFrontende5StateH04text8severity4cLoc12categoryName17documentationPath015highlightRangesH0012numHighlightT013fixItsUntypedySv_SvSo16BridgedStringRefVSo0zE8SeverityVSo0z6SourceN0VA2NSPySo0Z15CharSourceRangeVGSgSiSo0Z8ArrayRefVtF:(.text.$s11swiftASTGen19addQueuedDiagnostic20queuedDiagnosticsPtr011perFrontende5StateH04text8severity4cLoc12categoryName17documentationPath015highlightRangesH0012numHighlightT013fixItsUntypedySv_SvSo16BridgedStringRefVSo0zE8SeverityVSo0z6SourceN0VA2NSPySo0Z15CharSourceRangeVGSgSiSo0Z8ArrayRefVtF+0x9ba): error: undefined reference to '$ss16IndexingIteratorV4next7ElementQzSgyFSnySiG_Tg5'
lib/libswiftASTGen.a(Exprs.swift.o):Exprs.swift.o:function $s11swiftASTGen0B7VisitorV8generate11closureExprSo07BridgedF0V20_CompilerSwiftSyntax07ClosurefJ0V_tF:(.text+0x74a): error: undefined reference to '$sSlss16IndexingIteratorVyxG0B0RtzrlE04makeB0ACyFSNySiG_Tg5'
lib/libswiftASTGen.a(Exprs.swift.o):Exprs.swift.o:function $s11swiftASTGen0B7VisitorV8generate11closureExprSo07BridgedF0V20_CompilerSwiftSyntax07ClosurefJ0V_tF:(.text+0x776): error: undefined reference to '$ss16IndexingIteratorV4next7ElementQzSgyFSNySiG_Tg5'
lib/libswiftASTGen.a(LexicalLookup.swift.o):LexicalLookup.swift.o:function $sSS11swiftASTGenE14addPaddingUpTo33_CFA2C99ADB37D26A26D800A9461D085FLL10charactersSSSi_tF:(.text+0x1594): error: undefined reference to '$sSlss16IndexingIteratorVyxG0B0RtzrlE04makeB0ACyFSnySiG_Tg5'
lib/libswiftASTGen.a(LexicalLookup.swift.o):LexicalLookup.swift.o:function $sSS11swiftASTGenE14addPaddingUpTo33_CFA2C99ADB37D26A26D800A9461D085FLL10charactersSSSi_tF:(.text+0x15a9): error: undefined reference to '$ss16IndexingIteratorV4next7ElementQzSgyFSnySiG_Tg5'
lib/libswiftASTGen.a(LexicalLookup.swift.o):LexicalLookup.swift.o:function $sSS11swiftASTGenE14addPaddingUpTo33_CFA2C99ADB37D26A26D800A9461D085FLL10charactersSSSi_tF:(.text+0x16d2): error: undefined reference to '$sSlss16IndexingIteratorVyxG0B0RtzrlE04makeB0ACyFSnySiG_Tg5'
lib/libswiftASTGen.a(LexicalLookup.swift.o):LexicalLookup.swift.o:function $sSS11swiftASTGenE14addPaddingUpTo33_CFA2C99ADB37D26A26D800A9461D085FLL10charactersSSSi_tF:(.text+0x16f3): error: undefined reference to '$ss16IndexingIteratorV4next7ElementQzSgyFSnySiG_Tg5'
lib/libswiftASTGen.a(LexicalLookup.swift.o):LexicalLookup.swift.o:function $s11swiftASTGen18astConsumedResults33_CFA2C99ADB37D26A26D800A9461D085FLL10sourceFile0C14ScopeResultRefSayAA0d6LookupQ0ACLLCGSPyAA014ExportedSourceO0VG_So012BridgedArrayR0VtFAGSgSo0vdsQ0VXEfU_:(.text+0x4920): error: undefined reference to '$ss27_allocateUninitializedArrayySayxG_BptBwlFyp_Tg5'
lib/libswiftASTGen.a(LexicalLookup.swift.o):LexicalLookup.swift.o:function $s11swiftASTGen17unqualifiedLookup13sourceFilePtr10astContext8lookupAt23finishInSequentialScope0hO9ResultRefSbSv_So17BridgedASTContextVSo0R9SourceLocVSbSo0r5ArrayQ0VtF:(.text.$s11swiftASTGen17unqualifiedLookup13sourceFilePtr10astContext8lookupAt23finishInSequentialScope0hO9ResultRefSbSv_So17BridgedASTContextVSo0R9SourceLocVSbSo0r5ArrayQ0VtF+0x9bc): error: undefined reference to '$ss27_allocateUninitializedArrayySayxG_BptBwlFyp_Tg5'
/home/ziad/GSoC/Swift/swift/lib/ASTGen/Sources/ASTGen/StableHasher.swift:0: error: undefined reference to '$sSlss16IndexingIteratorVyxG0B0RtzrlE04makeB0ACyFSnySiG_Tg5'
/home/ziad/GSoC/Swift/swift/lib/ASTGen/Sources/ASTGen/StableHasher.swift:0: error: undefined reference to '$ss16IndexingIteratorV4next7ElementQzSgyFSnySiG_Tg5'
/home/ziad/GSoC/Swift/swift-experimental-string-processing/Sources/_RegexParser/Regex/Printing/DumpAST.swift:61: error: undefined reference to '$sSa5countSivgSS_Tg5'
/home/ziad/GSoC/Swift/swift-experimental-string-processing/Sources/_RegexParser/Regex/Printing/DumpAST.swift:62: error: undefined reference to '$sSayxSicigSS_Tg5'
clang++: error: linker command failed with exit code 1 (use -v to see invocation)
ninja: build stopped: subcommand failed.
ERROR: command `['/home/ziad/GSoC/Swift/swift/utils/build-script-impl', '--workspace', '/home/ziad/GSoC/Swift', '--build-dir', '/home/ziad/GSoC/Swift/build/Ninja+cmark-DebugAssert+llvm-ReleaseAssert+swift-DebugAssert+stdlib-Release', '--install-prefix', '/usr', '--host-target', 'linux-x86_64', '--stdlib-deployment-targets=linux-x86_64', '--host-cc', '/usr/local/bin/swift/usr/bin/clang', '--host-cxx', '/usr/local/bin/swift/usr/bin/clang++', '--darwin-xcrun-toolchain', 'default', '--darwin-deployment-version-osx=13.0', '--darwin-deployment-version-ios=16.0', '--darwin-deployment-version-tvos=16.0', '--darwin-deployment-version-watchos=6.0', '--darwin-deployment-version-xros=1.0', '--cmake', '/home/ziad/GSoC/Swift/build/cmake-linux-x86_64/bin/cmake', '--llvm-build-type', 'Release', '--swift-build-type', 'Debug', '--swift-stdlib-build-type', 'Release', '--lldb-build-type', 'Release', '--foundation-build-type', 'Release', '--libdispatch-build-type', 'Release', '--xctest-build-type', 'Release', '--llbuild-build-type', 'Release', '--swift-enable-assertions', 'true', '--swift-stdlib-enable-assertions', 'false', '--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', '4', '--lit-jobs', '4', '--common-cmake-options=-G Ninja -DCMAKE_C_COMPILER:PATH=/usr/local/bin/swift/usr/bin/clang -DCMAKE_CXX_COMPILER:PATH=/usr/local/bin/swift/usr/bin/clang++ -DCMAKE_Swift_COMPILER:PATH=/usr/local/bin/swift/usr/bin/swiftc -DCMAKE_LIBTOOL:PATH= -DCMAKE_AR:PATH=/usr/bin/ar -DCMAKE_RANLIB:PATH=/usr/bin/ranlib -DLLVM_VERSION_MAJOR:STRING=17 -DLLVM_VERSION_MINOR:STRING=0 -DLLVM_VERSION_PATCH:STRING=0 -DCLANG_VERSION_MAJOR:STRING=17 -DCLANG_VERSION_MINOR:STRING=0 -DCLANG_VERSION_PATCH:STRING=0 -DCMAKE_MAKE_PROGRAM=/usr/bin/ninja', '--build-args=-j4', '--dsymutil-jobs', '1', '--build-swift-libexec', 'true', '--swift-enable-backtracing', 'true', '--build-swift-clang-overlays', 'true', '--build-swift-remote-mirror', 'true', '--swift-source-dirname', 'swift', '--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_CXX_INTEROP:BOOL=TRUE -DSWIFT_ENABLE_CXX_INTEROP_SWIFT_BRIDGING_HEADER:BOOL=TRUE -DSWIFT_ENABLE_EXPERIMENTAL_DISTRIBUTED:BOOL=TRUE -DSWIFT_ENABLE_BACKTRACING:BOOL=TRUE -DSWIFT_ENABLE_EXPERIMENTAL_OBSERVATION:BOOL=TRUE -DSWIFT_ENABLE_SYNCHRONIZATION:BOOL=TRUE -DSWIFT_ENABLE_VOLATILE:BOOL=TRUE -DSWIFT_ENABLE_RUNTIME_MODULE: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_SHOULD_BUILD_EMBEDDED_STDLIB=TRUE -DSWIFT_SHOULD_BUILD_EMBEDDED_STDLIB_CROSS_COMPILING=FALSE -DSWIFT_STDLIB_BUILD_SYMBOL_GRAPHS:BOOL=FALSE -DSWIFT_TOOLS_LD64_LTO_CODEGEN_ONLY_FOR_SUPPORTING_TARGETS:BOOL=FALSE -DSWIFT_ENABLE_EXPERIMENTAL_PARSER_VALIDATION:BOOL=TRUE -USWIFT_DEBUGINFO_NON_LTO_ARGS -DSWIFT_ENABLE_NEW_RUNTIME_BUILD:BOOL=FALSE', '--build-stdlib-deployment-targets', 'all', '--ninja-bin=/usr/bin/ninja', '--install-destdir', '/home/ziad/GSoC/Swift/build/Ninja+cmark-DebugAssert+llvm-ReleaseAssert+swift-DebugAssert+stdlib-Release/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-libxml2', '--skip-build-zlib', '--skip-build-curl', '--build-swift-dynamic-stdlib', '--build-swift-dynamic-sdk-overlay', '--skip-build-android', '--skip-test-swift', '--skip-test-lldb', '--skip-test-llbuild', '--skip-test-xctest', '--skip-test-foundation', '--skip-test-libdispatch', '--skip-test-benchmarks', '--android-deploy-device-path', '/data/local/tmp', '--extra-cmake-options=-USWIFT_DARWIN_SUPPORTED_ARCHS -DSWIFT_PATH_TO_SWIFT_SYNTAX_SOURCE:PATH=/home/ziad/GSoC/Swift/swift-syntax -DSWIFT_BUILD_SWIFT_SYNTAX:BOOL=TRUE -DSWIFTSYNTAX_ENABLE_ASSERTIONS:BOOL=TRUE -DSWIFT_EARLY_SWIFT_DRIVER_BUILD=/home/ziad/GSoC/Swift/build/Ninja+cmark-DebugAssert+llvm-ReleaseAssert+swift-DebugAssert+stdlib-Release/earlyswiftdriver-linux-x86_64/debug/bin', '--llvm-lit-args=-sv --param color_output', '--llvm-install-components=llvm-ar;llvm-cov;llvm-profdata;IndexStore;clang;clang-resource-headers;compiler-rt;clangd;LTO;lld', '--musl-path=/usr/local/musl', '--linux-static-archs=x86_64;aarch64', '--only-execute', 'linux-x86_64-swift-build']` terminated with a non-zero exit status 1, aborting

Do you have any suggestions to solve these errors ?

This is the error that I have seen as well:

Thank you for the context.
So there is not solution so far , right ?

Swift is regularly built successfully on stable versions of Ubuntu, as you can see from CI logs:

To replicate builds off main locally:

  1. Make sure you have everything checked out in sync with update-checkout from the main scheme. Frequently, when you keep updating only a single repository but not other repositories, they go out of sync due to breaking API changes.
  2. Make sure you have all of the dependencies installed, the exact list of dependencies for building the toolchain is available in the swift-ci directory in Dockerfiles corresponding to the distribution you're building on, for example here's one for Ubuntu 22.04 swift-docker/swift-ci/main/ubuntu/22.04/Dockerfile at main · swiftlang/swift-docker · GitHub.
  3. Make sure you have enough RAM available for the build process, some linker jobs may need 16 GB or more for large binaries.
  4. Build with the exactly same preset and exactly the same invocation of build-script as on CI. For example, on Linux the invocation that produces toolchain distributions ready for installation is this one
./swift/utils/build-script --preset buildbot_linux install_destdir=/home/build-user/swift-nightly-install installable_package=/home/build-user/swift-DEVELOPMENT-SNAPSHOT-2025-04-06-a-ubuntu2204.tar.gz'
  1. Lastly, if you have any trouble replicating the build in your environment, you can use the CI Dockerfile I linked above and build everything in a container to replicate the CI environment as closely as possible.
1 Like

i see , i think the problem is that i use Ubuntu 24.04
I saw the ci logs here [main] OSS - Swift Package - Ubuntu 24.04 [Jenkins]
and i think it's failing with me because of that.
but I'll try at first to work through the steps you've mentioned and see how it will be ended.

1 Like

You missed the flags that he is using: he's passing in --debug-swift, which is currently broken. I asked him weeks ago why he was using that flag and he didn't respond.

2 Likes

@Finagolfin sorry if i didn't respond to your message!
i'm using this flag because it generate some debug symbols that i can use in the debugging process with lldb.
sorry again i think i didn't notice that you are asking about it!

If you're having issues with --debug-swift, have you tried using --debug instead? It builds the debug variant of everything—Clang, LLVM, Swift standard libraries, etc.

That said, I still suspect your system’s limited RAM might be the issue, as I mentioned earlier. You said you have exactly 16GB, whereas the guide recommends at least that much. If you’re able to upgrade your RAM or have access to a machine with more than 16GB (note that VMs or emulators require over 32GB, as the guide states), it’s worth trying the build there to help rule out whether your current hardware is the limiting factor

can i make a 16GB swap file instead ?
I'll try the build now after making 16GB swap file and i'll use the --debug flag.
Also i think i need to mention that i tried before to build using Docker container and it built successfully , but this was the first and last time.

1 Like

This one would also be problematic due to enormous persistent storage requirements and a huge amount of time it would take to build everything. Binaries would also be potentially larger, which in turn could require even more RAM to link everything.

@Ashraf is there a reason you wouldn't want to use --release-debuginfo instead?

actually i'm using the both --release-debuginfo + --debug-swift
based on the getting started guide/debugging issues
it will be a good option for the build with debugging symbols for swift

@Max_Desiatov Do you think the problem with the version of ubuntu? the Ubuntu 24.04 build is failing here as i mentioned. so i think i need to change the ubuntu version to 22.04 or 20.04

Yes, I would suggest first of all trying environments that are known to pass on CI.

1 Like

@Ashraf
Use this:

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

OK, but I believe --release-debuginfo alone also does that. The main advantage of --debug-swift is that it also turns off optimizations when building the compiler itself, which is only useful if you think some optimization might be breaking the compiler. You are unlikely to need that extra step.

Yes, --release-debuginfo is the way to go. --debug is barely manageable if at all to work with on consumer hardware due to sheer size and time it takes to shuffle around gigantic unoptimized binaries. And unoptimized compiler itself is slow.

1 Like

Hi everyone,
sorry for being too late to give you and update, i had some problem with my setup and installing ubuntu 22.04
i just installed it and was trying to build the repo on and it failed (for the 1M time XD)
and i just run this

/utils/build-script --release-debuginfo -j6

and i have this preinstalled swift version on my machine

Swift version 6.1 (swift-6.1-RELEASE)
Target: x86_64-unknown-linux-gnu

So i think the problem is with the version of the toolchain (Swift version 6.1 (swift-6.1-RELEASE))
thats because when i saw the Shell Script Console [Jenkins]
this is the output of building swift on Ubuntu 22.04 from Jenkins
i see it uses these informations

TOOLCHAIN_VERSION=swift-DEVELOPMENT-SNAPSHOT-2025-04-13-a
HOSTNAME=431db172a096
SWIFT_VERSION=5.9.2
SWIFT_INSTALL_DIR=/home/build-user/swift-nightly-install
PWD=/home/build-user
SWIFT_WEBROOT=https://download.swift.org
SWIFT_TAG=swift-5.9.2-RELEASE
HOME=/home/build-user
SWIFT_INSTALLABLE_PACKAGE=/home/build-user/swift-DEVELOPMENT-SNAPSHOT-2025-04-13-a-ubuntu2204.tar.gz
SWIFT_BRANCH=swift-5.9.2-release
OS_VERSION=ubuntu2204
PACKAGE=swift-nightly
ARCHIVE=swift-DEVELOPMENT-SNAPSHOT-2025-04-13-a-ubuntu2204.tar.gz
SWIFT_BUILD_ROOT=/home/build-user/build
SWIFT_PLATFORM=ubuntu22.04
SHLVL=1
SWIFT_SOURCE_ROOT=/home/build-user
PATH=/opt/swift/5.9.2/usr/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
GIT_ALLOW_PROTOCOL=file
SWIFT_PREFIX=/opt/swift/5.9.2
DEBIAN_FRONTEND=noninteractive
_=/usr/bin/env
Swift version 5.9.2 (swift-5.9.2-RELEASE)
Target: x86_64-unknown-linux-gnu
[./swift/utils/build-script] NOTE: using preset "buildbot_linux", which expands to 

so what do you think i should do with this ?

NOTE:
the build error is too long so i can't send it here (it crosses the max words limit)
so you can see it from here build-error.txt - Google Drive

Yes, this is quite likely to be the problem. Have you tried using exactly the same version as used on CI, 5.9.2-RELEASE?