From cb6fa961df751ea6db6a091a92e25dc308931bcc Mon Sep 17 00:00:00 2001 From: Owen Voorhees Date: Fri, 14 Nov 2025 12:34:19 -0800 Subject: [PATCH 1/2] Add static linux SDK actions coverage --- .github/workflows/pull_request.yml | 2 ++ Package.swift | 11 +++++++++++ 2 files changed, 13 insertions(+) diff --git a/.github/workflows/pull_request.yml b/.github/workflows/pull_request.yml index c81ce761..fbbee69d 100644 --- a/.github/workflows/pull_request.yml +++ b/.github/workflows/pull_request.yml @@ -19,6 +19,8 @@ jobs: linux_os_versions: '["amazonlinux2", "bookworm", "noble", "jammy", "rhel-ubi9"]' linux_swift_versions: '["nightly-main", "nightly-6.2"]' linux_build_command: 'swift build' + enable_linux_static_sdk_build: true + linux_static_sdk_build_command: SWIFTTOOLSSUPPORTCORE_STATIC_LINK=1 swift build windows_swift_versions: '["nightly-main"]' windows_build_command: 'Invoke-Program swift build' enable_android_sdk_build: true diff --git a/Package.swift b/Package.swift index 16a036b3..53cb3adb 100644 --- a/Package.swift +++ b/Package.swift @@ -27,6 +27,8 @@ if let deploymentTarget = ProcessInfo.processInfo.environment["SWIFTTSC_IOS_DEPL iOSPlatform = .iOS(.v13) } +let isStaticBuild = ProcessInfo.processInfo.environment["SWIFTTOOLSSUPPORTCORE_STATIC_LINK"] != nil + let CMakeFiles = ["CMakeLists.txt"] let package = Package( @@ -115,3 +117,12 @@ let package = Package( exclude: ["pkgconfigInputs", "Inputs"]), ] ) + +if isStaticBuild { + package.targets = package.targets.filter { target in + target.type != .test && !target.name.hasSuffix("TestSupport") + } + package.products = package.products.filter { product in + !product.name.hasSuffix("TestSupport") + } +} From b3ece3662ceb2721f75d5a1205af107be91c901d Mon Sep 17 00:00:00 2001 From: Jake Petroules Date: Tue, 18 Nov 2025 22:59:27 -0800 Subject: [PATCH 2/2] Filter out 'SwiftToolsSupport' from products The static Linux SDK is fully statically linked so we can't build shared libraries there. --- Package.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Package.swift b/Package.swift index 53cb3adb..18ece6db 100644 --- a/Package.swift +++ b/Package.swift @@ -123,6 +123,6 @@ if isStaticBuild { target.type != .test && !target.name.hasSuffix("TestSupport") } package.products = package.products.filter { product in - !product.name.hasSuffix("TestSupport") + !product.name.hasSuffix("TestSupport") && product.name != "SwiftToolsSupport" } }