Skip to content

Commit d7b8702

Browse files
alexcrichtondicej
andauthored
Update the wit-{component,parser} crates (#457)
* Update the Rust guest generator This commit updates the `wit-parser` and `wit-component` dependencies to the latest 0.4.0 versions on crates.io, namely pulling in support for `use`. This updates the `*.wit` codegen tests and gets all the codegen tests working for the `gen-guest-rust` crate. This does not get the entire repository's tests running. The major changes here are: * The `WorldGenerator` trait has been adapted for worlds and the new APIs of `wit-parser`. * The Rust guest generator now supports bare function imports as well as bare function exports. * The syntax in the Rust macro now mirrors the syntax in the Wasmtime `bindgen!` macro where `generate!("foo")` will look for the document `foo.wit` in `$CARGO_MANIFEST_DIR/wit/foo.wit` and look for a `default world` inside there. * The codegen and runtime macros have been refactored to get separated and additionally have conditional compilation working so one generator can be tested in isolation without requiring all others working. * The `rust-macro-shared` crate is now removed since Wasmtime no longer resides here and it's merged directly into the `guest-rust-macro` crate. Note that many changes happened here since the macro syntax and integration with `wit-parser` has changed. Note that no new tests were added in this commit, and that'll be a follow-up. * Add support for using types across interfaces to Rust * Support renaming interfaces in imports * Get all codegen tests for JS passing again * Fix build of wasi_snapshot_preview1 for this repo * Get unions tests building again * Get the flavorful test compiling again * Get the records test compiling again * Get the many arguments test compiling again * Get the smoke test compiling again * Get numbers test compiling again * Get list test compiling again * Get variants test compiling again * Get results test compiling again * Get invalid test compiling again * Get all runtime JS tests passing Change a few bits and pieces of the JS host generator as necessary and temporarily disable other guest generators. * Use git repo for wit-{component,parser} patch * Update C generator for new WIT * Get the bare bones of teavm-java working Runtime tests will need some more work to get passing. * Get CLI and markdown crate building again * Update build of demo * Use updated crates.io dep for wit-component * fix Java runtime test regressions (#1) Signed-off-by: Joel Dice <joel.dice@fermyon.com> Signed-off-by: Joel Dice <joel.dice@fermyon.com> * Update wasm-tools on CI * Review comments Signed-off-by: Joel Dice <joel.dice@fermyon.com> Co-authored-by: Joel Dice <joel.dice@fermyon.com>
1 parent d24b97f commit d7b8702

102 files changed

Lines changed: 2039 additions & 1851 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/main.yml

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ jobs:
2222
fail-fast: false
2323
matrix:
2424
os: [ubuntu-latest, macos-latest, windows-latest]
25-
mode: [debug, release]
2625
runs-on: ${{ matrix.os }}
2726
steps:
2827
- uses: actions/checkout@v2
@@ -56,12 +55,8 @@ jobs:
5655
with:
5756
java-version: '18'
5857
distribution: 'adopt'
59-
- if: matrix.mode == 'release'
60-
name: Test release build
61-
run: cargo test --workspace --release
62-
- if: matrix.mode != 'release'
63-
name: Test debug build
64-
run: cargo test --workspace
58+
- run: cargo test --workspace
59+
- run: cargo test -p wit-bindgen-gen-host-js --test runtime --features runtime-tests
6560

6661
rustfmt:
6762
name: Rustfmt
@@ -88,11 +83,11 @@ jobs:
8883
- uses: actions/cache@v3
8984
with:
9085
path: ${{ runner.tool_cache }}/wasm-tools
91-
key: wasm-tools-bin-1.0.15-${{ runner.os }}
86+
key: wasm-tools-bin-1.0.17-${{ runner.os }}
9287
- run: echo '${{ runner.tool_cache }}/wasm-tools/bin' >> $GITHUB_PATH
9388
- run: |
9489
cargo install \
95-
wasm-tools@1.0.15 \
90+
wasm-tools@1.0.17 \
9691
--root '${{ runner.tool_cache }}/wasm-tools' \
9792
--locked \
9893
--no-default-features \

0 commit comments

Comments
 (0)