feat(sys): upgrade to WasmEdge 0.17.0 and add macOS arm64 static support#141
Merged
Merged
Conversation
07cbc44 to
685140a
Compare
Bumps `WASMEDGE_RELEASE_VERSION` from 0.16.1 to 0.17.0 and refreshes all `REMOTE_ARCHIVES` SHA256 hashes against the 0.17.0 release. Adds a new `macos/aarch64/static` entry consuming `WasmEdge-0.17.0-darwin_arm64_static.tar.gz` (workflow that produces it is WasmEdge/WasmEdge#4948). ## WasmEdge 0.17.0 C API changes Two breaking C ABI changes between 0.16.1 and 0.17.0 propagate through this SDK: - `WasmEdge_Limit` (value struct passed by value) was replaced with the opaque `WasmEdge_LimitContext *` (heap-allocated, constructed via `WasmEdge_LimitCreate` / `WasmEdge_LimitCreateWithMax`, queried via `WasmEdge_LimitGet{Min,Max}` / `LimitHasMax` / `LimitIsShared`, released via `WasmEdge_LimitDelete`). The `From<WasmEdge_Limit>` impls in `types.rs` are replaced with `WasmEdgeLimit::to_context()` / `from_context()` helpers. Call sites in `MemoryType::create` and `TableType::create` explicitly delete the limit context after the borrowing C API consumes it. - `Size`/`Offset`/`Page`/`Idx` arguments on several memory and table APIs widened from `uint32_t` to `uint64_t` (in preparation for the memory64 proposal). Call sites across `config.rs`, `instance/memory.rs`, and `instance/table.rs` updated with `.into()` casts. Return-type widenings on `WasmEdge_ConfigureGetMaxMemoryPage` and `WasmEdge_MemoryInstanceGetPageSize` are downcast via `as u32` since this SDK still exposes `u32` to downstream consumers. Two `Config` default-state tests are updated to match new WasmEdge 0.17.0 defaults: `memory64` and `interpreter_mode` are now both enabled by default. ## macOS arm64 static linking `crates/wasmedge-sys/build.rs` static-link branch becomes platform-conditional: - macOS: links `c++`, `z`, `ncurses`, and `xar` from the system. `libSystem` already provides `rt`/`dl`/`pthread`/`m`, and `stdc++` is `c++` on Apple toolchain. zlib (`z`), ncurses, and libxar are needed by LLVM (statically linked into `libwasmedge.a` via the `WASMEDGE_LINK_LLVM_STATIC=ON` macOS workflow). All four are available at `/usr/lib/` on every macOS install. - Linux: retains the existing `rt, dl, pthread, m, stdc++` set. The `libfmt.a` and `libzstd.a` exists-checks both gain a skip-on-macOS branch instead of falling back to dynamic `-lfmt` / `-lzstd`. The macOS static archive merges fmt+spdlog symbols into `libwasmedge.a` and doesn't ship `.a` files separately. Brew installs the dylibs to `/opt/homebrew/lib` which the system linker doesn't search by default, so the dynamic fallback breaks clean macOS builds. Skipping is correct since the symbols are already in `libwasmedge.a`. Adds a `build_macos` job to `.github/workflows/rust-static-lib.yml` exercising `cargo test --features bundled,aot,ffi` (and the async variant) on `macos-14`. ## Local verification (macOS 26 Tahoe, Xcode 26.5) - `cargo build --release -p wasmedge-sys --features bundled,aot,ffi` successfully downloads the published `darwin_arm64_static.tar.gz`, verifies SHA256, extracts, generates bindgen, and links. - `cargo test --release --workspace --exclude async-wasi --features bundled,aot,ffi -- --test-threads=1 --skip test_vmbuilder`: 78 passed, 0 failed, 12 ignored. - Downstream cloud_ai_gateway tested against this SDK via `[patch]` override; 804 unit tests green and the release binary contains no `libwasmedge.dylib` reference per `otool -L`. Signed-off-by: dm4 <dm4@secondstate.io> Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
685140a to
d4b14f9
Compare
hydai
approved these changes
Jul 7, 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.
Summary
This PR does two related things:
WASMEDGE_RELEASE_VERSIONfrom 0.16.1 to 0.17.0 and refreshes allREMOTE_ARCHIVESSHA256 hashes against the 0.17.0 release. Two breaking C ABI changes between 0.16.1 and 0.17.0 propagate through this SDK and are handled here.macos/aarch64/statictoREMOTE_ARCHIVESconsumingWasmEdge-0.17.0-darwin_arm64_static.tar.gz(corresponding workflow patch in WasmEdge/WasmEdge#4948; the archive itself was manually uploaded to the 0.17.0 release while the workflow PR is in review). Static-link branch inbuild.rsbecomes platform-conditional so a macOS arm64 host can linklibwasmedge.awithout the dylib-bundling +install_name_toolworkaround that downstream Rust projects currently need.WasmEdge 0.17.0 C API changes
Two breaking changes propagate:
WasmEdge_Limitvalue struct → opaqueWasmEdge_LimitContext *. Construct withWasmEdge_LimitCreate/WasmEdge_LimitCreateWithMax, query viaWasmEdge_LimitGet{Min,Max}/LimitHasMax/LimitIsShared, release viaWasmEdge_LimitDelete. TheFrom<WasmEdge_Limit>impls intypes.rsare replaced withWasmEdgeLimit::to_context()/from_context()helpers. Call sites inMemoryType::createandTableType::createexplicitly delete the limit context after the borrowing C API consumes it.Size/Offset/Page/Idxarguments widened fromuint32_ttouint64_t(preparing for memory64). Call sites acrossconfig.rs,instance/memory.rs, andinstance/table.rsupdated with.into()casts. Return-type widenings onWasmEdge_ConfigureGetMaxMemoryPageandWasmEdge_MemoryInstanceGetPageSizeare downcast viaas u32since this SDK still exposesu32to downstream consumers.Two
Configdefault-state tests are updated to match new WasmEdge 0.17.0 defaults:memory64andinterpreter_modeare now both enabled by default.macOS arm64 static linking
crates/wasmedge-sys/build.rsstatic-link branch becomes platform-conditional:c++,z,ncurses,xarfrom the system.libSystemalready providesrt/dl/pthread/m, andstdc++isc++on Apple toolchain. zlib/ncurses/libxar are needed by LLVM (statically linked intolibwasmedge.avia theWASMEDGE_LINK_LLVM_STATIC=ONmacOS workflow). All four are at/usr/lib/on every macOS install.rt, dl, pthread, m, stdc++set unchanged.The
libfmt.aandlibzstd.aexists-checks both gain a skip-on-macOS branch instead of falling back to dynamic-lfmt/-lzstd. The macOS static archive merges fmt+spdlog symbols intolibwasmedge.aand doesn't ship.afiles separately. Brew installs libfmt/libzstd dylibs to/opt/homebrew/libwhich the system linker doesn't search by default, so the dynamic fallback breaks clean macOS builds. Skipping is correct since the symbols are already inlibwasmedge.a.Adds a
build_macosjob to.github/workflows/rust-static-lib.ymlexercisingcargo test --features bundled,aot,ffi(and the async variant) onmacos-14.Verification
Local end-to-end on macOS 26 Tahoe / Xcode 26.5 against the published
WasmEdge-0.17.0-darwin_arm64_static.tar.gz:cargo build --release -p wasmedge-sys --features bundled,aot,ffisucceeds — SDK downloads the archive, verifies SHA256, extracts, generates bindgen bindings, and links cleanly.cargo test --release --workspace --exclude async-wasi --features bundled,aot,ffi -- --test-threads=1 --skip test_vmbuilder: 78 passed, 0 failed, 12 ignored.[patch]override; 804 unit tests green and the release binary contains nolibwasmedge.dylibreference perotool -L.build_macosjob on this PR (will run automatically once PR opens).build_ubuntujob on this PR (regression check for Linux paths).Test plan (post-merge)
wasmedge-sys/wasmedge-sdktag once reviewers are happy; downstream consumers (e.g. cloud_ai_gateway) bump to the new tag.