Skip to content

Embedded Swift support - #357

Open
Joannis wants to merge 1 commit into
swiftwasm:mainfrom
Joannis:jo/embedded-runtime-v2
Open

Embedded Swift support#357
Joannis wants to merge 1 commit into
swiftwasm:mainfrom
Joannis:jo/embedded-runtime-v2

Conversation

@Joannis

@Joannis Joannis commented Jun 22, 2026

Copy link
Copy Markdown
Contributor

No description provided.

@Joannis

Joannis commented Jun 22, 2026

Copy link
Copy Markdown
Contributor Author

My experiments to run on ESP32c6

@kateinoigakukun

Copy link
Copy Markdown
Member

@Joannis This is so cool! If you don't mind me pushing to your branch, I'll do some tweaks so that we can land this to main branch.

@MaxDesiatov

MaxDesiatov commented Jun 22, 2026

Copy link
Copy Markdown
Member

There are unrelated errors on CI introduced on main due to strict no-warnings-allowed concurrency checks. I'm working on a fix to be submitted in a separate PR.

@MaxDesiatov

Copy link
Copy Markdown
Member

main build errors fixed in #358

kateinoigakukun added a commit that referenced this pull request Jun 29, 2026
Extracted from #357

Co-Authored-By: Joannis Orlandos <joannis@orlandos.nl>
kateinoigakukun added a commit that referenced this pull request Jun 29, 2026
Extracted from #357

Co-Authored-By: Joannis Orlandos <joannis@orlandos.nl>
kateinoigakukun added a commit that referenced this pull request Jun 29, 2026
Extracted from #357

Co-Authored-By: Joannis Orlandos <joannis@orlandos.nl>
kateinoigakukun added a commit that referenced this pull request Jun 29, 2026
Extracted from #357

Co-Authored-By: Joannis Orlandos <joannis@orlandos.nl>
kateinoigakukun added a commit that referenced this pull request Jun 30, 2026
Extracted from #357

Co-Authored-By: Joannis Orlandos <joannis@orlandos.nl>
kkebo pushed a commit to kkebo/WasmKit that referenced this pull request Jun 30, 2026
…ers (swiftwasm#369)

Extracted from swiftwasm#357

Co-authored-by: Joannis Orlandos <joannis@orlandos.nl>
kkebo pushed a commit to kkebo/WasmKit that referenced this pull request Jul 27, 2026
Part of the Embedded Swift support work (swiftwasm#357), split out for
incremental review.

Adds a `MultiThread` package trait (enabled by default) and a
`PlatformMutex` wrapper in `Sources/WasmKit/Platform/`:

- With the trait enabled, `PlatformMutex` is backed by
`Synchronization.Mutex`, forwarding the closure directly so the state
type needs no `Sendable` bound.
- With the trait disabled, it degrades to plain unsynchronized storage
with the same non-copyable shape. This serves single-threaded
environments such as bare-metal Embedded Swift targets, where the
`Synchronization` module provides no `Mutex`. Disabling the trait is a
promise that the process runs single-threaded, so the fallback carries
`@unchecked Sendable`.

`Interner` adopts the wrapper, replacing its direct `Mutex` use. Its
lock property is annotated `nonisolated(unsafe)` because the
single-threaded fallback mutates in place (`mutating withLock`), which
`Sendable` checking cannot see through. The class conformance itself
stays checked.

The CMake build defines `MultiThread` unconditionally. No functional
change with default traits.
kateinoigakukun added a commit that referenced this pull request Jul 29, 2026
Builds WasmKit for ESP32-C6 via ESP-IDF v5.5 + Embedded Swift (one IDF
component per SwiftPM module) and runs a wasm module on emulated ESP32-C3
in QEMU via Examples/embedded-esp32/smoke-test.sh.

This example is based on the Embedded Swift support originally developed by
Joannis Orlandos in #357.

Co-authored-by: Joannis Orlandos <joannis@orlandos.nl>
kateinoigakukun added a commit that referenced this pull request Jul 29, 2026
Builds WasmKit for ESP32-C6 via ESP-IDF v5.5 + Embedded Swift (one IDF
component per SwiftPM module) and runs a wasm module on emulated ESP32-C3
in QEMU via Examples/embedded-esp32/smoke-test.sh.

A new build-embedded CI job compile-checks the engine for
riscv32-none-none-eabi with Embedded Swift (Utilities/build-embedded.sh),
so embedded compatibility is maintained without ESP-IDF on the runners.

The Embedded Swift support in the engine was originally developed by
Joannis Orlandos in #357.
kateinoigakukun added a commit that referenced this pull request Jul 29, 2026
Builds WasmKit for ESP32-C6 via ESP-IDF v5.5 + Embedded Swift (one IDF
component per SwiftPM module) and runs a wasm module on emulated ESP32-C3
in QEMU via Examples/embedded-esp32/smoke-test.sh.

A new build-embedded CI job compile-checks the engine for
riscv32-none-none-eabi with Embedded Swift (Utilities/build-embedded.sh),
so embedded compatibility is maintained without ESP-IDF on the runners.

The Embedded Swift support in the engine was originally developed by
Joannis Orlandos in #357.
kateinoigakukun added a commit that referenced this pull request Jul 29, 2026
Builds WasmKit for ESP32-C6 via ESP-IDF v5.5 + Embedded Swift (one IDF
component per SwiftPM module) and runs a wasm module on emulated ESP32-C3
in QEMU via Examples/embedded-esp32/smoke-test.sh.

A new build-embedded CI job compile-checks the engine for
riscv32-none-none-eabi with Embedded Swift (Utilities/build-embedded.sh),
so embedded compatibility is maintained without ESP-IDF on the runners.

The Embedded Swift support in the engine was originally developed by
Joannis Orlandos in #357.

Co-authored-by: Joannis Orlandos <joannis@orlandos.nl>
@MaxDesiatov

Copy link
Copy Markdown
Member

Is there anything else remaining on this branch that's not available on main yet?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants