I had a quick question that maybe someone can answer. I have built my own Swift (experimental) SDK that cross compiles to a custom armv7 platform and it works well when using Swift 6.0 and the swift sdk install and swift build --swift-sdk commands and so forth.
My question is- is there a way to pre-install an SDK somewhere in the system where swift sdk can find it, instead of having to have it at ~/.swiftpm/swift-sdks? I am building a Docker container that I intend to use as a VSCode Dev Container, but the user does not exist at the time of creation. So I was curious if there was a system path like /usr/share/swiftpm or something else that would be recognized.
Worst case I would have to just create the user in the Dockerfile and deploy the SDK to the user's .swiftpm/swift-sdks directory manually. But, still wanted to ask in case anyone knew.
You can set a custom SDK path when building, take a look at the help:
> ./swift-6.0-DEVELOPMENT-SNAPSHOT-2024-07-02-a-ubi9/usr/bin/swift build -h|ag swift-sdk -A1
--swift-sdks-path <swift-sdks-path>
Path to the directory containing installed Swift SDKs
--swift-sdk <swift-sdk> Filter for selecting a specific Swift SDK to build
with
1 Like
Nice, I didn’t realize this was an option. Looks like it has to be passed when running swift build but I can use this from a script that automatically compiles and strips the binary for the platform.