Hi there!
I'm trying to build swift toolchain 5.9.2 on Ubuntu 20.04 without prebuilt compiler, so I did the following
mkdir swift-project
cd swift-project/
git clone https://github.com/apple/swift.git swift
cd swift/
utils/update-checkout --clone
utils/update-checkout --tag swift-5.9.2-RELEASE
then I patched buildbot_linux
preset with
skip-early-swift-driver
skip-early-swiftsyntax
and launched the compilation
utils/build-script --preset=buildbot_linux,no_test install_destdir=~/swift-install installable_package=~/swift.tar.gz
it expanded to
utils/build-script --no-assertions --no-swift-stdlib-assertions --skip-early-swift-driver --skip-early-swiftsyntax --swift-enable-ast-verifier=0 '--swift-install-components=autolink-driver;compiler;clang-resource-dir-symlink;libexec;stdlib;swift-remote-mirror;sdk-overlay;static-mirror-lib;toolchain-tools;license;sourcekit-inproc' '--llvm-install-components=llvm-ar;llvm-cov;llvm-profdata;IndexStore;clang;clang-resource-headers;compiler-rt;clangd;lld;LTO;clang-features-file' --llbuild --swiftpm --swift-driver --xctest --libicu --swiftdocc --build-ninja --install-llvm --install-swift --install-lldb --install-llbuild --install-swiftpm --install-swift-driver --install-swiftsyntax --install-xctest --install-libicu --install-prefix=/usr --install-sourcekit-lsp --install-swiftformat --install-swiftdocc --build-swift-static-stdlib --build-swift-static-sdk-overlay --build-swift-stdlib-unittest-extra --test-installable-package --toolchain-benchmarks --install-destdir=/home/zabolotniy/swift-install --installable-package=/home/zabolotniy/swift.tar.gz --relocate-xdg-cache-home-under-build-subdir --build-subdir=buildbot_linux --lldb --release --test --validation-test --long-test --stress-test --test-optimized --foundation --libdispatch --indexstore-db --sourcekit-lsp --swiftdocc '--lit-args=-v --time-tests' --lldb-test-swift-only --install-foundation --install-libdispatch --reconfigure --skip-test-cmark --skip-test-lldb --skip-test-swift --skip-test-llbuild --skip-test-swiftpm --skip-test-swift-driver --skip-test-xctest --skip-test-foundation --skip-test-libdispatch --skip-test-playgroundsupport --skip-test-libicu --skip-test-indexstore-db --skip-test-sourcekit-lsp --skip-test-swiftdocc
and finally finished with the error
--- bootstrap: note: Building SwiftPM (with a freshly built swift-bootstrap)
env SWIFTCI_USE_LOCAL_DEPS=1 SWIFTPM_MACOS_DEPLOYMENT_TARGET=10.15 LD_LIBRARY_PATH=/home/zabolotniy/swift-project/build/buildbot_linux/swiftpm-linux-x86_64/x86_64-unknown-linux-gnu/bootstrap/lib:/home/zabolotniy/swift-project/build/buildbot_linux/swiftpm-linux-x86_64/x86_64-unknown-linux-gnu/tsc/lib:/home/zabolotniy/swift-project/build/buildbot_linux/llbuild-linux-x86_64/lib:/home/zabolotniy/swift-project/build/buildbot_linux/swiftpm-linux-x86_64/x86_64-unknown-linux-gnu/yams/lib:/home/zabolotniy/swift-project/build/buildbot_linux/swiftpm-linux-x86_64/x86_64-unknown-linux-gnu/swift-argument-parser/lib:/home/zabolotniy/swift-project/build/buildbot_linux/swiftpm-linux-x86_64/x86_64-unknown-linux-gnu/swift-crypto/lib:/home/zabolotniy/swift-project/build/buildbot_linux/swiftpm-linux-x86_64/x86_64-unknown-linux-gnu/swift-driver/lib:/home/zabolotniy/swift-project/build/buildbot_linux/swiftpm-linux-x86_64/x86_64-unknown-linux-gnu/swift-system/lib:/home/zabolotniy/swift-project/build/buildbot_linux/swiftpm-linux-x86_64/x86_64-unknown-linux-gnu/swift-collections/lib:/home/zabolotniy/swift-project/build/buildbot_linux/swiftpm-linux-x86_64/x86_64-unknown-linux-gnu/swift-asn1/lib:/home/zabolotniy/swift-project/build/buildbot_linux/swiftpm-linux-x86_64/x86_64-unknown-linux-gnu/swift-certificates/lib:/home/zabolotniy/swift-install/usr/lib/swift/linux SWIFT_EXEC=/home/zabolotniy/swift-install/usr/bin/swiftc SWIFT_DRIVER_SWIFT_EXEC=/home/zabolotniy/swift-install/usr/bin/swiftc CC=/home/zabolotniy/swift-install/usr/bin/clang SWIFTPM_CUSTOM_LIBS_DIR=/home/zabolotniy/swift-project/build/buildbot_linux/swiftpm-linux-x86_64/x86_64-unknown-linux-gnu/bootstrap/pm /home/zabolotniy/swift-project/build/buildbot_linux/swiftpm-linux-x86_64/x86_64-unknown-linux-gnu/bootstrap/bin/swift-bootstrap --build-path /home/zabolotniy/swift-project/build/buildbot_linux/swiftpm-linux-x86_64 --configuration release -Xswiftc -module-cache-path -Xswiftc /home/zabolotniy/swift-project/build/buildbot_linux/swiftpm-linux-x86_64/module-cache -Xmanifest -module-cache-path -Xmanifest /home/zabolotniy/swift-project/build/buildbot_linux/swiftpm-linux-x86_64/module-cache
[warning]: found 1 file(s) which are unhandled; explicitly declare them as resources or exclude from the target
/home/zabolotniy/swift-project/swiftpm/Sources/swift-package-registry/CMakeLists.txt
[warning]: found 1 file(s) which are unhandled; explicitly declare them as resources or exclude from the target
/home/zabolotniy/swift-project/swiftpm/Sources/swift-package-collection/CMakeLists.txt
[warning]: found 1 file(s) which are unhandled; explicitly declare them as resources or exclude from the target
/home/zabolotniy/swift-project/swiftpm/Sources/PackageRegistryTool/CMakeLists.txt
[warning]: found 1 file(s) which are unhandled; explicitly declare them as resources or exclude from the target
/home/zabolotniy/swift-project/swiftpm/Sources/PackageMetadata/CMakeLists.txt
[warning]: found 1 file(s) which are unhandled; explicitly declare them as resources or exclude from the target
/home/zabolotniy/swift-project/swiftpm/Sources/PackageDescription/PackageDescription.docc
[warning]: found 1 file(s) which are unhandled; explicitly declare them as resources or exclude from the target
/home/zabolotniy/swift-project/swiftpm/Sources/PackageCollectionsTool/CMakeLists.txt
[warning]: found 1 file(s) which are unhandled; explicitly declare them as resources or exclude from the target
/home/zabolotniy/swift-project/swiftpm/Sources/PackageCollectionsSigning/CMakeLists.txt
[warning]: found 1 file(s) which are unhandled; explicitly declare them as resources or exclude from the target
/home/zabolotniy/swift-project/swiftpm/Sources/PackageCollectionsModel/CMakeLists.txt
[warning]: found 1 file(s) which are unhandled; explicitly declare them as resources or exclude from the target
/home/zabolotniy/swift-project/swiftpm/Sources/PackageCollections/CMakeLists.txt
Building for production...
/home/zabolotniy/swift-project/swift-tools-support-core/Sources/TSCBasic/Condition.swift:16:17: warning: stored property '_condition' of 'Sendable'-conforming struct 'Condition' has non-sendable type 'NSCondition'
private let _condition = NSCondition()
^
Foundation.NSCondition:1:12: note: class 'NSCondition' does not conform to the 'Sendable' protocol
open class NSCondition : NSObject, NSLocking {
^
/home/zabolotniy/swift-project/swift-tools-support-core/Sources/TSCBasic/Condition.swift:11:1: remark: add '@preconcurrency' to suppress 'Sendable'-related warnings from module 'Foundation'
import Foundation
^
@preconcurrency
/home/zabolotniy/swift-project/swift-tools-support-core/Sources/TSCBasic/FileInfo.swift:37:16: warning: stored property 'fileType' of 'Sendable'-conforming struct 'FileInfo' has non-sendable type 'FileAttributeType'
public let fileType: FileAttributeType
^
Foundation.FileAttributeType:1:15: note: struct 'FileAttributeType' does not conform to the 'Sendable' protocol
public struct FileAttributeType : RawRepresentable, Equatable, Hashable {
^
/home/zabolotniy/swift-project/swift-tools-support-core/Sources/TSCBasic/FileInfo.swift:11:1: remark: add '@preconcurrency' to suppress 'Sendable'-related warnings from module 'Foundation'
import Foundation
^
@preconcurrency
/home/zabolotniy/swift-project/swift-tools-support-core/Sources/TSCBasic/FileSystem.swift:412:21: warning: 'init(_:)' is deprecated: use throwing `init(validating:)` variant instead
return try? AbsolutePath(String(cString: fsr))
^
/home/zabolotniy/swift-project/swift-tools-support-core/Sources/TSCBasic/FileSystem.swift:412:16: warning: no calls to throwing functions occur within 'try' expression
return try? AbsolutePath(String(cString: fsr))
^
/home/zabolotniy/swift-project/swift-tools-support-core/Sources/TSCBasic/FileSystem.swift:337:84: warning: will never be executed
func hasAttribute(_ name: FileSystemAttribute, _ path: AbsolutePath) -> Bool { false }
^
/home/zabolotniy/swift-project/swift-tools-support-core/Sources/TSCBasic/FileSystem.swift:337:82: note: 'name' is of type 'FileSystemAttribute' which cannot be constructed because it is an enum with no cases
func hasAttribute(_ name: FileSystemAttribute, _ path: AbsolutePath) -> Bool { false }
^
/home/zabolotniy/swift-project/swift-tools-support-core/Sources/TSCBasic/FileSystem.swift:395:9: warning: will never be executed
return false
^
/home/zabolotniy/swift-project/swift-tools-support-core/Sources/TSCBasic/FileSystem.swift:389:82: note: 'name' is of type 'FileSystemAttribute' which cannot be constructed because it is an enum with no cases
func hasAttribute(_ name: FileSystemAttribute, _ path: AbsolutePath) -> Bool {
^
/home/zabolotniy/swift-project/swift-tools-support-core/Sources/TSCTestSupport/Product.swift:42:21: warning: 'init(_:relativeTo:)' is deprecated: use throwing `init(validating:relativeTo:)` variant instead
return try! AbsolutePath(CommandLine.arguments.first!, relativeTo: localFileSystem.currentWorkingDirectory!)
^
/home/zabolotniy/swift-project/swift-tools-support-core/Sources/TSCTestSupport/Product.swift:42:16: warning: no calls to throwing functions occur within 'try' expression
return try! AbsolutePath(CommandLine.arguments.first!, relativeTo: localFileSystem.currentWorkingDirectory!)
^
/home/zabolotniy/swift-project/swiftpm/Sources/PackageCollectionsSigning/Key/Key+RSA.swift:113:59: error: no type named 'RSA' in module 'CCryptoBoringSSL'
let underlying: UnsafeMutablePointer<CCryptoBoringSSL.RSA>
^
/home/zabolotniy/swift-project/swiftpm/Sources/PackageCollectionsSigning/Key/Key+RSA.swift:138:59: error: no type named 'RSA' in module 'CCryptoBoringSSL'
let underlying: UnsafeMutablePointer<CCryptoBoringSSL.RSA>
^
--- bootstrap: error: Command '['env', 'SWIFTCI_USE_LOCAL_DEPS=1', 'SWIFTPM_MACOS_DEPLOYMENT_TARGET=10.15', 'LD_LIBRARY_PATH=/home/zabolotniy/swift-project/build/buildbot_linux/swiftpm-linux-x86_64/x86_64-unknown-linux-gnu/bootstrap/lib:/home/zabolotniy/swift-project/build/buildbot_linux/swiftpm-linux-x86_64/x86_64-unknown-linux-gnu/tsc/lib:/home/zabolotniy/swift-project/build/buildbot_linux/llbuild-linux-x86_64/lib:/home/zabolotniy/swift-project/build/buildbot_linux/swiftpm-linux-x86_64/x86_64-unknown-linux-gnu/yams/lib:/home/zabolotniy/swift-project/build/buildbot_linux/swiftpm-linux-x86_64/x86_64-unknown-linux-gnu/swift-argument-parser/lib:/home/zabolotniy/swift-project/build/buildbot_linux/swiftpm-linux-x86_64/x86_64-unknown-linux-gnu/swift-crypto/lib:/home/zabolotniy/swift-project/build/buildbot_linux/swiftpm-linux-x86_64/x86_64-unknown-linux-gnu/swift-driver/lib:/home/zabolotniy/swift-project/build/buildbot_linux/swiftpm-linux-x86_64/x86_64-unknown-linux-gnu/swift-system/lib:/home/zabolotniy/swift-project/build/buildbot_linux/swiftpm-linux-x86_64/x86_64-unknown-linux-gnu/swift-collections/lib:/home/zabolotniy/swift-project/build/buildbot_linux/swiftpm-linux-x86_64/x86_64-unknown-linux-gnu/swift-asn1/lib:/home/zabolotniy/swift-project/build/buildbot_linux/swiftpm-linux-x86_64/x86_64-unknown-linux-gnu/swift-certificates/lib:/home/zabolotniy/swift-install/usr/lib/swift/linux', 'SWIFT_EXEC=/home/zabolotniy/swift-install/usr/bin/swiftc', 'SWIFT_DRIVER_SWIFT_EXEC=/home/zabolotniy/swift-install/usr/bin/swiftc', 'CC=/home/zabolotniy/swift-install/usr/bin/clang', 'SWIFTPM_CUSTOM_LIBS_DIR=/home/zabolotniy/swift-project/build/buildbot_linux/swiftpm-linux-x86_64/x86_64-unknown-linux-gnu/bootstrap/pm', '/home/zabolotniy/swift-project/build/buildbot_linux/swiftpm-linux-x86_64/x86_64-unknown-linux-gnu/bootstrap/bin/swift-bootstrap', '--build-path', '/home/zabolotniy/swift-project/build/buildbot_linux/swiftpm-linux-x86_64', '--configuration', 'release', '-Xswiftc', '-module-cache-path', '-Xswiftc', '/home/zabolotniy/swift-project/build/buildbot_linux/swiftpm-linux-x86_64/module-cache', '-Xmanifest', '-module-cache-path', '-Xmanifest', '/home/zabolotniy/swift-project/build/buildbot_linux/swiftpm-linux-x86_64/module-cache']' returned non-zero exit status 1.
ERROR: command terminated with a non-zero exit status 1, aborting
ERROR: command terminated with a non-zero exit status 1, aborting
Is there something wrong with CCryptoBoringSSL
and how to fix it?