spinframework / spinframework/spin
Spin build, for swiftwasm, uses 'swiftc' instead of 'swift build'
@michelleN is already working on this.
Since Apr 14, 2025.
- Dominant language
- Rust
- Stars
- 6.5k
- Forks
- 310
- Avg merge
- 1d 20h
- Merged PRs (30d)
- 24
Description
Only for spin with Swift (swiftwasm):
Reproduction:
> spin new swiftwasm_test # uses http-swift
> cd swiftwasm_test
> spin build
Building component swiftwasm-test with `swiftc -target wasm32-unknown-wasi main.swift -o main.wasm`
error: missing external dependency '/Library/Developer/Toolchains/swift-DEVELOPMENT-SNAPSHOT-2024-10-08-a.xctoolchain/usr/lib/swift/wasi/static-executable-args.lnk'
Error: Build command for component swiftwasm-test failed with status Exited(1)
I checked quickly on the Swiftwasm book, and found out that swiftc should not be used to build a WASM component / binary:
You may encounter this error while building with Swift SDK for WebAssembly and swiftc driver command. Unfortunately, Swift SDK does not support building with swiftc command yet, so you need to use swift build Swift Package Manager command instead.
Source: https://book.swiftwasm.org/getting-started/troubleshooting.html
So, swift build should be used here instead of swiftc.
Version: spin 2.7.0 (a111517 2024-07-30)
Plugins:
- cloud 0.9.1 [installed]
- js2wasm 0.6.1 [installed]
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.