swiftlang / swift-docker

Docker Official Image packaging for Swift
https://swift.org
Apache License 2.0
1.37k stars 184 forks source link

The new Musl SDK does not include XCTest #396

Open finagolfin opened 5 months ago

finagolfin commented 5 months ago

I've been trying out the new 6.0 and 6.1 Musl SDKs to build some packages and they work great.

However, the lack of XCTest means I cannot run the tests for these packages against Musl, as the build of the Musl SDK stops with swift-corelibs-foundation.

@al45tair, any reason XCTest can't be included also? It would be great if I can run the tests.

al45tair commented 5 months ago

Including XCTest wouldn't be as useful as you'd think — you couldn't use swift test to trigger them, because when you're using an SDK, you're cross-compiling, and SwiftPM doesn't know how to run cross-tests yet (notably doing so would mean you'd have to specify somehow how to start the tests, because they might not run on the host machine; in the specific case of the Static SDK for Linux, it's a bit odd because if you're on a Linux or FreeBSD machine then you might actually be able to run the tests on the host, but that's a special case and SwiftPM has no way to know that that would work either).

finagolfin commented 5 months ago

As you said, if you happen to be building on the same OS/arch, you should be able to run the tests, and I'm one of the few who knows how to run cross-compiled tests manually too. 😉

Btw, you've inspired me to finally put together SDK bundles for Android. I had been putting off looking at how Max's swift-sdk-generator worked and adapting that for Android, but I think I'll just script it myself for now, as you did.