When building a Swift package using the September 11, 2024 Swift 6 toolchain and matching Static Linux SDK, compilation fails with error: missing required module '_FoundationCollections'
% xcrun --toolchain swift swift build --swift-sdk aarch64-swift-linux-musl
Building for debugging...
error: emit-module command failed with exit code 1 (use -v to see invocation)
<unknown>:0: error: missing required module '_FoundationCollections'
<unknown>:0: error: missing required module '_FoundationCollections'
System info
OS: macOS 14.6.1
Xcode: 16.0 public release, 16.0 release candidate, 15.4
Swift: Apple Swift version 6.0-dev (LLVM fc1036139c5e562, Swift 5bbf725fd958d34) Target: arm64-apple-macosx14.0
Static Linux SDK swift-6.0-DEVELOPMENT-SNAPSHOT-2024-09-11-a_static-linux-0.0.1
Package
Package.swift
// swift-tools-version: 6.0
import PackageDescription
let package = Package(
name: "FoundationTest",
targets: [
.executableTarget(name: "FoundationTest")
]
)
Sources/FoundationTest/FoundationTest.swift
import Foundation
@main
struct App {
static func main() async throws {
print("Hello World!")
}
}