-
Notifications
You must be signed in to change notification settings - Fork 23
Open
Labels
bugSomething isn't workingSomething isn't working
Description
I found that it's totally possible to create an invalid Swift SDK by passing an incomplete triple to --target
, like this:
swift run swift-sdk-generator make-linux-sdk --target aarch64
This generates a swift-sdk.json file with an invalid triple:
{
"schemaVersion" : "4.0",
"targetTriples" : {
"aarch64" : {
"sdkRootPath" : "ubuntu-jammy.sdk",
"swiftResourcesPath" : "ubuntu-jammy.sdk/usr/lib/swift",
"swiftStaticResourcesPath" : "ubuntu-jammy.sdk/usr/lib/swift_static",
"toolsetPaths" : [
"toolset.json"
]
}
}
}
No warning is thrown and it takes the invalid triple like a champ. This Swift SDK fails to cross-compile properly as the compiler doesn't quite know what platform we're trying to use. At a minimum the triple should contain:
- arch: aarch64
- platform: linux- this should be enforced for
make-linux-sdk
. - abi: gnu, gnueabihf, etc
We should validate the triple that is passed to ensure we have the right fields, and throw an error if an incomplete triple is passed at the CLI.
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working