From 302262bbad6c1fe595c822c40623dfa35d1c8a81 Mon Sep 17 00:00:00 2001 From: Jake Petroules Date: Wed, 29 Oct 2025 01:05:02 -0700 Subject: [PATCH] Enable more CI variations This project acts as something of a canary since it can build for virtually every target imaginable, add the axes it's missing. --- .github/workflows/pull_request.yml | 2 ++ Package.swift | 21 +++++++++++++++------ 2 files changed, 17 insertions(+), 6 deletions(-) diff --git a/.github/workflows/pull_request.yml b/.github/workflows/pull_request.yml index 476e41b..5d2175e 100644 --- a/.github/workflows/pull_request.yml +++ b/.github/workflows/pull_request.yml @@ -12,6 +12,7 @@ jobs: name: Test uses: swiftlang/github-workflows/.github/workflows/swift_package_test.yml@main with: + linux_os_versions: '["amazonlinux2", "bookworm", "noble", "jammy", "rhel-ubi9"]' linux_build_command: "swift build" linux_exclude_swift_versions: '[{"swift_version": "5.8"}, {"swift_version": "5.9"}, {"swift_version": "5.10"}]' windows_build_command: "Invoke-Program swift build" @@ -22,6 +23,7 @@ jobs: enable_ios_checks: true enable_linux_static_sdk_build: true enable_wasm_sdk_build: true + enable_embedded_wasm_sdk_build: true enable_android_sdk_build: true soundness: diff --git a/Package.swift b/Package.swift index cf7e3e7..5202278 100644 --- a/Package.swift +++ b/Package.swift @@ -29,18 +29,27 @@ let package = Package( .linkedLibrary("wasi-emulated-signal", .when(platforms: [.wasi])), .linkedLibrary("wasi-emulated-process-clocks", .when(platforms: [.wasi])), .linkedLibrary("wasi-emulated-getpid", .when(platforms: [.wasi])), + .linkedLibrary("dl", .when(platforms: [.linux])), .linkedLibrary("m", .when(platforms: [.linux, .android])), - .linkedLibrary("pthread", .when(platforms: [.custom("freebsd")])), + .linkedLibrary("pthread", .when(platforms: [.linux, .custom("freebsd")])), ] ), .target( name: "SwiftToolchainCSQLite", path: "Sources/CSQLite", - publicHeadersPath: "include", - linkerSettings: [ - // Needed for swift_addNewDSOImage - .linkedLibrary("swiftCore", .when(platforms: [.windows, .wasi])) - ] + publicHeadersPath: "include" ), ] ) + +// Workaround for: undefined symbol: swift_addNewDSOImage +// (this should be resolved by Swift Build becoming the default build system) +if Context.environment["GITHUB_JOB"] != "embedded-wasm-sdk-build" { + for target in package.targets { + if target.name == "SwiftToolchainCSQLite" { + target.linkerSettings = [ + .linkedLibrary("swiftCore", .when(platforms: [.windows, .wasi])) + ] + } + } +}