Add ESP32 example with a portable smoke test - #396
Merged
Conversation
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>
kateinoigakukun
force-pushed
the
katei/esp32-example
branch
from
July 29, 2026 19:05
f9fb9c3 to
faf2a85
Compare
kateinoigakukun
added this pull request to the merge queue
Jul 29, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Final part of the incremental upstreaming of Embedded Swift support (#357). Follows #395.
Adds
Examples/embedded-esp32: an ESP-IDF (v5.5) project that runs WasmKit on an ESP32-C6 with Embedded Swift, plus a portable smoke test.wasmtypes,wasmparser,wasmkit,cwasmkit), compiled with-enable-experimental-feature Embeddedand no traits enabled.add,mul3calling back into a hostmulfunction), and shows host-error identity: a host function throwsDemoHostError(code: 42)and the embedder catches it withcatch let error as DemoHostError.smoke-test.shlocates ESP-IDF and the newest Swift development snapshot, patches ESP-IDF's linker template for.got(idempotently), and builds for esp32c6;--qemuadditionally builds for esp32c3 and runs the demo under QEMU, asserting the expected output.Two CI jobs keep this working:
build-embeddedcompile-checks the engine forriscv32-none-none-eabiwith Embedded Swift (Utilities/build-embedded.sh) — fast, no ESP-IDF needed.smoke-esp32runs the full smoke test in theespressif/idf:v5.5container: installs a Swift development snapshot and Espressif's QEMU, builds for esp32c6 and esp32c3, and boots the demo in QEMU asserting its output.Verified: esp32c6 build and the QEMU run pass (
2 + 3 = 5,7 * 3 = 21,host error 42).The Embedded Swift support in the engine (#388–#395) was originally developed by @Joannis in #357.