Using Swift SDKs with Raspberry PIs

Cross-compiling Swift packages has been possible for a while now using Swift SDKs, but I haven’t seen any guides or articles that show how they can be used practically with Raspberry PIs. So, I created a blog post myself! Check it out at the link below on Substack:

One thing I noticed when writing this is that there’s room for improvement for the developer experience to not only generate these Swift SDKs, but also with compiling, deploying, and running on the board itself. A lot of work has been done by the Wendy project to provide a whole OS and VSCode plugin for developers, but if you want to just use vanilla Raspberry PI OS, Debian, or Ubuntu, then the steps can be complex and maybe even tedious.

Some thoughts:

  • Would it make sense to pre-generate Swift SDKs for cross-compiling to x86_64, aarch64, and other architectures so that developers can download and install them directly instead of having to use the swift-sdk-generator?
  • How about creating some cool one-liner scripts that could help with generating and installing these Swift SDKs? I think of an interactive script that could ask questions about what target, Swift version, and distribution you want to create a Swift SDK for, which would then do all the work for you behind the scenes.
3 Likes