From ce354eddfccf86fdda1dded7702ef6aabf70a2dd Mon Sep 17 00:00:00 2001 From: James Sturtevant Date: Tue, 9 Dec 2025 20:19:57 -0800 Subject: [PATCH 1/2] Add support for both wasmtime latest (39.x) and LTS (36.x) versions Introduces wasmtime_lts feature flag to switch between wasmtime versions. Default uses latest (39.0.1), pass --lts flag to AOT compiler or enable wasmtime_lts feature for LTS version (36.0.3). CI updated to test both. Signed-off-by: James Sturtevant --- .github/workflows/Benchmarks.yml | 6 +- .github/workflows/CargoAudit.yml | 2 +- .github/workflows/CreateDevcontainerImage.yml | 2 +- .github/workflows/CreateRelease.yml | 6 +- .github/workflows/dep_build_wasm_examples.yml | 48 +- .github/workflows/dep_cargo_publish.yml | 2 +- .github/workflows/dep_rust.yml | 34 +- Cargo.lock | 1166 ++++++++++++----- Cargo.toml | 2 +- Justfile | 25 +- README.md | 6 +- rust-toolchain.toml | 2 +- src/hyperlight_wasm/Cargo.toml | 5 +- src/hyperlight_wasm/build.rs | 19 + .../examples/guest-debugging/main.rs | 2 +- .../scripts/build-wasm-examples.sh | 17 +- src/hyperlight_wasm/src/lib.rs | 8 +- src/hyperlight_wasm_aot/Cargo.toml | 8 +- src/hyperlight_wasm_aot/src/main.rs | 293 +++-- src/hyperlight_wasm_runtime/Cargo.toml | 13 +- src/hyperlight_wasm_runtime/build.rs | 26 +- src/hyperlight_wasm_runtime/src/component.rs | 10 + src/hyperlight_wasm_runtime/src/lib.rs | 14 + src/hyperlight_wasm_runtime/src/module.rs | 11 + 24 files changed, 1242 insertions(+), 485 deletions(-) diff --git a/.github/workflows/Benchmarks.yml b/.github/workflows/Benchmarks.yml index fce1fac8..c2eea210 100644 --- a/.github/workflows/Benchmarks.yml +++ b/.github/workflows/Benchmarks.yml @@ -47,16 +47,16 @@ jobs: - uses: hyperlight-dev/ci-setup-workflow@v1.8.0 with: - rust-toolchain: "1.89" + rust-toolchain: "1.93" - - uses: dtolnay/rust-toolchain@1.89 + - uses: dtolnay/rust-toolchain@1.93 with: components: clippy, rustfmt - name: Download Wasm Modules uses: actions/download-artifact@v5 with: - name: guest-modules + name: guest-modules-lts path: ./x64/${{ matrix.config }} ### Benchmarks ### diff --git a/.github/workflows/CargoAudit.yml b/.github/workflows/CargoAudit.yml index e738cadd..6c1139b5 100644 --- a/.github/workflows/CargoAudit.yml +++ b/.github/workflows/CargoAudit.yml @@ -18,7 +18,7 @@ jobs: # We are not using the common workflow here because it installs a lot of tools we don't need uses: dtolnay/rust-toolchain@master with: - toolchain: "1.89" + toolchain: "1.93" - uses: extractions/setup-just@v3 with: diff --git a/.github/workflows/CreateDevcontainerImage.yml b/.github/workflows/CreateDevcontainerImage.yml index 7526e010..eedc36da 100644 --- a/.github/workflows/CreateDevcontainerImage.yml +++ b/.github/workflows/CreateDevcontainerImage.yml @@ -16,7 +16,7 @@ env: USER: vscode GROUP: vscode LLVM_VERSION: 17 - RUST_TOOLCHAIN_DEFAULT: 1.89 + RUST_TOOLCHAIN_DEFAULT: 1.93 RUST_TOOLCHAIN_FILE: rust-toolchain.toml WASI_SDK_VERSION_FULL: "25.0" GCC_VERSION: "12" diff --git a/.github/workflows/CreateRelease.yml b/.github/workflows/CreateRelease.yml index 80c35da9..50baa6e0 100644 --- a/.github/workflows/CreateRelease.yml +++ b/.github/workflows/CreateRelease.yml @@ -38,7 +38,7 @@ jobs: - name: Hyperlight setup uses: hyperlight-dev/ci-setup-workflow@v1.8.0 with: - rust-toolchain: "1.89" + rust-toolchain: "1.93" - name: Set HYPERLIGHTWASM_VERSION run: | git fetch --tags @@ -50,7 +50,7 @@ jobs: - name: Download Wasm Modules uses: actions/download-artifact@v5 with: - name: guest-modules + name: guest-modules-lts path: ${{ env.PLATFORM }}/${{ env.CONFIG }} - name: Build rust wasm modules run: just build-rust-wasm-examples ${{ env.CONFIG }} @@ -105,7 +105,7 @@ jobs: echo "✅ $crate@$version already published, skipping." else echo "🚀 Publishing $crate@$version" - cargo +1.92 publish -p "$crate" + cargo +1.93 publish -p "$crate" fi } diff --git a/.github/workflows/dep_build_wasm_examples.yml b/.github/workflows/dep_build_wasm_examples.yml index 71c24f36..777e189d 100644 --- a/.github/workflows/dep_build_wasm_examples.yml +++ b/.github/workflows/dep_build_wasm_examples.yml @@ -21,19 +21,13 @@ permissions: contents: read jobs: - build-wasm-examples: + build-docker-image: if: ${{ inputs.docs_only == 'false' || github.event_name == 'schedule' || github.event_name == 'workflow_dispatch' }} runs-on: ubuntu-latest steps: - uses: actions/checkout@v5 with: fetch-depth: 0 - - name: Remove default clang - run: sudo rm /usr/bin/clang - - name: Hyperlight setup workflow - uses: hyperlight-dev/ci-setup-workflow@v1.8.0 - with: - rust-toolchain: "1.89" - name: Set up Docker Buildx uses: docker/setup-buildx-action@v3 - name: Login to Registry @@ -76,14 +70,46 @@ jobs: tags: ghcr.io/${{ github.repository_owner }}/wasm-clang-builder:latest cache-from: type=registry,ref=ghcr.io/${{ github.repository_owner }}/wasm-clang-builder:buildcache cache-to: ${{ env.CACHE_TO }} - - name: Build Modules + + build-wasm-examples: + needs: build-docker-image + runs-on: ubuntu-latest + strategy: + matrix: + wasmtime_version: + - name: lts + features: "" + - name: latest + features: "wasmtime_latest" + steps: + - uses: actions/checkout@v5 + with: + fetch-depth: 0 + - name: Remove default clang + run: sudo rm /usr/bin/clang + - name: Hyperlight setup workflow + uses: hyperlight-dev/ci-setup-workflow@v1.8.0 + with: + rust-toolchain: "1.93" + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + - name: Login to Registry + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + - name: Pull wasm-clang-builder + run: | + docker pull ghcr.io/${{ github.repository_owner }}/wasm-clang-builder:latest + - name: Build Modules (wasmtime ${{ matrix.wasmtime_version.name }}) run: | just ensure-tools - just build-wasm-examples release + just build-wasm-examples release ${{ matrix.wasmtime_version.features }} shell: bash - - name: Upload Wasm Modules + - name: Upload Wasm Modules (wasmtime ${{ matrix.wasmtime_version.name }}) uses: actions/upload-artifact@v4 with: - name: guest-modules + name: guest-modules-${{ matrix.wasmtime_version.name }} path: | x64/release/*.aot diff --git a/.github/workflows/dep_cargo_publish.yml b/.github/workflows/dep_cargo_publish.yml index 68abfa04..c133e140 100644 --- a/.github/workflows/dep_cargo_publish.yml +++ b/.github/workflows/dep_cargo_publish.yml @@ -22,7 +22,7 @@ jobs: - name: Hyperlight setup uses: hyperlight-dev/ci-setup-workflow@v1.8.0 with: - rust-toolchain: "1.89" + rust-toolchain: "1.93" # github actions that run against PRs check out a ref to the PR merge branch # we need to switch / create a branch for cargo ws to run late diff --git a/.github/workflows/dep_rust.yml b/.github/workflows/dep_rust.yml index 9dcb5bb2..fa42eb50 100644 --- a/.github/workflows/dep_rust.yml +++ b/.github/workflows/dep_rust.yml @@ -40,6 +40,15 @@ jobs: hypervisor: [hyperv, mshv3, kvm] # hyperv is windows, mshv and kvm are linux cpu: [amd, intel] config: [debug, release] + wasmtime: [latest, lts] + exclude: + # Latest testing: skip Windows, Intel, and debug builds to reduce CI load + - wasmtime: latest + hypervisor: hyperv + - wasmtime: latest + cpu: intel + - wasmtime: latest + config: debug runs-on: ${{ fromJson( format('["self-hosted", "{0}", "X64", "1ES.Pool=hld-{1}-{2}", "JobId=build-{3}-{4}-{5}-{6}"]', @@ -50,13 +59,20 @@ jobs: github.run_id, github.run_number, github.run_attempt)) }} + env: + # Features to pass to cargo. + # On Windows LTS builds, do not pass any features. + # On Windows latest builds, only add wasmtime_latest. + # On Linux, always pass the hypervisor feature (kvm/mshv3). + # On Linux latest builds, also add wasmtime_latest. + FEATURES: ${{ matrix.hypervisor != 'hyperv' && format('{0}{1}', matrix.hypervisor, matrix.wasmtime == 'latest' && ',wasmtime_latest' || '') || (matrix.wasmtime == 'latest' && 'wasmtime_latest' || '') }} steps: - uses: actions/checkout@v5 - name: Hyperlight setup uses: hyperlight-dev/ci-setup-workflow@v1.8.0 with: - rust-toolchain: "1.89" + rust-toolchain: "1.93" - name: Add Nightly Rust run: | @@ -74,7 +90,7 @@ jobs: - name: Download Wasm Modules uses: actions/download-artifact@v5 with: - name: guest-modules + name: guest-modules-${{ matrix.wasmtime }} path: ./x64/${{ matrix.config }} - name: Build Rust component model examples @@ -83,7 +99,7 @@ jobs: # because the component model example depends on the wasm component built here just ensure-tools just compile-wit - just build-rust-component-examples ${{ matrix.config }} + just build-rust-component-examples ${{ matrix.config }} ${{ matrix.wasmtime == 'latest' && 'wasmtime_latest' || '' }} - name: Fmt run: just fmt-check @@ -92,15 +108,15 @@ jobs: run: just clippy ${{ matrix.config }} - name: Build - run: just build ${{ matrix.config }} + run: just build ${{ matrix.config }} ${{ env.FEATURES }} working-directory: ./src/hyperlight_wasm - name: Build Rust Wasm examples - run: just build-rust-wasm-examples ${{ matrix.config }} + run: just build-rust-wasm-examples ${{ matrix.config }} ${{ matrix.wasmtime == 'latest' && 'wasmtime_latest' || '' }} working-directory: ./src/hyperlight_wasm - name: Test - run: just test ${{ matrix.config }} + run: just test ${{ matrix.config }} ${{ env.FEATURES }} working-directory: ./src/hyperlight_wasm - name: Install github-cli (Windows) @@ -118,7 +134,7 @@ jobs: shell: pwsh - name: Test Examples - run: just examples-ci ${{ matrix.config }} + run: just examples-ci ${{ matrix.config }} ${{ env.FEATURES }} working-directory: ./src/hyperlight_wasm env: # required for gh cli when downloading @@ -128,7 +144,7 @@ jobs: - name: Download benchmarks from "latest" run: | - just bench-download ${{ runner.os }} ${{ matrix.hypervisor }} ${{ matrix.cpu }} dev-latest + just bench-download ${{ runner.os }} ${{ matrix.hypervisor }} ${{ matrix.cpu }} dev-latest ${{ matrix.wasmtime }} env: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} continue-on-error: true @@ -137,6 +153,6 @@ jobs: - name: Run benchmarks run: | - just bench-ci dev ${{ matrix.config }} + just bench-ci dev ${{ matrix.config }} ${{ env.FEATURES }} working-directory: ./src/hyperlight_wasm if: ${{ matrix.config == 'release' }} diff --git a/Cargo.lock b/Cargo.lock index 9fa2ff1b..607a7436 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -8,7 +8,16 @@ version = "0.25.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1b5d307320b3181d6d7954e663bd7c774a838b8220fe0593c86d9fb09f498b4b" dependencies = [ - "gimli", + "gimli 0.32.3", +] + +[[package]] +name = "addr2line" +version = "0.26.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "59317f77929f0e679d39364702289274de2f0f0b22cbf50b2b8cff2169a0b27a" +dependencies = [ + "gimli 0.33.0", ] [[package]] @@ -143,15 +152,15 @@ checksum = "1505bd5d3d116872e7271a6d4e16d81d0c8570876c8de68093a09ac269d8aac0" [[package]] name = "autocfg" -version = "1.5.0" +version = "1.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c08606f8c3cbf4ce6ec8e28fb0014a2c086708fe954eaa885384a6165172e7e8" +checksum = "f2032f911046de80f0a198e0901378627c33f59ea0ac00e363d481118bd70a53" [[package]] name = "aws-lc-rs" -version = "1.16.2" +version = "1.17.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a054912289d18629dc78375ba2c3726a3afe3ff71b4edba9dedfca0e3446d1fc" +checksum = "5ec2f1fc3ec205783a5da9a7e6c1509cc69dedf09a1949e412c1e18469326d00" dependencies = [ "aws-lc-sys", "zeroize", @@ -159,9 +168,9 @@ dependencies = [ [[package]] name = "aws-lc-sys" -version = "0.39.1" +version = "0.41.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "83a25cf98105baa966497416dbd42565ce3a8cf8dbfd59803ec9ad46f3126399" +checksum = "1a2f9779ce85b93ab6170dd940ad0169b5766ff848247aff13bb788b832fe3f4" dependencies = [ "cc", "cmake", @@ -183,9 +192,9 @@ checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" [[package]] name = "bitflags" -version = "2.11.0" +version = "2.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "843867be96c8daad0d758b57df9392b6d8d271134fce549de6ce169ff98a92af" +checksum = "b4388bee8683e3d04af747c73422af53102d2bd24d9eadb6cbc100baef4b43f8" [[package]] name = "blake3" @@ -231,9 +240,9 @@ dependencies = [ [[package]] name = "built" -version = "0.8.0" +version = "0.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f4ad8f11f288f48ca24471bbd51ac257aaeaaa07adae295591266b792902ae64" +checksum = "5c0e531d93d39c34eef561e929e8a7f86d77a5af08aac4f6d6e39976c51858e9" dependencies = [ "chrono", "git2", @@ -241,9 +250,9 @@ dependencies = [ [[package]] name = "bumpalo" -version = "3.20.2" +version = "3.20.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5d20789868f4b01b2f2caec9f5c4e0213b41e3e5702a50157d699ae31ced2fcb" +checksum = "72f5acc6cb2ba439de613abc23857ec3d78374d8ed5ac84e9d11336e87da8649" dependencies = [ "allocator-api2", ] @@ -265,9 +274,9 @@ dependencies = [ [[package]] name = "cargo-hyperlight" -version = "0.1.10" +version = "0.1.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "10403a533b710c022e3a60ec18facb11adb2b4bfa05260b989b373198856c5ae" +checksum = "416fd0f4dc4e1e972da8365f840bf95a708f92d233377f0210b167739dfde736" dependencies = [ "anyhow", "clap", @@ -288,9 +297,9 @@ dependencies = [ [[package]] name = "cargo-platform" -version = "0.3.2" +version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87a0c0e6148f11f01f32650a2ea02d532b2ad4e81d8bd41e6e565b5adc5e6082" +checksum = "dd0061da739915fae12ea00e16397555ed4371a6bb285431aab930f61b0aa4ba" dependencies = [ "serde", "serde_core", @@ -364,14 +373,14 @@ checksum = "6f8d983286843e49675a4b7a2d174efe136dc93a18d69130dd18198a6c167601" dependencies = [ "cfg-if", "cpufeatures 0.3.0", - "rand_core 0.10.0", + "rand_core 0.10.1", ] [[package]] name = "chrono" -version = "0.4.44" +version = "0.4.45" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c673075a2e0e5f4a1dde27ce9dee1ea4558c7ffe648f576438a20ca1d2acc4b0" +checksum = "1aa79e62e7697b8e29b513a68abacf485adcd1fe8284a4316c5ae868e6633327" dependencies = [ "iana-time-zone", "js-sys", @@ -485,11 +494,12 @@ dependencies = [ [[package]] name = "const_format" -version = "0.2.35" +version = "0.2.36" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7faa7469a93a566e9ccc1c73fe783b4a65c274c5ace346038dca9c39fe0030ad" +checksum = "4481a617ad9a412be3b97c5d403fef8ed023103368908b9c50af598ff467cc1e" dependencies = [ "const_format_proc_macros", + "konst", ] [[package]] @@ -525,6 +535,15 @@ version = "0.8.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "773648b94d0e5d620f64f280777445740e61fe701025087ec8b57f45c791888b" +[[package]] +name = "cpp_demangle" +version = "0.4.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f2bb79cb74d735044c972aae58ed0aaa9a837e85b01106a54c39e42e97f62253" +dependencies = [ + "cfg-if", +] + [[package]] name = "cpufeatures" version = "0.2.17" @@ -545,61 +564,100 @@ dependencies = [ [[package]] name = "cranelift-assembler-x64" -version = "0.123.9" +version = "0.123.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "de2be1bdbf929c2a2242cbbe15d6583c56f1cc723c6c8452d0179362de28c9d5" +dependencies = [ + "cranelift-assembler-x64-meta 0.123.10", +] + +[[package]] +name = "cranelift-assembler-x64" +version = "0.132.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77c4ebb31662e2051dcc49b7342d222405a99e951720756cc4b93315972abd67" +dependencies = [ + "cranelift-assembler-x64-meta 0.132.1", +] + +[[package]] +name = "cranelift-assembler-x64-meta" +version = "0.123.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "44f81cede359311706057b689b91b59f464926de0316f389898a2b028cb494fa" +checksum = "9a0336914de11298290783a95a9a7154b894da601659eb5f8f8bc62d1bea98f8" dependencies = [ - "cranelift-assembler-x64-meta", + "cranelift-srcgen 0.123.10", ] [[package]] name = "cranelift-assembler-x64-meta" -version = "0.123.9" +version = "0.132.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fa6ca11305de425ea08884097b913ebe1a83875253b3c0063ce28411e226bfdc" +checksum = "106dfc2ec96ec1c3a8a250602e936712e00a381df032f7a8ad175c8f768c03bb" dependencies = [ - "cranelift-srcgen", + "cranelift-srcgen 0.132.1", ] [[package]] name = "cranelift-bforest" -version = "0.123.9" +version = "0.123.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7537341a9a4ba9812141927be733e7254bf2318aab6597d567af9cad90609f27" +checksum = "fb972cba51a52c1b2a329fec993b911e4d1f9cfab3795811a319b6746c28e014" dependencies = [ - "cranelift-entity", + "cranelift-entity 0.123.10", +] + +[[package]] +name = "cranelift-bforest" +version = "0.132.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5694aa8a2eb2571a15b3feee38d16ccaf2712200e7b5c9ae0479069bdfb46949" +dependencies = [ + "cranelift-entity 0.132.1", + "wasmtime-internal-core", ] [[package]] name = "cranelift-bitset" -version = "0.123.9" +version = "0.123.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d28a4ca5faf25ff821fcc768f26e68ffef505e9f71bb06e608862d941fa65086" +checksum = "642c920666bfed9aebca39d8c6e7cb76f09314cc7a4074b1db5edcccdde771b9" dependencies = [ "serde", "serde_derive", ] +[[package]] +name = "cranelift-bitset" +version = "0.132.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "93ab349d30a5fad9699440ee7ccb435374e8a8735dcca26696a4245bcefcc47e" +dependencies = [ + "serde", + "serde_derive", + "wasmtime-internal-core", +] + [[package]] name = "cranelift-codegen" -version = "0.123.9" +version = "0.123.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d891057fe1b73910c41e73b32a70fa8454092fce65942b5fa6f72aa6d5487f8a" +checksum = "0e1231caaeee3d2363d9b2dba9d6c1f7ff835b8ede6612fba98120af73df44bd" dependencies = [ "bumpalo", - "cranelift-assembler-x64", - "cranelift-bforest", - "cranelift-bitset", - "cranelift-codegen-meta", - "cranelift-codegen-shared", - "cranelift-control", - "cranelift-entity", - "cranelift-isle", - "gimli", + "cranelift-assembler-x64 0.123.10", + "cranelift-bforest 0.123.10", + "cranelift-bitset 0.123.10", + "cranelift-codegen-meta 0.123.10", + "cranelift-codegen-shared 0.123.10", + "cranelift-control 0.123.10", + "cranelift-entity 0.123.10", + "cranelift-isle 0.123.10", + "gimli 0.32.3", "hashbrown 0.15.5", "log", - "pulley-interpreter", - "regalloc2", + "pulley-interpreter 36.0.10", + "regalloc2 0.12.2", "rustc-hash", "serde", "smallvec", @@ -607,79 +665,182 @@ dependencies = [ "wasmtime-internal-math", ] +[[package]] +name = "cranelift-codegen" +version = "0.132.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3e95970bdb51d145c828a114a1084cb8b63e65569a51600ad398cb49fa78b062" +dependencies = [ + "bumpalo", + "cranelift-assembler-x64 0.132.1", + "cranelift-bforest 0.132.1", + "cranelift-bitset 0.132.1", + "cranelift-codegen-meta 0.132.1", + "cranelift-codegen-shared 0.132.1", + "cranelift-control 0.132.1", + "cranelift-entity 0.132.1", + "cranelift-isle 0.132.1", + "gimli 0.33.0", + "hashbrown 0.17.1", + "libm", + "log", + "pulley-interpreter 45.0.1", + "regalloc2 0.15.1", + "rustc-hash", + "serde", + "smallvec", + "target-lexicon", + "wasmtime-internal-core", +] + [[package]] name = "cranelift-codegen-meta" -version = "0.123.9" +version = "0.123.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c29a66028a78eedc534b3a94e5ebfbaeb4e1f6b09038afe41bb24afd614faa4b" +checksum = "eb83e89be8b413e4f7a4215a02d5c5f3e6f04b1060f5db293dd1007b2871dcf5" dependencies = [ - "cranelift-assembler-x64-meta", - "cranelift-codegen-shared", - "cranelift-srcgen", + "cranelift-assembler-x64-meta 0.123.10", + "cranelift-codegen-shared 0.123.10", + "cranelift-srcgen 0.123.10", "heck", - "pulley-interpreter", + "pulley-interpreter 36.0.10", ] +[[package]] +name = "cranelift-codegen-meta" +version = "0.132.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0e8414b8ecc81f89f8a3f2c5cbc785b9ed690200cd6f9d780e96a92f88879704" +dependencies = [ + "cranelift-assembler-x64-meta 0.132.1", + "cranelift-codegen-shared 0.132.1", + "cranelift-srcgen 0.132.1", + "heck", + "pulley-interpreter 45.0.1", +] + +[[package]] +name = "cranelift-codegen-shared" +version = "0.123.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9d14f8068a98f0a85ffa63dc5fe73cb486a955adbe7311465d13cde54c656d5f" + [[package]] name = "cranelift-codegen-shared" -version = "0.123.9" +version = "0.132.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "631c4e5db42e6a0f9e7a68f18f7faba3692862114870c7c598aee7e0e5677e59" + +[[package]] +name = "cranelift-control" +version = "0.123.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "95809ad251fe9422087b4a72d61e584d6ab6eff44dee1335f93cfaea0bedc9ac" +checksum = "c070aee9312b9736028e99b58d45e1099683386082af38529d5e2ce8c76648f3" +dependencies = [ + "arbitrary", +] [[package]] name = "cranelift-control" -version = "0.123.9" +version = "0.132.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f79d0cacf063c297e5e8d5b73cb355b41b87f6d248e252d1b284e7a7b73673c2" +checksum = "09c6e92c825abfbb739a4beaa5db3988f98a96a68d6ea656f562098efc142976" dependencies = [ "arbitrary", ] [[package]] name = "cranelift-entity" -version = "0.123.9" +version = "0.123.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b2d73297a195ce3be55997c6307142c4b1e58dd0c2f18ceaa0179444024e312a" +checksum = "f2d619bb3d14251e96dc9b6a846d6955d78048a168cc3876eb2b789b855c1c22" dependencies = [ - "cranelift-bitset", + "cranelift-bitset 0.123.10", "serde", "serde_derive", ] +[[package]] +name = "cranelift-entity" +version = "0.132.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "55e57cd185782abada9ab2606bfe88d0abc0d42d83a7d432dcf69991e17fe76e" +dependencies = [ + "cranelift-bitset 0.132.1", + "serde", + "serde_derive", + "wasmtime-internal-core", +] + [[package]] name = "cranelift-frontend" -version = "0.123.9" +version = "0.123.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3be38d1ae29ef7c5d611fc6cb694f698dc4ca44152dcaa112ec0fef8d4d34858" +checksum = "2350fcff24d78be5e4201e1eeb4b306e474b9f21e452722b21ffc4f773e8d49a" dependencies = [ - "cranelift-codegen", + "cranelift-codegen 0.123.10", "log", "smallvec", "target-lexicon", ] +[[package]] +name = "cranelift-frontend" +version = "0.132.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8a0f17e48d15e29552e2f264d302c31a661a830196d879bbdaf4d7b2bf2f7011" +dependencies = [ + "cranelift-codegen 0.132.1", + "log", + "smallvec", + "target-lexicon", +] + +[[package]] +name = "cranelift-isle" +version = "0.123.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8bdc2b14d7491c53c2989b967b4c07511374733abbc01a895fb01ea31e97bfc8" + [[package]] name = "cranelift-isle" -version = "0.123.9" +version = "0.132.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6761926f6636209de7ac568be28b206890f2181761375b9722e0a1e7a7e1637a" +checksum = "407b80b46934c9dce9a6581f0e80d079b7a69e11372fb03d7dce4c7ba3fee4e3" [[package]] name = "cranelift-native" -version = "0.123.9" +version = "0.123.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0893472f73f0d530a28e9a573ada6d1f93b9659bb6734dfe17061ac967bd1830" +checksum = "e98dbe1326d0001a17b3b0675e3adafcfbd0e7f25f1f845a2f1bb9ce3029f359" dependencies = [ - "cranelift-codegen", + "cranelift-codegen 0.123.10", + "libc", + "target-lexicon", +] + +[[package]] +name = "cranelift-native" +version = "0.132.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3a40e056e421d9a6c757983f2184f765ae1c28a51555d3877e98afc97ce5705b" +dependencies = [ + "cranelift-codegen 0.132.1", "libc", "target-lexicon", ] [[package]] name = "cranelift-srcgen" -version = "0.123.9" +version = "0.123.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c1daccebabb1ccd034dbab0eacc0722af27d3cccc7929dea27a3546cb3562e40" +checksum = "36d7af563cd300c8a1e4e64387929b40e32867112143f0a0e1ce90f977ce4a41" + +[[package]] +name = "cranelift-srcgen" +version = "0.132.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2cdbadda21e49798825a1ec795dab30bcb03235891f662b5ccf23fa45b39682f" [[package]] name = "crc32fast" @@ -817,9 +978,9 @@ dependencies = [ [[package]] name = "displaydoc" -version = "0.2.5" +version = "0.2.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "97369cbbc041bc366949bc74d34658d6cda5621039731c6310521892a3a20ae0" +checksum = "1ac70aa55017e108007fbaf5aa0f54b021c98f92ff8af59d42eda9da96e3dd4f" dependencies = [ "proc-macro2", "quote", @@ -834,9 +995,9 @@ checksum = "92773504d58c093f6de2459af4af33faa518c13451eb8f2b5698ed3d36e7c813" [[package]] name = "either" -version = "1.15.0" +version = "1.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "48c757948c5ede0e46177b7add2e67155f70e33c07fea8284df6576da70b3719" +checksum = "91622ff5e7162018101f2fea40d6ebf4a78bbe5a49736a2020649edf9693679e" [[package]] name = "elfcore" @@ -967,13 +1128,12 @@ checksum = "9f1f227452a390804cdb637b74a86990f2a7d7ba4b7d5693aac9b4dd6defd8d6" [[package]] name = "filetime" -version = "0.2.27" +version = "0.2.29" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f98844151eee8917efc50bd9e8318cb963ae8b297431495d3f758616ea5c57db" +checksum = "5c287a33c7f0a620c38e641e7f60827713987b3c0f26e8ddc9462cc69cf75759" dependencies = [ "cfg-if", "libc", - "libredox", ] [[package]] @@ -988,7 +1148,7 @@ version = "25.12.19" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "35f6839d7b3b98adde531effaf34f0c2badc6f4735d26fe74709d8e513a96ef3" dependencies = [ - "bitflags 2.11.0", + "bitflags 2.13.0", "rustc_version", ] @@ -1103,7 +1263,7 @@ version = "0.7.10" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5bafc7e33650ab9f05dcc16325f05d56b8d10393114e31a19a353b86fa60cfe7" dependencies = [ - "bitflags 2.11.0", + "bitflags 2.13.0", "cfg-if", "log", "managed", @@ -1123,9 +1283,9 @@ dependencies = [ [[package]] name = "generator" -version = "0.8.8" +version = "0.8.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "52f04ae4152da20c76fe800fa48659201d5cf627c5149ca0b707b69d7eef6cf9" +checksum = "b3b854b0e584ead1a33f18b2fcad7cf7be18b3875c78816b753639aa501513ae" dependencies = [ "cc", "cfg-if", @@ -1178,7 +1338,7 @@ dependencies = [ "cfg-if", "libc", "r-efi 6.0.0", - "rand_core 0.10.0", + "rand_core 0.10.1", "wasip2", "wasip3", ] @@ -1194,17 +1354,28 @@ dependencies = [ "stable_deref_trait", ] +[[package]] +name = "gimli" +version = "0.33.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0bf7f043f89559805f8c7cacc432749b2fa0d0a0a9ee46ce47164ed5ba7f126c" +dependencies = [ + "fnv", + "hashbrown 0.16.1", + "indexmap", + "stable_deref_trait", +] + [[package]] name = "git2" -version = "0.20.4" +version = "0.21.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7b88256088d75a56f8ecfa070513a775dd9107f6530ef14919dac831af9cfe2b" +checksum = "ddddbf932745a6be37109b6112d3ee09696106f848449069d3a57bba937ab82e" dependencies = [ - "bitflags 2.11.0", + "bitflags 2.13.0", "libc", "libgit2-sys", "log", - "url", ] [[package]] @@ -1228,9 +1399,9 @@ dependencies = [ [[package]] name = "goblin" -version = "0.10.5" +version = "0.10.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "983a6aafb3b12d4c41ea78d39e189af4298ce747353945ff5105b54a056e5cd9" +checksum = "17582616a7718cca54cec18e534a76c7c4aec11a8b9a85695712f262fd15a4c8" dependencies = [ "log", "plain", @@ -1239,9 +1410,9 @@ dependencies = [ [[package]] name = "h2" -version = "0.4.13" +version = "0.4.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2f44da3a8150a6703ed5d34e164b875fd14c2cdab9af1252a9a1020bde2bdc54" +checksum = "171fefbc92fe4a4de27e0698d6a5b392d6a0e333506bc49133760b3bcf948733" dependencies = [ "atomic-waker", "bytes", @@ -1294,9 +1465,9 @@ dependencies = [ [[package]] name = "hashbrown" -version = "0.17.0" +version = "0.17.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4f467dd6dccf739c208452f8014c75c18bb8301b050ad1cfb27153803edb0f51" +checksum = "ed5909b6e89a2db4456e54cd5f673791d7eca6732202bbf2a9cc504fe2f9b84a" dependencies = [ "foldhash 0.2.0", "serde", @@ -1311,9 +1482,9 @@ checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea" [[package]] name = "http" -version = "1.4.0" +version = "1.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e3ba2a386d7f85a81f119ad7498ebe444d2e22c2af0b86b069416ace48b3311a" +checksum = "6970f50e31d6fc17d3fa27329444bfa74e196cf62e95052a3f6fee181dba6425" dependencies = [ "bytes", "itoa", @@ -1356,9 +1527,9 @@ checksum = "df3b46402a9d5adb4c86a0cf463f42e19994e3ee891101b1841f30a545cb49a9" [[package]] name = "hyper" -version = "1.9.0" +version = "1.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6299f016b246a94207e63da54dbe807655bf9e00044f73ded42c3ac5305fbcca" +checksum = "55281c53a1894c864990125767da440a4e630446785086f52523b20033b74498" dependencies = [ "atomic-waker", "bytes", @@ -1378,16 +1549,15 @@ dependencies = [ [[package]] name = "hyper-rustls" -version = "0.27.7" +version = "0.27.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e3c93eb611681b207e1fe55d5a71ecf91572ec8a6705cdb6857f7d8d5242cf58" +checksum = "33ca68d021ef39cf6463ab54c1d0f5daf03377b70561305bb89a8f83aab66e0f" dependencies = [ "http", "hyper", "hyper-util", "rustls", "rustls-native-certs", - "rustls-pki-types", "tokio", "tokio-rustls", "tower-service", @@ -1541,7 +1711,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "65c2f9b5a13324c5dd786bf77a7531216207684da1cefc19fb9b697d08346ac0" dependencies = [ "anyhow", - "bitflags 2.11.0", + "bitflags 2.13.0", "blake3", "cfg-if", "cfg_aliases", @@ -1564,7 +1734,7 @@ dependencies = [ "mshv-ioctls", "opentelemetry 0.31.0", "page_size", - "rand 0.10.0", + "rand 0.10.1", "rust-embed", "serde_json", "termcolor", @@ -1634,7 +1804,8 @@ dependencies = [ "cargo_metadata", "clap", "object 0.39.1", - "wasmtime", + "wasmtime 36.0.10", + "wasmtime 45.0.1", ] [[package]] @@ -1662,7 +1833,8 @@ dependencies = [ "hyperlight-wasm-macro", "spin", "tracing", - "wasmtime", + "wasmtime 36.0.10", + "wasmtime 45.0.1", ] [[package]] @@ -1790,9 +1962,9 @@ dependencies = [ [[package]] name = "idna_adapter" -version = "1.2.1" +version = "1.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3acae9609540aa318d1bc588455225fb2085b9ed0c4f6bd0d9d5bcd86f1a0344" +checksum = "cb68373c0d6620ef8105e855e7745e18b0d00d3bdb07fb532e434244cdb9a714" dependencies = [ "icu_normalizer", "icu_properties", @@ -1805,7 +1977,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d466e9454f08e4a911e14806c24e16fba1b4c121d1ea474396f396069cf949d9" dependencies = [ "equivalent", - "hashbrown 0.17.0", + "hashbrown 0.17.1", "serde", "serde_core", ] @@ -1816,16 +1988,6 @@ version = "2.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d98f6fed1fde3f8c21bc40a1abb88dd75e67924f9cffc3ef95607bad8017f8e2" -[[package]] -name = "iri-string" -version = "0.7.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "25e659a4bb38e810ebc252e53b5814ff908a8c58c2a9ce2fae1bbec24cbf4e20" -dependencies = [ - "memchr", - "serde", -] - [[package]] name = "is_terminal_polyfill" version = "1.70.2" @@ -1858,9 +2020,9 @@ checksum = "8f42a60cbdf9a97f5d2305f08a87dc4e09308d1276d28c869c684d7777685682" [[package]] name = "jiff" -version = "0.2.23" +version = "0.2.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a3546dc96b6d42c5f24902af9e2538e82e39ad350b0c766eb3fbf2d8f3d8359" +checksum = "4603d3033e49e2b0e31229fcab20a5d40089c607d975cd9c80551dc69eed9102" dependencies = [ "jiff-static", "log", @@ -1871,9 +2033,9 @@ dependencies = [ [[package]] name = "jiff-static" -version = "0.2.23" +version = "0.2.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2a8c8b344124222efd714b73bb41f8b5120b27a7cc1c75593a6ff768d9d05aa4" +checksum = "782d32378dddf207193ac91cefb848ad41abb58195c95168e1291227a0832b47" dependencies = [ "proc-macro2", "quote", @@ -1892,13 +2054,12 @@ dependencies = [ [[package]] name = "js-sys" -version = "0.3.94" +version = "0.3.100" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2e04e2ef80ce82e13552136fabeef8a5ed1f985a96805761cbb9a2c34e7664d9" +checksum = "f2025f20d7a4fa7785846e7b63d10a76d3f1cee98ee5cb79ea59703f95e42162" dependencies = [ "cfg-if", "futures-util", - "once_cell", "wasm-bindgen", ] @@ -1912,6 +2073,21 @@ dependencies = [ "windows-sys 0.61.2", ] +[[package]] +name = "konst" +version = "0.2.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "128133ed7824fcd73d6e7b17957c5eb7bacb885649bd8c69708b2331a10bcefb" +dependencies = [ + "konst_macro_rules", +] + +[[package]] +name = "konst_macro_rules" +version = "0.2.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a4933f3f57a8e9d9da04db23fb153356ecaf00cbd14aee46279c33dc80925c37" + [[package]] name = "kvm-bindings" version = "0.14.0" @@ -1927,7 +2103,7 @@ version = "0.24.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "333f77a20344a448f3f70664918135fddeb804e938f28a99d685bd92926e0b19" dependencies = [ - "bitflags 2.11.0", + "bitflags 2.13.0", "kvm-bindings", "libc", "vmm-sys-util", @@ -1964,9 +2140,9 @@ checksum = "68ab91017fe16c622486840e4c83c9a37afeff978bd239b5293d61ece587de66" [[package]] name = "libgit2-sys" -version = "0.18.3+1.9.2" +version = "0.18.5+1.9.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c9b3acc4b91781bb0b3386669d325163746af5f6e4f73e6d2d630e09a35f3487" +checksum = "005d6ae6eac1912906073e069f7db60b1fa98e052a68227824afe3e3a1c59ca2" dependencies = [ "cc", "libc", @@ -1982,21 +2158,18 @@ checksum = "b6d2cec3eae94f9f509c767b45932f1ada8350c4bdb85af2fcab4a3c14807981" [[package]] name = "libredox" -version = "0.1.15" +version = "0.1.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ddbf48fd451246b1f8c2610bd3b4ac0cc6e149d89832867093ab69a17194f08" +checksum = "f02ab6bace2054fb888a3c16f990117b579d14a3088e472d63c6011fa185c9d3" dependencies = [ - "bitflags 2.11.0", "libc", - "plain", - "redox_syscall 0.7.3", ] [[package]] name = "libz-sys" -version = "1.1.28" +version = "1.1.29" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fc3a226e576f50782b3305c5ccf458698f92798987f551c6a02efe8276721e22" +checksum = "85bc9657773828b90eeb625adff10eeac83cc21bbfd8e23a03eaa8a33c9e28d9" dependencies = [ "cc", "libc", @@ -2006,18 +2179,18 @@ dependencies = [ [[package]] name = "linkme" -version = "0.3.35" +version = "0.3.36" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5e3283ed2d0e50c06dd8602e0ab319bb048b6325d0bba739db64ed8205179898" +checksum = "e83272d46373fb8decca684579ac3e7c8f3d71d4cc3aa693df8759e260ae41cf" dependencies = [ "linkme-impl", ] [[package]] name = "linkme-impl" -version = "0.3.35" +version = "0.3.36" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e5cec0ec4228b4853bb129c84dbf093a27e6c7a20526da046defc334a1b017f7" +checksum = "32d59e20403c7d08fe62b4376edfe5c7fb2ef1e6b1465379686d0f21c8df444b" dependencies = [ "proc-macro2", "quote", @@ -2047,9 +2220,9 @@ dependencies = [ [[package]] name = "log" -version = "0.4.29" +version = "0.4.32" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5e5032e24019045c762d3c0f28f5b6b8bbf38563a65908389bf7978758920897" +checksum = "953f07c43838f8e6f9758cab68bf5bed85465e7587ebe0b823f1bcd81978ad3a" [[package]] name = "loom" @@ -2090,9 +2263,9 @@ dependencies = [ [[package]] name = "memchr" -version = "2.8.0" +version = "2.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f8ca58f447f06ed17d5fc4043ce1b10dd205e060fb3ce5b979b8ed8e59ff3f79" +checksum = "6b947ae49db0d222b1dbc6b113ce7248a3fc3a6ca21b696717bfc000ba4484d8" [[package]] name = "memfd" @@ -2105,9 +2278,9 @@ dependencies = [ [[package]] name = "metrics" -version = "0.24.5" +version = "0.24.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ff56c2e7dce6bd462e3b8919986a617027481b1dcc703175b58cf9dd98a2f071" +checksum = "89550ee9f79e88fef3119de263694973a8adb26c21d75322164fb8c493039fe2" dependencies = [ "portable-atomic", "rapidhash", @@ -2138,9 +2311,9 @@ dependencies = [ [[package]] name = "metrics-util" -version = "0.20.3" +version = "0.20.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9e56997f084e57b045edf17c3ed8ba7f9f779c670df8206dfd1c736f4c02dc4a" +checksum = "96f8722f8562635f92f8ed992f26df0532266eb03d5202607c20c0d7e9745e13" dependencies = [ "aho-corasick", "crossbeam-epoch", @@ -2159,9 +2332,9 @@ dependencies = [ [[package]] name = "mio" -version = "1.2.0" +version = "1.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "50b7e5b27aa02a74bac8c3f23f448f8d87ff11f92d3aac1a6ed369ee08cc56c1" +checksum = "02bd0af71c67b473010cbbc60715ee815645a4dc942899111f494b4b737d6fda" dependencies = [ "libc", "wasi", @@ -2170,9 +2343,9 @@ dependencies = [ [[package]] name = "mshv-bindings" -version = "0.6.8" +version = "0.6.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a94fc3871dd23738188e5bc76a1d1a5930ebcaf9308c560a7274aa62b1770594" +checksum = "83303108160c2b7a7bdd25000ee679384e19471386d23e501ed832574c9229ef" dependencies = [ "libc", "num_enum", @@ -2182,9 +2355,9 @@ dependencies = [ [[package]] name = "mshv-ioctls" -version = "0.6.8" +version = "0.6.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1339723fe3a26baf4041459de20ad923e89d312c3bb25dbf9f60738c22a47f5e" +checksum = "1db4449ac7012237b133da366f5b32ce4af1f8caf770486e5a9d54f7f6b73c4c" dependencies = [ "libc", "mshv-bindings", @@ -2203,11 +2376,11 @@ dependencies = [ [[package]] name = "nix" -version = "0.31.2" +version = "0.31.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5d6d0705320c1e6ba1d912b5e37cf18071b6c2e9b7fa8215a1e8a7651966f5d3" +checksum = "cf20d2fde8ff38632c426f1165ed7436270b44f199fc55284c38276f9db47c3d" dependencies = [ - "bitflags 2.11.0", + "bitflags 2.13.0", "cfg-if", "cfg_aliases", "libc", @@ -2270,6 +2443,9 @@ version = "0.39.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2e5a6c098c7a3b6547378093f5cc30bc54fd361ce711e05293a5cc589562739b" dependencies = [ + "crc32fast", + "hashbrown 0.17.1", + "indexmap", "memchr", ] @@ -2420,9 +2596,9 @@ dependencies = [ [[package]] name = "os_str_bytes" -version = "7.1.1" +version = "7.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "63eceb7b5d757011a87d08eb2123db15d87fb0c281f65d101ce30a1e96c3ad5c" +checksum = "89284d0c2af7b0eb5e814798aa07265413c8fd72009f7fc82ea25a81fb287ce9" dependencies = [ "memchr", ] @@ -2455,16 +2631,16 @@ checksum = "2621685985a2ebf1c516881c026032ac7deafcda1a2c9b7850dc81e3dfcb64c1" dependencies = [ "cfg-if", "libc", - "redox_syscall 0.5.18", + "redox_syscall", "smallvec", "windows-link", ] [[package]] name = "pastey" -version = "0.2.1" +version = "0.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b867cad97c0791bbd3aaa6472142568c6c9e8f71937e98379f584cfb0cf35bec" +checksum = "2ee67f1008b1ba2321834326597b8e186293b049a023cdef258527550b9935b4" [[package]] name = "percent-encoding" @@ -2474,18 +2650,18 @@ checksum = "9b4f627cb1b25917193a259e49bdad08f671f8d9708acfd5fe0a8c1455d87220" [[package]] name = "pin-project" -version = "1.1.11" +version = "1.1.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f1749c7ed4bcaf4c3d0a3efc28538844fb29bcdd7d2b67b2be7e20ba861ff517" +checksum = "2466b2336ed02bcdca6b294417127b90ec92038d1d5c4fbeac971a922e0e0924" dependencies = [ "pin-project-internal", ] [[package]] name = "pin-project-internal" -version = "1.1.11" +version = "1.1.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d9b20ed30f105399776b9c883e68e536ef602a16ae6f596d2c473591d6ad64c6" +checksum = "c96395f0a926bc13b1c17622aaddda1ecb55d49c8f1bf9777e4d877800a43f8b" dependencies = [ "proc-macro2", "quote", @@ -2500,9 +2676,9 @@ checksum = "a89322df9ebe1c1578d689c92318e070967d1042b512afbe49518723f4e6d5cd" [[package]] name = "pkg-config" -version = "0.3.32" +version = "0.3.33" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7edddbd0b52d732b21ad9a5fab5c704c14cd949e5e9a1ec5929a24fded1b904c" +checksum = "19f132c84eca552bf34cab8ec81f1c1dcc229b811638f9d283dceabe58c5569e" [[package]] name = "plain" @@ -2546,9 +2722,9 @@ checksum = "c33a9471896f1c69cecef8d20cbe2f7accd12527ce60845ff44c153bb2a21b49" [[package]] name = "portable-atomic-util" -version = "0.2.6" +version = "0.2.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "091397be61a01d4be58e7841595bd4bfedb15f1cd54977d79b8271e94ed799a3" +checksum = "c2a106d1259c23fac8e543272398ae0e3c0b8d33c88ed73d0cc71b0f1d902618" dependencies = [ "portable-atomic", ] @@ -2613,9 +2789,9 @@ dependencies = [ [[package]] name = "prost" -version = "0.14.3" +version = "0.14.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d2ea70524a2f82d518bce41317d0fae74151505651af45faf1ffbd6fd33f0568" +checksum = "528ac67416ff8646872a3c02cad9cc4ee5dc9f9540c9b10771855c95cb2e5ae1" dependencies = [ "bytes", "prost-derive", @@ -2623,9 +2799,9 @@ dependencies = [ [[package]] name = "prost-derive" -version = "0.14.3" +version = "0.14.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "27c6023962132f4b30eb4c172c91ce92d933da334c59c23cddee82358ddafb0b" +checksum = "b570b25f7617e43d59005d0990ccb79e950a423952cea19671b7a876da390adf" dependencies = [ "anyhow", "itertools 0.14.0", @@ -2636,30 +2812,53 @@ dependencies = [ [[package]] name = "prost-types" -version = "0.14.3" +version = "0.14.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8991c4cbdb8bc5b11f0b074ffe286c30e523de90fee5ba8132f1399f23cb3dd7" +checksum = "f94967dc7688f3054c7fac87473ffae4cc4c3904800e2d9f5b857246d8963b0a" dependencies = [ "prost", ] [[package]] name = "pulley-interpreter" -version = "36.0.9" +version = "36.0.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8b78fdec962b639b921badfcfe77db7d18aa3c0c1e292ac2aa268c0efe8fe683" +checksum = "329f575a931601f71fbcb3b31d32d16273da5ba7f532fc10be2e432e710b02de" dependencies = [ - "cranelift-bitset", + "cranelift-bitset 0.123.10", "log", - "pulley-macros", + "pulley-macros 36.0.10", "wasmtime-internal-math", ] +[[package]] +name = "pulley-interpreter" +version = "45.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dd6ccdd6fc70f6c33eb21cb8fe05a71a5f7ee4cbef7a093a8a87dd8a908697cd" +dependencies = [ + "cranelift-bitset 0.132.1", + "log", + "pulley-macros 45.0.1", + "wasmtime-internal-core", +] + +[[package]] +name = "pulley-macros" +version = "36.0.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8bccae89ed67a40989e780105fab43e6c71a077b9fc8ae4c805ff5f73d2a79c8" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + [[package]] name = "pulley-macros" -version = "36.0.9" +version = "45.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f718f4e8cd5fdfa08b3b1d2d25fe288350051be330544305f0a9b93a937b3d42" +checksum = "e00101fdb6fcaf9ea98a1994be11861d7e0c910c718c41bae373c44179e3160c" dependencies = [ "proc-macro2", "quote", @@ -2724,13 +2923,13 @@ dependencies = [ [[package]] name = "rand" -version = "0.10.0" +version = "0.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bc266eb313df6c5c09c1c7b1fbe2510961e5bcd3add930c1e31f7ed9da0feff8" +checksum = "d2e8e8bcc7961af1fdac401278c6a831614941f6164ee3bf4ce61b7edb162207" dependencies = [ "chacha20", "getrandom 0.4.2", - "rand_core 0.10.0", + "rand_core 0.10.1", ] [[package]] @@ -2754,9 +2953,9 @@ dependencies = [ [[package]] name = "rand_core" -version = "0.10.0" +version = "0.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c8d0fd677905edcbeedbf2edb6494d676f0e98d54d5cf9bda0b061cb8fb8aba" +checksum = "63b8176103e19a2643978565ca18b50549f6101881c443590420e4dc998a3c69" [[package]] name = "rand_xoshiro" @@ -2782,14 +2981,14 @@ version = "11.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "498cd0dc59d73224351ee52a95fee0f1a617a2eae0e7d9d720cc622c73a54186" dependencies = [ - "bitflags 2.11.0", + "bitflags 2.13.0", ] [[package]] name = "rayon" -version = "1.11.0" +version = "1.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "368f01d005bf8fd9b1206fb6fa653e6c4a81ceb1466406b81792d87c5677a58f" +checksum = "fb39b166781f92d482534ef4b4b1b2568f42613b53e5b6c160e24cfbfa30926d" dependencies = [ "either", "rayon-core", @@ -2811,16 +3010,7 @@ version = "0.5.18" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ed2bf2547551a7053d6fdfafda3f938979645c44812fbfcda098faae3f1a362d" dependencies = [ - "bitflags 2.11.0", -] - -[[package]] -name = "redox_syscall" -version = "0.7.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ce70a74e890531977d37e532c34d45e9055d2409ed08ddba14529471ed0be16" -dependencies = [ - "bitflags 2.11.0", + "bitflags 2.13.0", ] [[package]] @@ -2848,11 +3038,25 @@ dependencies = [ "smallvec", ] +[[package]] +name = "regalloc2" +version = "0.15.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "de2c52737737f8609e94f975dee22854a2d5c125772d4b1cf292120f4d45c186" +dependencies = [ + "allocator-api2", + "bumpalo", + "hashbrown 0.17.1", + "log", + "rustc-hash", + "smallvec", +] + [[package]] name = "regex" -version = "1.12.3" +version = "1.12.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e10754a14b9137dd7b1e3e5b0493cc9171fdd105e0ab477f51b72e7f3ac0e276" +checksum = "f1292b7759ae1cb9ec195452d1390a074f0cd8541ab7a5a8c31cd6db45d4a6ba" dependencies = [ "aho-corasick", "memchr", @@ -2873,15 +3077,15 @@ dependencies = [ [[package]] name = "regex-syntax" -version = "0.8.10" +version = "0.8.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dc897dd8d9e8bd1ed8cdad82b5966c3e0ecae09fb1907d58efaa013543185d0a" +checksum = "d6f6ff9a378485b298a5286656da665ba74413d36db0979633275d2e708145d4" [[package]] name = "reqwest" -version = "0.13.3" +version = "0.13.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62e0021ea2c22aed41653bc7e1419abb2c97e038ff2c33d0e1309e49a97deec0" +checksum = "219c5811de6525e5416c7d5d53bb656d3afdbc6c5af816e0802bcfa42dbdc1c3" dependencies = [ "base64", "bytes", @@ -2985,7 +3189,7 @@ version = "1.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b6fe4565b9518b83ef4f91bb47ce29620ca828bd32cb7e408f0062e9930ba190" dependencies = [ - "bitflags 2.11.0", + "bitflags 2.13.0", "errno", "libc", "linux-raw-sys", @@ -2994,9 +3198,9 @@ dependencies = [ [[package]] name = "rustls" -version = "0.23.37" +version = "0.23.40" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "758025cb5fccfd3bc2fd74708fd4682be41d99e5dff73c377c0646c6012c73a4" +checksum = "ef86cd5876211988985292b91c96a8f2d298df24e75989a43a3c73f2d4d8168b" dependencies = [ "aws-lc-rs", "once_cell", @@ -3008,9 +3212,9 @@ dependencies = [ [[package]] name = "rustls-native-certs" -version = "0.8.3" +version = "0.8.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "612460d5f7bea540c490b2b6395d8e34a953e52b491accd6c86c8164c5932a63" +checksum = "dab5152771c58876a2146916e53e35057e1a4dfa2b9df0f0305b07f611fdea4d" dependencies = [ "openssl-probe", "rustls-pki-types", @@ -3020,9 +3224,9 @@ dependencies = [ [[package]] name = "rustls-pki-types" -version = "1.14.0" +version = "1.14.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "be040f8b0a225e40375822a563fa9524378b9d63112f53e19ffff34df5d33fdd" +checksum = "30a7197ae7eb376e574fe940d068c30fe0462554a3ddbe4eca7838e049c937a9" dependencies = [ "zeroize", ] @@ -3101,7 +3305,7 @@ version = "3.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b7f4bc775c73d9a02cde8bf7b2ec4c9d12743edf609006c7facc23998404cd1d" dependencies = [ - "bitflags 2.11.0", + "bitflags 2.13.0", "core-foundation", "core-foundation-sys", "libc", @@ -3182,9 +3386,9 @@ dependencies = [ [[package]] name = "serde_json" -version = "1.0.149" +version = "1.0.150" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "83fc039473c5595ace860d8c4fafa220ff474b3fc6bfdb4293327f1a37e94d86" +checksum = "e8014e44b4736ed0538adeecded0fce2a272f22dc9578a7eb6b2d9993c74cfb9" dependencies = [ "itoa", "memchr", @@ -3270,9 +3474,9 @@ dependencies = [ [[package]] name = "socket2" -version = "0.6.3" +version = "0.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3a766e1110788c36f4fa1c2b71b387a7815aa65f88ce0229841826633d93723e" +checksum = "52d1cfed4120b4d927bf7c0f86d2087a4a7d6027c906d9f9d525a80573b9be51" dependencies = [ "libc", "windows-sys 0.61.2", @@ -3532,9 +3736,9 @@ dependencies = [ [[package]] name = "toml_edit" -version = "0.25.10+spec-1.1.0" +version = "0.25.12+spec-1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a82418ca169e235e6c399a84e395ab6debeb3bc90edc959bf0f48647c6a32d1b" +checksum = "d2153edc6955a6c354fad8f5efd38b6a8769bdccf9fe50f8e1329f81b0baa5d7" dependencies = [ "indexmap", "toml_datetime 1.1.1+spec-1.1.0", @@ -3559,9 +3763,9 @@ checksum = "756daf9b1013ebe47a8776667b466417e2d4c5679d441c26230efd9ef78692db" [[package]] name = "tonic" -version = "0.14.5" +version = "0.14.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fec7c61a0695dc1887c1b53952990f3ad2e3a31453e1f49f10e75424943a93ec" +checksum = "ac2a5518c70fa84342385732db33fb3f44bc4cc748936eb5833d2df34d6445ef" dependencies = [ "async-trait", "base64", @@ -3585,9 +3789,9 @@ dependencies = [ [[package]] name = "tonic-prost" -version = "0.14.5" +version = "0.14.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a55376a0bbaa4975a3f10d009ad763d8f4108f067c7c2e74f3001fb49778d309" +checksum = "50849f68853be452acf590cde0b146665b8d507b3b8af17261df47e02c209ea0" dependencies = [ "bytes", "prost", @@ -3596,9 +3800,9 @@ dependencies = [ [[package]] name = "tonic-types" -version = "0.14.5" +version = "0.14.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2a875a902255423d34c1f20838ab374126db8eb41625b7947a1d54113b0b7399" +checksum = "73ab1b02061f83d519bba3caa167f88f261ef05720ab8ebc954ade70de3348e8" dependencies = [ "prost", "prost-types", @@ -3626,20 +3830,20 @@ dependencies = [ [[package]] name = "tower-http" -version = "0.6.8" +version = "0.6.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d4e6559d53cc268e5031cd8429d05415bc4cb4aefc4aa5d6cc35fbf5b924a1f8" +checksum = "4cfcf7e2740e6fc6d4d688b4ef00650406bb94adf4731e43c096c3a19fe40840" dependencies = [ - "bitflags 2.11.0", + "bitflags 2.13.0", "bytes", "futures-util", "http", "http-body", - "iri-string", "pin-project-lite", "tower", "tower-layer", "tower-service", + "url", ] [[package]] @@ -3777,9 +3981,9 @@ checksum = "bc7d623258602320d5c55d1bc22793b57daff0ec7efc270ea7d55ce1d5f5471c" [[package]] name = "typenum" -version = "1.19.0" +version = "1.20.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "562d481066bde0658276a35467c4af00bdc6ee726305698a55b86e61d7ad82bb" +checksum = "b6f5e870be6c3b371b77fe0ee0bafb859fa4964b4404c27de1d380043c4dda20" [[package]] name = "unicode-ident" @@ -3896,11 +4100,11 @@ checksum = "ccf3ec651a847eb01de73ccad15eb7d99f80485de043efb2f370cd654f4ea44b" [[package]] name = "wasip2" -version = "1.0.2+wasi-0.2.9" +version = "1.0.3+wasi-0.2.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9517f9239f02c069db75e65f174b3da828fe5f5b945c4dd26bd25d89c03ebcf5" +checksum = "20064672db26d7cdc89c7798c48a0fdfac8213434a1186e5ef29fd560ae223d6" dependencies = [ - "wit-bindgen", + "wit-bindgen 0.57.1", ] [[package]] @@ -3909,14 +4113,14 @@ version = "0.4.0+wasi-0.3.0-rc-2026-01-06" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5428f8bf88ea5ddc08faddef2ac4a67e390b88186c703ce6dbd955e1c145aca5" dependencies = [ - "wit-bindgen", + "wit-bindgen 0.51.0", ] [[package]] name = "wasm-bindgen" -version = "0.2.117" +version = "0.2.123" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0551fc1bb415591e3372d0bc4780db7e587d84e2a7e79da121051c5c4b89d0b0" +checksum = "a254a4b10c19a76f09a27640e7ffbf9bc30bf67e16a3bf28aaefa4920fe81563" dependencies = [ "cfg-if", "once_cell", @@ -3927,9 +4131,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-futures" -version = "0.4.67" +version = "0.4.73" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "03623de6905b7206edd0a75f69f747f134b7f0a2323392d664448bf2d3c5d87e" +checksum = "54568702fabf5d4849ce2b90fadfa64168a097eaf4b351ce9df8b687a0086aaf" dependencies = [ "js-sys", "wasm-bindgen", @@ -3937,9 +4141,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro" -version = "0.2.117" +version = "0.2.123" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7fbdf9a35adf44786aecd5ff89b4563a90325f9da0923236f6104e603c7e86be" +checksum = "24a40fc75b0ec6f3746ceb10d36f53a93dcd68a93b11b6445983945d79eba0dc" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -3947,9 +4151,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.117" +version = "0.2.123" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dca9693ef2bab6d4e6707234500350d8dad079eb508dca05530c85dc3a529ff2" +checksum = "908f34bd9b9ce3d4caf07b72dfab63d61504d156856c6bd3cd87fa350cf3985b" dependencies = [ "bumpalo", "proc-macro2", @@ -3960,9 +4164,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-shared" -version = "0.2.117" +version = "0.2.123" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "39129a682a6d2d841b6c429d0c51e5cb0ed1a03829d8b3d1e69a011e62cb3d3b" +checksum = "7acbf7616c27b194bbb550bf77ed0c2c3e5b7fd1260a93082b95fb7f47959b92" dependencies = [ "unicode-ident", ] @@ -3987,6 +4191,16 @@ dependencies = [ "wasmparser 0.244.0", ] +[[package]] +name = "wasm-encoder" +version = "0.248.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ac92cf547bc18d27ecc521015c08c353b4f18b84ab388bb6d1b6b682c620d9b6" +dependencies = [ + "leb128fmt", + "wasmparser 0.248.0", +] + [[package]] name = "wasm-metadata" version = "0.244.0" @@ -4005,7 +4219,7 @@ version = "0.236.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a9b1e81f3eb254cf7404a82cee6926a4a3ccc5aad80cc3d43608a070c67aa1d7" dependencies = [ - "bitflags 2.11.0", + "bitflags 2.13.0", "hashbrown 0.15.5", "indexmap", "semver", @@ -4018,7 +4232,7 @@ version = "0.244.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "47b807c72e1bac69382b3a6fb3dbe8ea4c0ed87ff5629b8685ae6b9a611028fe" dependencies = [ - "bitflags 2.11.0", + "bitflags 2.13.0", "hashbrown 0.15.5", "indexmap", "semver", @@ -4030,8 +4244,8 @@ version = "0.248.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "aa4439c5eee9df71ee0c6efb37f63b1fcb1fec38f85f5142c54e7ed05d33091a" dependencies = [ - "bitflags 2.11.0", - "hashbrown 0.17.0", + "bitflags 2.13.0", + "hashbrown 0.17.1", "indexmap", "semver", "serde", @@ -4048,15 +4262,26 @@ dependencies = [ "wasmparser 0.236.1", ] +[[package]] +name = "wasmprinter" +version = "0.248.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "30b264a5410b008d4d199a92bf536eae703cbd614482fc1ec53831cf19e1c183" +dependencies = [ + "anyhow", + "termcolor", + "wasmparser 0.248.0", +] + [[package]] name = "wasmtime" -version = "36.0.9" +version = "36.0.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b10306ead921db2c4645ff99867b7539b65e18afd8816d471547f5e6f3b09492" +checksum = "507d213104e83a7519d91af444a8b19c04281f2eef162d448ee7a894ac1c827d" dependencies = [ - "addr2line", + "addr2line 0.25.1", "anyhow", - "bitflags 2.11.0", + "bitflags 2.13.0", "bumpalo", "cc", "cfg-if", @@ -4070,7 +4295,7 @@ dependencies = [ "object 0.37.3", "once_cell", "postcard", - "pulley-interpreter", + "pulley-interpreter 36.0.10", "rustix", "semver", "serde", @@ -4078,32 +4303,74 @@ dependencies = [ "smallvec", "target-lexicon", "wasmparser 0.236.1", - "wasmtime-environ", + "wasmtime-environ 36.0.10", "wasmtime-internal-asm-macros", - "wasmtime-internal-component-macro", - "wasmtime-internal-component-util", - "wasmtime-internal-cranelift", - "wasmtime-internal-fiber", - "wasmtime-internal-jit-debug", - "wasmtime-internal-jit-icache-coherence", + "wasmtime-internal-component-macro 36.0.10", + "wasmtime-internal-component-util 36.0.10", + "wasmtime-internal-cranelift 36.0.10", + "wasmtime-internal-fiber 36.0.10", + "wasmtime-internal-jit-debug 36.0.10", + "wasmtime-internal-jit-icache-coherence 36.0.10", "wasmtime-internal-math", "wasmtime-internal-slab", - "wasmtime-internal-unwinder", - "wasmtime-internal-versioned-export-macros", - "wasmtime-internal-winch", + "wasmtime-internal-unwinder 36.0.10", + "wasmtime-internal-versioned-export-macros 36.0.10", + "wasmtime-internal-winch 36.0.10", "windows-sys 0.60.2", ] +[[package]] +name = "wasmtime" +version = "45.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c191891081c3bf9f10cb579819b32b0e81695641dc639eef34b57cf10c59ad81" +dependencies = [ + "addr2line 0.26.1", + "async-trait", + "bitflags 2.13.0", + "bumpalo", + "cc", + "cfg-if", + "encoding_rs", + "libc", + "log", + "mach2", + "memfd", + "object 0.39.1", + "once_cell", + "postcard", + "pulley-interpreter 45.0.1", + "rustix", + "semver", + "serde", + "serde_derive", + "smallvec", + "target-lexicon", + "wasmparser 0.248.0", + "wasmtime-environ 45.0.1", + "wasmtime-internal-component-macro 45.0.1", + "wasmtime-internal-component-util 45.0.1", + "wasmtime-internal-core", + "wasmtime-internal-cranelift 45.0.1", + "wasmtime-internal-fiber 45.0.1", + "wasmtime-internal-jit-debug 45.0.1", + "wasmtime-internal-jit-icache-coherence 45.0.1", + "wasmtime-internal-unwinder 45.0.1", + "wasmtime-internal-versioned-export-macros 45.0.1", + "wasmtime-internal-winch 45.0.1", + "windows-sys 0.61.2", +] + [[package]] name = "wasmtime-environ" -version = "36.0.9" +version = "36.0.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e7fb2c37ca263d444f33871bf0221e7de0707b2b2bb88165df6db6d58c73375f" +checksum = "9784b325c3b85562ac6d7f81c8348c42af1f137d98dd4fc6631860e4e68bb655" dependencies = [ "anyhow", - "cranelift-bitset", - "cranelift-entity", - "gimli", + "cranelift-bitset 0.123.10", + "cranelift-entity 0.123.10", + "gimli 0.32.3", "indexmap", "log", "object 0.37.3", @@ -4115,72 +4382,162 @@ dependencies = [ "target-lexicon", "wasm-encoder 0.236.1", "wasmparser 0.236.1", - "wasmprinter", - "wasmtime-internal-component-util", + "wasmprinter 0.236.1", + "wasmtime-internal-component-util 36.0.10", +] + +[[package]] +name = "wasmtime-environ" +version = "45.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0f337d68a62d868f3c297517b46d20dc7e293f0da36bbee2f6ec3c30eab938bd" +dependencies = [ + "anyhow", + "cpp_demangle", + "cranelift-bforest 0.132.1", + "cranelift-bitset 0.132.1", + "cranelift-entity 0.132.1", + "gimli 0.33.0", + "hashbrown 0.17.1", + "indexmap", + "log", + "object 0.39.1", + "postcard", + "rustc-demangle", + "semver", + "serde", + "serde_derive", + "sha2", + "smallvec", + "target-lexicon", + "wasm-encoder 0.248.0", + "wasmparser 0.248.0", + "wasmprinter 0.248.0", + "wasmtime-internal-component-util 45.0.1", + "wasmtime-internal-core", ] [[package]] name = "wasmtime-internal-asm-macros" -version = "36.0.9" +version = "36.0.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "19c6c0d3c8d2db554a3af8e8d413ff2815362ebce0911808ecfdaaa257438f93" +checksum = "bcaa9336cd5ba934ba734dfdfe35f5245c3c74b4e34f9af9e114fad892d81b3d" dependencies = [ "cfg-if", ] [[package]] name = "wasmtime-internal-component-macro" -version = "36.0.9" +version = "36.0.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3e3f3752466eb0e1f97149e53bf15c0e18ff520fc0a98b4bee1680e6de1c6f0" +checksum = "91aba228ec4f646cb9514be55538c842822cb96f2c306f75d664eea6b6f2e9eb" dependencies = [ "anyhow", "proc-macro2", "quote", "syn", - "wasmtime-internal-component-util", - "wasmtime-internal-wit-bindgen", + "wasmtime-internal-component-util 36.0.10", + "wasmtime-internal-wit-bindgen 36.0.10", "wit-parser 0.236.1", ] +[[package]] +name = "wasmtime-internal-component-macro" +version = "45.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ab1cc8df1940657960571d7bc9bc0eadf869c0eb95cff831a6554409f89b25b0" +dependencies = [ + "anyhow", + "proc-macro2", + "quote", + "syn", + "wasmtime-internal-component-util 45.0.1", + "wasmtime-internal-wit-bindgen 45.0.1", + "wit-parser 0.248.0", +] + [[package]] name = "wasmtime-internal-component-util" -version = "36.0.9" +version = "36.0.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f54018baf62f4e9c616c31f2aeadcf0c202ff691a390ad53e291ae7160b169e" +checksum = "c68f4a2387b0aea544aa2317e295583be54fed852e0d1a31c0070984bfd6a507" + +[[package]] +name = "wasmtime-internal-component-util" +version = "45.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f73ccd2e0e6bd91fb0161a17ee5e2d7badbeba6eb7461d0e0e3991492bd3835d" + +[[package]] +name = "wasmtime-internal-core" +version = "45.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "110bf85122cd451d3b9ff67f8911d428ec9b729208abe950a0333c3244660e88" +dependencies = [ + "hashbrown 0.17.1", + "libm", + "serde", +] [[package]] name = "wasmtime-internal-cranelift" -version = "36.0.9" +version = "36.0.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a2412f2afb0a5db2a4ac1cfff73247e240aeaa90bf41497ad0a5084b6a24eca" +checksum = "e7d938ae501275f44e7e5532ae4bb720542b429357014d33842e128c46fb9b54" dependencies = [ "anyhow", "cfg-if", - "cranelift-codegen", - "cranelift-control", - "cranelift-entity", - "cranelift-frontend", - "cranelift-native", - "gimli", + "cranelift-codegen 0.123.10", + "cranelift-control 0.123.10", + "cranelift-entity 0.123.10", + "cranelift-frontend 0.123.10", + "cranelift-native 0.123.10", + "gimli 0.32.3", "itertools 0.14.0", "log", "object 0.37.3", - "pulley-interpreter", + "pulley-interpreter 36.0.10", "smallvec", "target-lexicon", "thiserror", "wasmparser 0.236.1", - "wasmtime-environ", + "wasmtime-environ 36.0.10", "wasmtime-internal-math", - "wasmtime-internal-versioned-export-macros", + "wasmtime-internal-versioned-export-macros 36.0.10", +] + +[[package]] +name = "wasmtime-internal-cranelift" +version = "45.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b0236a21553c5b30ee953f413a8dc99729548b747219eef7e70f8288ed313ebe" +dependencies = [ + "cfg-if", + "cranelift-codegen 0.132.1", + "cranelift-control 0.132.1", + "cranelift-entity 0.132.1", + "cranelift-frontend 0.132.1", + "cranelift-native 0.132.1", + "gimli 0.33.0", + "itertools 0.14.0", + "log", + "object 0.39.1", + "pulley-interpreter 45.0.1", + "smallvec", + "target-lexicon", + "thiserror", + "wasmparser 0.248.0", + "wasmtime-environ 45.0.1", + "wasmtime-internal-core", + "wasmtime-internal-unwinder 45.0.1", + "wasmtime-internal-versioned-export-macros 45.0.1", ] [[package]] name = "wasmtime-internal-fiber" -version = "36.0.9" +version = "36.0.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ecfdc460dd5d343d88ff1ffaf65ae019feeb6124ddcfd3f39d28331068d25b1f" +checksum = "c1443b0914ff848ee7920e0f232368168e2819b739c54f3c352f0559b6164343" dependencies = [ "anyhow", "cc", @@ -4188,25 +4545,50 @@ dependencies = [ "libc", "rustix", "wasmtime-internal-asm-macros", - "wasmtime-internal-versioned-export-macros", + "wasmtime-internal-versioned-export-macros 36.0.10", "windows-sys 0.60.2", ] +[[package]] +name = "wasmtime-internal-fiber" +version = "45.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1ccd50931b61ad593ae91e62d41a96b997b26c9308305cae4523cfef9301d9e8" +dependencies = [ + "cc", + "cfg-if", + "libc", + "rustix", + "wasmtime-environ 45.0.1", + "wasmtime-internal-versioned-export-macros 45.0.1", + "windows-sys 0.61.2", +] + [[package]] name = "wasmtime-internal-jit-debug" -version = "36.0.9" +version = "36.0.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b5abb428a71827b7f90fc64406749883ccc6e58addf6d36974d5e06942011707" +checksum = "861d6f2a1652e95ca10b02552934b3bd460d7416b285fe10d7ca8c0a2b90dc3e" dependencies = [ "cc", - "wasmtime-internal-versioned-export-macros", + "wasmtime-internal-versioned-export-macros 36.0.10", +] + +[[package]] +name = "wasmtime-internal-jit-debug" +version = "45.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b0a52ca7429272234b44f81fdf80d4793593e5c368b0f960d41fd401b1117bec" +dependencies = [ + "cc", + "wasmtime-internal-versioned-export-macros 45.0.1", ] [[package]] name = "wasmtime-internal-jit-icache-coherence" -version = "36.0.9" +version = "36.0.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba6cc13f14c3fb83fb877cb1d5c605e93f7ec1bf7fc1a5e8b361209d2f8ca028" +checksum = "b1caeb3140c46319fecf09d93dc38a373eb535fd478e401a9fb2ac2da30fe5f6" dependencies = [ "anyhow", "cfg-if", @@ -4214,39 +4596,75 @@ dependencies = [ "windows-sys 0.60.2", ] +[[package]] +name = "wasmtime-internal-jit-icache-coherence" +version = "45.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aa6818a4864719772680694f4e4649a8600bb5efcf71111ebaf7419b266463e8" +dependencies = [ + "cfg-if", + "libc", + "wasmtime-internal-core", + "windows-sys 0.61.2", +] + [[package]] name = "wasmtime-internal-math" -version = "36.0.9" +version = "36.0.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1cb209473a09f4dbd9c87bb9f18b8dcb0c9da30d12a260e3eacf7a1a53b41480" +checksum = "7c631615929951a4076aae64da7d6cad88668d292f19672606392c24ae9c5a00" dependencies = [ "libm", ] [[package]] name = "wasmtime-internal-slab" -version = "36.0.9" +version = "36.0.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aab4df5a04752106e1ecef9d40145ef28fa033b0d5dd3c839c9b208b2d522183" +checksum = "7b28104d57b5bdb5d8facb3a8418463ec6c2cb40bb4adf9833b727ebf6a254eb" [[package]] name = "wasmtime-internal-unwinder" -version = "36.0.9" +version = "36.0.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5359875d29bddb6f7e65e698157714d8d35ebd8ea2a92893d05d6b062147b639" +checksum = "0dd89f2db7377869aeaf66b71f56def8df54b9482e4f4e5533ccec2505f5c691" dependencies = [ "anyhow", "cfg-if", - "cranelift-codegen", + "cranelift-codegen 0.123.10", "log", "object 0.37.3", ] +[[package]] +name = "wasmtime-internal-unwinder" +version = "45.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1fdc6a69c42fbbf13104ccbf0d3c096d0392f00102e2c70b542d9fca402eb162" +dependencies = [ + "cfg-if", + "cranelift-codegen 0.132.1", + "log", + "object 0.39.1", + "wasmtime-environ 45.0.1", +] + [[package]] name = "wasmtime-internal-versioned-export-macros" -version = "36.0.9" +version = "36.0.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2e247bcdd69701743ba386c933b26ebad2ce912ff9cb68b5b71fdb29d39ba04a" +checksum = "a9cdb9c2e3965ee15629d067203cb800e9822664d04335dadc6fe1788d4fc335" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "wasmtime-internal-versioned-export-macros" +version = "45.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fa0bd1cd696ec4b7e6f46357c0479e7739c3858e54afb69a15765402bbc1f9dd" dependencies = [ "proc-macro2", "quote", @@ -4255,39 +4673,69 @@ dependencies = [ [[package]] name = "wasmtime-internal-winch" -version = "36.0.9" +version = "36.0.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d0298dfd9f57588222b5a92dcffe75894f1ead4e519850f176bde7fcfd105d54" +checksum = "53f693c8db710f20b927bcee025acd345acf599d055b63f122613d52f5553a5f" dependencies = [ "anyhow", - "cranelift-codegen", - "gimli", + "cranelift-codegen 0.123.10", + "gimli 0.32.3", "object 0.37.3", "target-lexicon", "wasmparser 0.236.1", - "wasmtime-environ", - "wasmtime-internal-cranelift", - "winch-codegen", + "wasmtime-environ 36.0.10", + "wasmtime-internal-cranelift 36.0.10", + "winch-codegen 36.0.10", +] + +[[package]] +name = "wasmtime-internal-winch" +version = "45.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c2ca01234ef55acd10c0fa5a2f96c3fd422eba03b221e2e9572944d19a476a7" +dependencies = [ + "cranelift-codegen 0.132.1", + "gimli 0.33.0", + "log", + "object 0.39.1", + "target-lexicon", + "wasmparser 0.248.0", + "wasmtime-environ 45.0.1", + "wasmtime-internal-cranelift 45.0.1", + "winch-codegen 45.0.1", ] [[package]] name = "wasmtime-internal-wit-bindgen" -version = "36.0.9" +version = "36.0.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1706803e83b9bae726a0f55e7c1bbf78a7421cf2da68c940c70978e91dfc0339" +checksum = "c6c97d4e849494d290e05573298bd372e12be86b2074502dc5e02f4ef7628002" dependencies = [ "anyhow", - "bitflags 2.11.0", + "bitflags 2.13.0", "heck", "indexmap", "wit-parser 0.236.1", ] +[[package]] +name = "wasmtime-internal-wit-bindgen" +version = "45.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "708b3d8cfaad2d33a92ec4ed93d69e9836c04f7eb5b8dfe1dde9df47c41f20b7" +dependencies = [ + "anyhow", + "bitflags 2.13.0", + "heck", + "indexmap", + "wit-parser 0.248.0", +] + [[package]] name = "web-sys" -version = "0.3.94" +version = "0.3.100" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cd70027e39b12f0849461e08ffc50b9cd7688d942c1c8e3c7b22273236b4dd0a" +checksum = "6e0871acf327f283dc6da28a1696cdc64fb355ba9f935d052021fa77f35cce69" dependencies = [ "js-sys", "wasm-bindgen", @@ -4305,9 +4753,9 @@ dependencies = [ [[package]] name = "which" -version = "8.0.2" +version = "8.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "81995fafaaaf6ae47a7d0cc83c67caf92aeb7e5331650ae6ff856f7c0c60c459" +checksum = "c789537cf2f7f55be8e6192f92e464174ee55f91af622777f7f1ceb0dbccd03e" dependencies = [ "libc", "regex", @@ -4346,24 +4794,43 @@ checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" [[package]] name = "winch-codegen" -version = "36.0.9" +version = "36.0.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2e2d7ea2137be52644d9c42ca5a4899bba07c2ed2db1e66c4c1994adfe35d39e" +checksum = "4332c8656af179fb8fc3ae5114c738c29399ee97b638d431725201c17f99294e" dependencies = [ "anyhow", - "cranelift-assembler-x64", - "cranelift-codegen", - "gimli", - "regalloc2", + "cranelift-assembler-x64 0.123.10", + "cranelift-codegen 0.123.10", + "gimli 0.32.3", + "regalloc2 0.12.2", "smallvec", "target-lexicon", "thiserror", "wasmparser 0.236.1", - "wasmtime-environ", - "wasmtime-internal-cranelift", + "wasmtime-environ 36.0.10", + "wasmtime-internal-cranelift 36.0.10", "wasmtime-internal-math", ] +[[package]] +name = "winch-codegen" +version = "45.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "35fdfab04a4d446c558a9ea994ded662d35580a17b15385b862002703aa43245" +dependencies = [ + "cranelift-assembler-x64 0.132.1", + "cranelift-codegen 0.132.1", + "gimli 0.33.0", + "regalloc2 0.15.1", + "smallvec", + "target-lexicon", + "thiserror", + "wasmparser 0.248.0", + "wasmtime-environ 45.0.1", + "wasmtime-internal-core", + "wasmtime-internal-cranelift 45.0.1", +] + [[package]] name = "windows" version = "0.62.2" @@ -4641,9 +5108,9 @@ checksum = "d6bbff5f0aada427a1e5a6da5f1f98158182f26556f345ac9e04d36d0ebed650" [[package]] name = "winnow" -version = "1.0.1" +version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "09dac053f1cd375980747450bfc7250c264eaae0583872e845c0c7cd578872b5" +checksum = "0592e1c9d151f854e6fd382574c3a0855250e1d9b2f99d9281c6e6391af352f1" dependencies = [ "memchr", ] @@ -4657,6 +5124,12 @@ dependencies = [ "wit-bindgen-rust-macro", ] +[[package]] +name = "wit-bindgen" +version = "0.57.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1ebf944e87a7c253233ad6766e082e3cd714b5d03812acc24c318f549614536e" + [[package]] name = "wit-bindgen-core" version = "0.51.0" @@ -4706,7 +5179,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9d66ea20e9553b30172b5e831994e35fbde2d165325bec84fc43dbf6f4eb9cb2" dependencies = [ "anyhow", - "bitflags 2.11.0", + "bitflags 2.13.0", "indexmap", "log", "serde", @@ -4754,6 +5227,25 @@ dependencies = [ "wasmparser 0.244.0", ] +[[package]] +name = "wit-parser" +version = "0.248.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "247ad505da2915a082fe13204c5ba8788425aea1de54f43b284818cf82637856" +dependencies = [ + "anyhow", + "hashbrown 0.17.1", + "id-arena", + "indexmap", + "log", + "semver", + "serde", + "serde_derive", + "serde_json", + "unicode-xid", + "wasmparser 0.248.0", +] + [[package]] name = "writeable" version = "0.6.3" @@ -4772,9 +5264,9 @@ dependencies = [ [[package]] name = "yoke" -version = "0.8.2" +version = "0.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "abe8c5fda708d9ca3df187cae8bfb9ceda00dd96231bed36e445a1a48e66f9ca" +checksum = "709fe23a0424b6a435d82152b1bd3fdfb0833487d5fa90d05d42762a9891fef5" dependencies = [ "stable_deref_trait", "yoke-derive", @@ -4795,18 +5287,18 @@ dependencies = [ [[package]] name = "zerocopy" -version = "0.8.48" +version = "0.8.52" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eed437bf9d6692032087e337407a86f04cd8d6a16a37199ed57949d415bd68e9" +checksum = "ce1022995ff5ff5d841ad7d994facc23098cd40152f2c1d11cd607c6f530653f" dependencies = [ "zerocopy-derive", ] [[package]] name = "zerocopy-derive" -version = "0.8.48" +version = "0.8.52" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70e3cd084b1788766f53af483dd21f93881ff30d7320490ec3ef7526d203bad4" +checksum = "1ae7f38b72ec2a254e2b87ef277cf2cd4fb97cbebf944faa6f33354da0867930" dependencies = [ "proc-macro2", "quote", @@ -4815,9 +5307,9 @@ dependencies = [ [[package]] name = "zerofrom" -version = "0.1.7" +version = "0.1.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "69faa1f2a1ea75661980b013019ed6687ed0e83d069bc1114e2cc74c6c04c4df" +checksum = "0ec05a11813ea801ff6d75110ad09cd0824ddba17dfe17128ea0d5f68e6c5272" dependencies = [ "zerofrom-derive", ] diff --git a/Cargo.toml b/Cargo.toml index 3b9f11a2..1947b824 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -6,7 +6,7 @@ resolver = "2" [workspace.package] version = "0.14.0" edition = "2024" -rust-version = "1.89" +rust-version = "1.93" license = "Apache-2.0" homepage = "https://github.com/hyperlight-dev/hyperlight-wasm" repository = "https://github.com/hyperlight-dev/hyperlight-wasm" diff --git a/Justfile b/Justfile index 95c0b6bd..8e68245a 100644 --- a/Justfile +++ b/Justfile @@ -42,28 +42,28 @@ build-wasm-examples target=default-target features="": (compile-wit) build-rust-wasm-examples target=default-target features="": (mkdir-redist target) rustup target add wasm32-unknown-unknown cd ./src/tests/rust_guests/rust_wasm_samples && cargo build --target wasm32-unknown-unknown --profile={{ if target == "debug" {"dev"} else { target } }} - cargo run {{ if features =="" {''} else if features=="no-default-features" {"--no-default-features" } else {"--features " + features } }} -p hyperlight-wasm-aot compile {{ if features =~ "gdb" {"--debug"} else {""} }} ./src/tests/rust_guests/rust_wasm_samples/target/wasm32-unknown-unknown/{{ target }}/rust_wasm_samples.wasm ./x64/{{ target }}/rust_wasm_samples.aot + cargo run -p hyperlight-wasm-aot compile {{ if features =~ "gdb" {"--debug"} else {""} }} {{ if features =~ "wasmtime_latest" {"--latest"} else {""} }} ./src/tests/rust_guests/rust_wasm_samples/target/wasm32-unknown-unknown/{{ target }}/rust_wasm_samples.wasm ./x64/{{ target }}/rust_wasm_samples.aot build-pulley-rust-wasm-examples target=default-target features="": (mkdir-redist target) rustup target add wasm32-unknown-unknown cd ./src/tests/rust_guests/rust_wasm_samples && cargo build --target wasm32-unknown-unknown --profile={{ if target == "debug" {"dev"} else { target } }} - cargo run {{ if features =="" {''} else if features=="no-default-features" {"--no-default-features" } else {"--features " + features } }} -p hyperlight-wasm-aot compile --pulley {{ if features =~ "gdb" {"--debug"} else {""} }} ./src/tests/rust_guests/rust_wasm_samples/target/wasm32-unknown-unknown/{{ target }}/rust_wasm_samples.wasm ./x64/{{ target }}/rust_wasm_samples.aot + cargo run -p hyperlight-wasm-aot compile --pulley {{ if features =~ "gdb" {"--debug"} else {""} }} {{ if features =~ "wasmtime_latest" {"--latest"} else {""} }} ./src/tests/rust_guests/rust_wasm_samples/target/wasm32-unknown-unknown/{{ target }}/rust_wasm_samples.wasm ./x64/{{ target }}/rust_wasm_samples.aot build-rust-component-examples target=default-target features="": (compile-wit) # use cargo component so we don't get all the wasi imports https://github.com/bytecodealliance/cargo-component?tab=readme-ov-file#relationship-with-wasm32-wasip2 # we also explicitly target wasm32-unknown-unknown since cargo component might try to pull in wasi imports https://github.com/bytecodealliance/cargo-component/issues/290 rustup target add wasm32-unknown-unknown cd ./src/tests/rust_guests/component_sample && cargo component build --target wasm32-unknown-unknown --profile={{ if target == "debug" {"dev"} else { target } }} - cargo run {{ if features =="" {''} else if features=="no-default-features" {"--no-default-features" } else {"--features " + features } }} -p hyperlight-wasm-aot compile {{ if features =~ "gdb" {"--debug"} else {""} }} --component ./src/tests/rust_guests/component_sample/target/wasm32-unknown-unknown/{{ target }}/component_sample.wasm ./x64/{{ target }}/component_sample.aot + cargo run -p hyperlight-wasm-aot compile {{ if features =~ "gdb" {"--debug"} else {""} }} {{ if features =~ "wasmtime_latest" {"--latest"} else {""} }} --component ./src/tests/rust_guests/component_sample/target/wasm32-unknown-unknown/{{ target }}/component_sample.wasm ./x64/{{ target }}/component_sample.aot cd ./src/tests/rust_guests/greeter_sample && cargo component build --target wasm32-unknown-unknown --profile={{ if target == "debug" {"dev"} else { target } }} - cargo run {{ if features =="" {''} else if features=="no-default-features" {"--no-default-features" } else {"--features " + features } }} -p hyperlight-wasm-aot compile {{ if features =~ "gdb" {"--debug"} else {""} }} --component ./src/tests/rust_guests/greeter_sample/target/wasm32-unknown-unknown/{{ target }}/greeter_sample.wasm ./x64/{{ target }}/greeter_sample.aot + cargo run -p hyperlight-wasm-aot compile {{ if features =~ "gdb" {"--debug"} else {""} }} {{ if features =~ "wasmtime_latest" {"--latest"} else {""} }} --component ./src/tests/rust_guests/greeter_sample/target/wasm32-unknown-unknown/{{ target }}/greeter_sample.wasm ./x64/{{ target }}/greeter_sample.aot build-pulley-rust-component-examples target=default-target features="": (compile-wit) # use cargo component so we don't get all the wasi imports https://github.com/bytecodealliance/cargo-component?tab=readme-ov-file#relationship-with-wasm32-wasip2 # we also explicitly target wasm32-unknown-unknown since cargo component might try to pull in wasi imports https://github.com/bytecodealliance/cargo-component/issues/290 rustup target add wasm32-unknown-unknown cd ./src/tests/rust_guests/component_sample && cargo component build --target wasm32-unknown-unknown --profile={{ if target == "debug" {"dev"} else { target } }} - cargo run {{ if features =="" {''} else if features=="no-default-features" {"--no-default-features" } else {"--features " + features } }} -p hyperlight-wasm-aot compile --pulley {{ if features =~ "gdb" {"--debug"} else {""} }} --component ./src/tests/rust_guests/component_sample/target/wasm32-unknown-unknown/{{ target }}/component_sample.wasm ./x64/{{ target }}/component_sample.aot + cargo run -p hyperlight-wasm-aot compile --pulley {{ if features =~ "gdb" {"--debug"} else {""} }} {{ if features =~ "wasmtime_latest" {"--latest"} else {""} }} --component ./src/tests/rust_guests/component_sample/target/wasm32-unknown-unknown/{{ target }}/component_sample.wasm ./x64/{{ target }}/component_sample.aot check target=default-target: cargo check --profile={{ if target == "debug" {"dev"} else { target } }} @@ -95,7 +95,9 @@ clippy target=default-target: (check target) cd src/tests/rust_guests/rust_wasm_samples && cargo clippy --profile={{ if target == "debug" {"dev"} else { target } }} --all-targets --all-features -- -D warnings cd src/tests/rust_guests/component_sample && cargo clippy --profile={{ if target == "debug" {"dev"} else { target } }} --all-targets --all-features -- -D warnings cd src/tests/rust_guests/greeter_sample && cargo clippy --profile={{ if target == "debug" {"dev"} else { target } }} --all-targets --all-features -- -D warnings - cd src/hyperlight_wasm_runtime && cargo hyperlight clippy --profile={{ if target == "debug" {"dev"} else { target } }} --all-targets --all-features -- -D warnings + # hyperlight_wasm_runtime has mutually exclusive wasmtime features, so we run clippy for each separately with all other features + cd src/hyperlight_wasm_runtime && cargo hyperlight clippy --profile={{ if target == "debug" {"dev"} else { target } }} --all-targets --features wasmtime_latest,gdb,trace_guest,pulley -- -D warnings + cd src/hyperlight_wasm_runtime && cargo hyperlight clippy --profile={{ if target == "debug" {"dev"} else { target } }} --all-targets --no-default-features --features wasmtime_lts,gdb,trace_guest -- -D warnings cd src/hyperlight_wasm_macro && cargo clippy --profile={{ if target == "debug" {"dev"} else { target } }} --all-targets --all-features -- -D warnings # TESTING @@ -103,11 +105,12 @@ clippy target=default-target: (check target) # There may be tests that we really want to ignore so we cant just use --ignored and run then we have to # specify the test name of the ignored tests that we want to run # Additionally, we have to run the tests with the function_call_metrics feature enabled separately +# We exclude hyperlight-wasm-aot because it has both wasmtime versions as dependencies and no tests so we don't need to build both versions for testing test target=default-target features="": - cargo test {{ if features =="" {''} else if features=="no-default-features" {"--no-default-features" } else {"--no-default-features -F " + features } }} --profile={{ if target == "debug" {"dev"} else { target } }} - cargo test test_metrics {{ if features =="" {''} else if features=="no-default-features" {"--no-default-features" } else {"--no-default-features -F " + features } }} --profile={{ if target == "debug" {"dev"} else { target } }} -- --ignored + cargo test --workspace --exclude hyperlight-wasm-aot {{ if features =="" {''} else if features=="no-default-features" {"--no-default-features" } else {"--no-default-features -F " + features } }} --profile={{ if target == "debug" {"dev"} else { target } }} + cargo test --workspace --exclude hyperlight-wasm-aot test_metrics {{ if features =="" {''} else if features=="no-default-features" {"--no-default-features" } else {"--no-default-features -F " + features } }} --profile={{ if target == "debug" {"dev"} else { target } }} -- --ignored -examples-modules target=default-target features="": (build-rust-wasm-examples target) +examples-modules target=default-target features="": (build-wasm-examples target features) (build-rust-wasm-examples target features) cargo run {{ if features =="" {''} else {"--no-default-features -F " + features } }} --profile={{ if target == "debug" {"dev"} else { target } }} --example helloworld cargo run {{ if features =="" {''} else {"--no-default-features -F " + features } }} --profile={{ if target == "debug" {"dev"} else { target } }} --example hostfuncs cargo run {{ if features =="" {''} else {"--no-default-features -F " + features } }} --profile={{ if target == "debug" {"dev"} else { target } }} --example rust_wasm_examples @@ -117,13 +120,13 @@ examples-modules target=default-target features="": (build-rust-wasm-examples ta examples-ci target=default-target features="": (examples-modules target features) (examples-components target features) (examples-pulley target features) -examples-components target=default-target features="": (build-rust-component-examples target) +examples-components target=default-target features="": (build-rust-component-examples target features) {{ wit-world }} cargo run {{ if features =="" {''} else {"--no-default-features -F kvm -F " + features } }} --profile={{ if target == "debug" {"dev"} else { target } }} --example component_example {{ wit-world-c }} cargo run {{ if features =="" {''} else {"--no-default-features -F kvm -F " + features } }} --profile={{ if target == "debug" {"dev"} else { target } }} --example c-component {{ wit-world }} {{ wit-world-name-greeter }} cargo run {{ if features =="" {''} else {"--no-default-features -F kvm -F " + features } }} --profile={{ if target == "debug" {"dev"} else { target } }} --example component_greeter_example # Test a component and a module compiled with pulley -examples-pulley target=default-target features="": (build-pulley-rust-component-examples target) (build-pulley-rust-wasm-examples target) +examples-pulley target=default-target features="": (build-pulley-rust-component-examples target features) (build-pulley-rust-wasm-examples target features) {{ wit-world }} cargo run {{ if features =="" {'-F pulley'} else {"--no-default-features -F kvm,pulley -F " + features } }} --profile={{ if target == "debug" {"dev"} else { target } }} --example component_example cargo run {{ if features =="" {'-F pulley'} else {"--no-default-features -F pulley -F " + features } }} --profile={{ if target == "debug" {"dev"} else { target } }} --example rust_wasm_examples diff --git a/README.md b/README.md index debd3779..037f81ab 100644 --- a/README.md +++ b/README.md @@ -58,11 +58,11 @@ You should also add your user to the kvm group: `sudo adduser $USER kvm` ## Building -NOTE: Ensure that you use version 1.89 of rust toolchain. +NOTE: Ensure that you use version 1.93 of rust toolchain. ```Console -rustup install 1.89 -rustup default 1.89 +rustup install 1.93 +rustup default 1.93 ``` Now you can build the Rust Wasm library: diff --git a/rust-toolchain.toml b/rust-toolchain.toml index c683fec6..47080603 100644 --- a/rust-toolchain.toml +++ b/rust-toolchain.toml @@ -1,5 +1,5 @@ [toolchain] -channel = "1.89" +channel = "1.93" # Target used for guest binaries. This is an additive list of targets in addition to host platform. # Will install the target if not already installed when building guest binaries. targets = ["x86_64-unknown-none"] \ No newline at end of file diff --git a/src/hyperlight_wasm/Cargo.toml b/src/hyperlight_wasm/Cargo.toml index 49ce5f13..1372390b 100644 --- a/src/hyperlight_wasm/Cargo.toml +++ b/src/hyperlight_wasm/Cargo.toml @@ -119,6 +119,10 @@ kvm = ["hyperlight-host/kvm"] mshv3 = ["hyperlight-host/mshv3"] pulley = [] trace_guest = ["hyperlight-host/trace_guest"] +# Use latest wasmtime instead of the default LTS version in wasm_runtime +wasmtime_latest = [] +# Explicitly use the default LTS wasmtime version in wasm_runtime +wasmtime_lts = [] [[bench]] name = "benchmarks" @@ -127,4 +131,3 @@ harness = false [[bench]] name = "benchmarks_components" harness = false - diff --git a/src/hyperlight_wasm/build.rs b/src/hyperlight_wasm/build.rs index cdf01cec..9a570d9c 100644 --- a/src/hyperlight_wasm/build.rs +++ b/src/hyperlight_wasm/build.rs @@ -143,6 +143,25 @@ fn build_wasm_runtime() -> PathBuf { .arg("--locked") .env_clear_cargo(); + let wasmtime_latest = std::env::var("CARGO_FEATURE_WASMTIME_LATEST").is_ok(); + let wasmtime_lts = std::env::var("CARGO_FEATURE_WASMTIME_LTS").is_ok(); + assert!( + !(wasmtime_latest && wasmtime_lts), + "features 'wasmtime_latest' and 'wasmtime_lts' are mutually exclusive" + ); + + if wasmtime_latest { + cmd = cmd + .arg("--no-default-features") + .arg("--features") + .arg("wasmtime_latest"); + } else if wasmtime_lts { + cmd = cmd + .arg("--no-default-features") + .arg("--features") + .arg("wasmtime_lts"); + } + // Add --features gdb if the gdb feature is enabled for this build script if std::env::var("CARGO_FEATURE_GDB").is_ok() { cmd = cmd.arg("--features").arg("gdb"); diff --git a/src/hyperlight_wasm/examples/guest-debugging/main.rs b/src/hyperlight_wasm/examples/guest-debugging/main.rs index c27a88d9..1affaebc 100644 --- a/src/hyperlight_wasm/examples/guest-debugging/main.rs +++ b/src/hyperlight_wasm/examples/guest-debugging/main.rs @@ -24,7 +24,7 @@ limitations under the License. //! # for C modules //! just build-wasm-examples debug gdb //! # for Rust modules -//! just build-rust-wasm-samples debug gdb +//! just build-rust-wasm-examples debug gdb //! ``` //! //! # Running the Example diff --git a/src/hyperlight_wasm/scripts/build-wasm-examples.sh b/src/hyperlight_wasm/scripts/build-wasm-examples.sh index 433a041c..6b9549ed 100755 --- a/src/hyperlight_wasm/scripts/build-wasm-examples.sh +++ b/src/hyperlight_wasm/scripts/build-wasm-examples.sh @@ -13,12 +13,10 @@ OUTPUT_DIR=$(realpath $OUTPUT_DIR) # Set stripping flags based on whether features are enabled if [ -n "$FEATURES" ]; then - AOT_FEATURES="--features $FEATURES" STRIP_FLAGS="" DEBUG_FLAGS="-g" OPT_FLAGS="-O0" else - AOT_FEATURES="" STRIP_FLAGS="-Wl,--strip-all" DEBUG_FLAGS="" OPT_FLAGS="-O3" @@ -31,6 +29,13 @@ else AOT_DEBUG_FLAGS="" fi +# Set AOT latest flag if wasmtime_latest feature is enabled +if [[ "$FEATURES" == *"wasmtime_latest"* ]]; then + AOT_VERSION_FLAGS="--latest" +else + AOT_VERSION_FLAGS="" +fi + if [ -f "/.dockerenv" ] || grep -q docker /proc/1/cgroup; then # running in a container so use the installed wasi-sdk as the devcontainer has this installed for FILENAME in $(find . -name '*.c' -not -path './components/*') @@ -39,7 +44,7 @@ if [ -f "/.dockerenv" ] || grep -q docker /proc/1/cgroup; then # Build the wasm file with wasi-libc for wasmtime /opt/wasi-sdk/bin/clang ${DEBUG_FLAGS} -flto -ffunction-sections -mexec-model=reactor ${OPT_FLAGS} -z stack-size=4096 -Wl,--initial-memory=65536 -Wl,--export=__data_end -Wl,--export=__heap_base,--export=malloc,--export=free,--export=__wasm_call_ctors ${STRIP_FLAGS} -Wl,--no-entry -Wl,--allow-undefined -Wl,--gc-sections -o ${OUTPUT_DIR}/${FILENAME%.*}-wasi-libc.wasm ${FILENAME} - cargo run ${AOT_FEATURES} -p hyperlight-wasm-aot compile ${AOT_DEBUG_FLAGS} ${OUTPUT_DIR}/${FILENAME%.*}-wasi-libc.wasm ${OUTPUT_DIR}/${FILENAME%.*}.aot + cargo run -p hyperlight-wasm-aot compile ${AOT_DEBUG_FLAGS} ${AOT_VERSION_FLAGS} ${OUTPUT_DIR}/${FILENAME%.*}-wasi-libc.wasm ${OUTPUT_DIR}/${FILENAME%.*}.aot done for WIT_FILE in ${PWD}/components/*.wit; do @@ -60,7 +65,7 @@ if [ -f "/.dockerenv" ] || grep -q docker /proc/1/cgroup; then ${PWD}/components/bindings/${COMPONENT_NAME}_component_type.o # Build AOT for Wasmtime - cargo run ${AOT_FEATURES} -p hyperlight-wasm-aot compile ${AOT_DEBUG_FLAGS} --component ${OUTPUT_DIR}/${COMPONENT_NAME}-p2.wasm ${OUTPUT_DIR}/${COMPONENT_NAME}.aot + cargo run -p hyperlight-wasm-aot compile ${AOT_DEBUG_FLAGS} ${AOT_VERSION_FLAGS} --component ${OUTPUT_DIR}/${COMPONENT_NAME}-p2.wasm ${OUTPUT_DIR}/${COMPONENT_NAME}.aot done else @@ -89,7 +94,7 @@ else -v "${OUTPUT_DIR_REAL}:${OUTPUT_DIR_REAL}" \ wasm-clang-builder:latest /bin/bash -c "/opt/wasi-sdk/bin/clang ${DEBUG_FLAGS} -flto -ffunction-sections -mexec-model=reactor ${OPT_FLAGS} -z stack-size=4096 -Wl,--initial-memory=65536 -Wl,--export=__data_end -Wl,--export=__heap_base,--export=malloc,--export=free,--export=__wasm_call_ctors ${STRIP_FLAGS} -Wl,--no-entry -Wl,--allow-undefined -Wl,--gc-sections -o ${ABS_OUTPUT} ${ABS_INPUT}" - cargo run ${AOT_FEATURES} -p hyperlight-wasm-aot compile ${AOT_DEBUG_FLAGS} ${OUTPUT_WASM} ${OUTPUT_DIR}/${FILENAME%.*}.aot + cargo run -p hyperlight-wasm-aot compile ${AOT_DEBUG_FLAGS} ${AOT_VERSION_FLAGS} ${OUTPUT_WASM} ${OUTPUT_DIR}/${FILENAME%.*}.aot done echo Building components @@ -129,7 +134,7 @@ else ${ABS_BINDINGS_TYPE_O}" # Build AOT for Wasmtime - cargo run ${AOT_FEATURES} -p hyperlight-wasm-aot compile ${AOT_DEBUG_FLAGS} --component ${OUTPUT_WASM} ${OUTPUT_DIR}/${COMPONENT_NAME}.aot + cargo run -p hyperlight-wasm-aot compile ${AOT_DEBUG_FLAGS} ${AOT_VERSION_FLAGS} --component ${OUTPUT_WASM} ${OUTPUT_DIR}/${COMPONENT_NAME}.aot done fi diff --git a/src/hyperlight_wasm/src/lib.rs b/src/hyperlight_wasm/src/lib.rs index d35875fb..c453d0af 100644 --- a/src/hyperlight_wasm/src/lib.rs +++ b/src/hyperlight_wasm/src/lib.rs @@ -125,11 +125,17 @@ mod tests { std::fs::read_to_string(cargo_toml_path).expect("Failed to read Cargo.toml"); let cargo_toml: toml::Value = toml::from_str(&cargo_toml_content).expect("Failed to parse Cargo.toml"); + // LTS is the default; wasmtime_latest opts into the latest dependency. + let dep_key = if cfg!(feature = "wasmtime_latest") { + "wasmtime" + } else { + "wasmtime_lts" + }; let wasmtime_version_from_toml = cargo_toml .get("target") .and_then(|deps| deps.get("cfg(hyperlight)")) .and_then(|cfg| cfg.get("dependencies")) - .and_then(|deps| deps.get("wasmtime")) + .and_then(|deps| deps.get(dep_key)) .and_then(|wasmtime| wasmtime.get("version")) .and_then(|version| version.as_str()) .expect("Failed to find wasmtime version in Cargo.toml"); diff --git a/src/hyperlight_wasm_aot/Cargo.toml b/src/hyperlight_wasm_aot/Cargo.toml index c3bb8c61..f3062e69 100644 --- a/src/hyperlight_wasm_aot/Cargo.toml +++ b/src/hyperlight_wasm_aot/Cargo.toml @@ -12,11 +12,15 @@ Application to precompile WebAssembly binaries to for hyperlight-wasm. """ [dependencies] -wasmtime = { version = "36.0.9", default-features = false, features = ["cranelift", "pulley", "runtime", "component-model" ] } +# Since we can use the library with either the latest bundled wasmtime or the LTS version +# we need to bundle both here as dependencies. +# The default is the LTS version. To use the latest version pass the --latest flag. +wasmtime = { version = "45.0.1", default-features = false, features = ["cranelift", "pulley", "runtime", "component-model"] } +wasmtime_lts = { package = "wasmtime", version = "36.0.10", default-features = false, features = ["cranelift", "pulley", "runtime", "component-model"] } clap = { version = "4.6", features = ["derive"] } cargo_metadata = "0.23" cargo-util-schemas = "=0.10.1" object = { version = "0.39.1", default-features = false, features = ["read_core", "elf"] } [features] -gdb = ["wasmtime/debug-builtins"] +gdb = ["wasmtime/debug-builtins", "wasmtime_lts/debug-builtins"] diff --git a/src/hyperlight_wasm_aot/src/main.rs b/src/hyperlight_wasm_aot/src/main.rs index 0bb16a0f..520d366d 100644 --- a/src/hyperlight_wasm_aot/src/main.rs +++ b/src/hyperlight_wasm_aot/src/main.rs @@ -73,6 +73,10 @@ enum Commands { /// Pre-compile for the pulley64 target #[arg(long)] pulley: bool, + + /// Use latest wasmtime version instead of the default LTS version + #[arg(long)] + latest: bool, }, /// Check which Wasmtime version was used to precompile a module @@ -83,9 +87,75 @@ enum Commands { /// Specifies if the module has been compiled with debug support #[arg(long)] debug: bool, + + /// Use latest wasmtime version instead of the default LTS version + #[arg(long)] + latest: bool, }, } +/// Precompile bytes using the LTS wasmtime version +fn precompile_bytes_lts( + bytes: &[u8], + debug: bool, + minimal: bool, + pulley: bool, + is_component: bool, +) -> Vec { + let mut config = wasmtime_lts::Config::new(); + if pulley { + config.target("pulley64").unwrap(); + } else { + config.target("x86_64-unknown-none").unwrap(); + } + if debug { + config.debug_info(true); + config.cranelift_opt_level(wasmtime_lts::OptLevel::None); + } + if minimal { + config.generate_address_map(false); + config.native_unwind_info(false); + } + let engine = wasmtime_lts::Engine::new(&config).unwrap(); + if is_component { + engine.precompile_component(bytes).unwrap() + } else { + engine.precompile_module(bytes).unwrap() + } +} + +/// Detect and deserialize using the LTS wasmtime version +fn detect_and_deserialize_lts(bytes: &[u8], debug: bool, file: &str) { + let mut config = wasmtime_lts::Config::new(); + config.target("x86_64-unknown-none").unwrap(); + if debug { + config.debug_info(true); + config.cranelift_opt_level(wasmtime_lts::OptLevel::None); + } + let engine = wasmtime_lts::Engine::new(&config).unwrap(); + match wasmtime_lts::Engine::detect_precompiled(bytes) { + Some(wasmtime_lts::Precompiled::Module) => { + println!("The file is a valid AOT compiled Wasmtime module"); + match unsafe { wasmtime_lts::Module::deserialize(&engine, bytes) } { + Ok(_) => println!( + "File {} was AOT compiled with a compatible wasmtime version (LTS)", + file + ), + Err(e) => eprintln!("{}", e), + } + } + Some(wasmtime_lts::Precompiled::Component) => { + println!("The file is an AOT compiled Wasmtime component") + } + None => { + eprintln!( + "Error - {} is not a valid AOT compiled Wasmtime module or component", + file + ); + } + } +} + fn main() { let cli = Cli::parse(); @@ -97,6 +167,7 @@ fn main() { debug, minimal, pulley, + latest, } => { let outfile = match output { Some(s) => s, @@ -106,100 +177,151 @@ fn main() { path.to_str().unwrap().to_string() } }; - let target = if pulley { - SupportedTarget::WasmtimePulley64 - } else { - SupportedTarget::X86_64UnknownNone - }; - if debug { - println!( - "Aot Compiling {} to [{}]: {} with debug info and optimizations off", - input, target, outfile - ); + + if latest { + let target = if pulley { + SupportedTarget::WasmtimePulley64 + } else { + SupportedTarget::X86_64UnknownNone + }; + if debug { + println!( + "Aot Compiling {} to [{}]: {} with debug info and optimizations off (latest wasmtime)", + input, target, outfile + ); + } else { + println!( + "Aot Compiling {} to [{}]: {} (latest wasmtime)", + input, target, outfile + ); + } + let config = get_config(debug, minimal, &target); + let engine = Engine::new(&config).unwrap(); + let bytes = std::fs::read(&input).unwrap(); + let serialized = if component { + engine.precompile_component(&bytes).unwrap() + } else { + engine.precompile_module(&bytes).unwrap() + }; + std::fs::write(outfile, serialized).unwrap(); } else { - println!("Aot Compiling {} to [{}]: {}", input, target, outfile); + let target_name = if pulley { + "pulley64" + } else { + "x86_64-unknown-none" + }; + if debug { + println!( + "Aot Compiling {} to [{}]: {} with debug info and optimizations off (LTS wasmtime)", + input, target_name, outfile + ); + } else { + println!( + "Aot Compiling {} to [{}]: {} (LTS wasmtime)", + input, target_name, outfile + ); + } + let bytes = std::fs::read(&input).unwrap(); + let serialized = precompile_bytes_lts(&bytes, debug, minimal, pulley, component); + std::fs::write(outfile, serialized).unwrap(); } - let config = get_config(debug, minimal, &target); - let engine = Engine::new(&config).unwrap(); - let bytes = std::fs::read(&input).unwrap(); - let serialized = if component { - engine.precompile_component(&bytes).unwrap() - } else { - engine.precompile_module(&bytes).unwrap() - }; - std::fs::write(outfile, serialized).unwrap(); } - Commands::CheckWasmtimeVersion { file, debug } => { - // get the wasmtime version used by hyperlight-wasm-aot - let metadata = MetadataCommand::new().exec().unwrap(); - let package_name = PackageName::new("wasmtime".to_string()).unwrap(); - let wasmtime_package: Option<&Package> = - metadata.packages.iter().find(|p| p.name == package_name); - let version_number = match wasmtime_package { - Some(pkg) => pkg.version.clone(), - None => panic!("wasmtime dependency not found"), - }; - if debug { - println!( - "Checking Wasmtime version used to compile debug info enabled file: {}", - file - ); - } else { - println!("Checking Wasmtime version used to compile file: {}", file); - } - // load the file into wasmtime, check that it is aot compiled and extract the version of wasmtime used to compile it from its metadata - let bytes = std::fs::read(&file).unwrap(); - let target = match get_aot_target(&bytes) { - Ok(target) => target, - Err(e) => { - eprintln!( - "Error - {} is not a valid precompiled Wasmtime module: {}", - file, e + Commands::CheckWasmtimeVersion { + file, + debug, + latest, + } => { + if latest { + // get the wasmtime version used by hyperlight-wasm-aot + let metadata = MetadataCommand::new().exec().unwrap(); + let package_name = PackageName::new("wasmtime".to_string()).unwrap(); + let wasmtime_package: Option<&Package> = metadata + .packages + .iter() + .filter(|p| p.name == package_name) + .find(|p| p.version.major > 36); + let version_number = match wasmtime_package { + Some(pkg) => pkg.version.clone(), + None => panic!("latest wasmtime dependency not found"), + }; + if debug { + println!( + "Checking Wasmtime version used to compile debug info enabled file: {} (latest wasmtime)", + file + ); + } else { + println!( + "Checking Wasmtime version used to compile file: {} (latest wasmtime)", + file ); - std::process::exit(1) } - }; - let config = get_config(debug, false, &target); - let engine = Engine::new(&config).unwrap(); - match Engine::detect_precompiled(&bytes) { - Some(pre_compiled) => { - match pre_compiled { - Precompiled::Module => { - println!("The file is a valid AOT compiled Wasmtime module"); - // It doesnt seem like the functions or data needed to extract the version of wasmtime used to compile the module are exposed in the wasmtime crate - // so we will try and load it and then catch the error and parse the version from the error message :-( - match unsafe { Module::deserialize(&engine, bytes) } { - Ok(_) => println!( - "File {} was AOT compiled to '{}' with wasmtime version: {}", - file, target, version_number - ), - Err(e) => { - let error_message = e.to_string(); - if !error_message.starts_with( - "Module was compiled with incompatible Wasmtime version", - ) { - eprintln!("{}", error_message); - return; - } - let version = error_message.trim_start_matches("Module was compiled with incompatible Wasmtime version ").trim(); - println!( + let bytes = std::fs::read(&file).unwrap(); + let target = match get_aot_target(&bytes) { + Ok(target) => target, + Err(e) => { + eprintln!( + "Error - {} is not a valid precompiled Wasmtime module: {}", + file, e + ); + std::process::exit(1) + } + }; + let config = get_config(debug, false, &target); + let engine = Engine::new(&config).unwrap(); + match Engine::detect_precompiled(&bytes) { + Some(pre_compiled) => { + match pre_compiled { + Precompiled::Module => { + println!("The file is a valid AOT compiled Wasmtime module"); + // It doesnt seem like the functions or data needed to extract the version of wasmtime used to compile the module are exposed in the wasmtime crate + // so we will try and load it and then catch the error and parse the version from the error message :-( + match unsafe { Module::deserialize(&engine, bytes) } { + Ok(_) => println!( "File {} was AOT compiled to '{}' with wasmtime version: {}", - file, target, version - ); - } - }; - } - Precompiled::Component => { - eprintln!("The file is an AOT compiled Wasmtime component") + file, target, version_number + ), + Err(e) => { + let error_message = e.to_string(); + if !error_message.starts_with( + "Module was compiled with incompatible Wasmtime version", + ) { + eprintln!("{}", error_message); + return; + } + let version = error_message.trim_start_matches("Module was compiled with incompatible Wasmtime version ").trim(); + println!( + "File {} was AOT compiled to '{}' with wasmtime version: {}", + file, target, version + ); + } + }; + } + Precompiled::Component => { + eprintln!("The file is an AOT compiled Wasmtime component") + } } } + None => { + eprintln!( + "Error - {} is not a valid AOT compiled Wasmtime module or component", + file + ); + } } - None => { - eprintln!( - "Error - {} is not a valid AOT compiled Wasmtime module or component", + } else { + if debug { + println!( + "Checking Wasmtime version used to compile with debug info enabled file: {} (LTS wasmtime)", + file + ); + } else { + println!( + "Checking Wasmtime version used to compile file: {} (LTS wasmtime)", file ); } + let bytes = std::fs::read(&file).unwrap(); + detect_and_deserialize_lts(&bytes, debug, &file); } } } @@ -213,6 +335,13 @@ fn get_config(debug: bool, minimal: bool, target: &SupportedTarget) -> Config { match target { SupportedTarget::X86_64UnknownNone => { config.target("x86_64-unknown-none").unwrap(); + // Enable x86_float_abi_ok only for the latest Wasmtime version. + // Safety: + // We are using hyperlight cargo to build the guest which + // sets the Rust target to be compiled with the hard-float ABI manually via + // `-Zbuild-std` and a custom target JSON configuration + // See https://github.com/bytecodealliance/wasmtime/pull/11553 + unsafe { config.x86_float_abi_ok(true) }; } SupportedTarget::WasmtimePulley64 => { config.target("pulley64").unwrap(); diff --git a/src/hyperlight_wasm_runtime/Cargo.toml b/src/hyperlight_wasm_runtime/Cargo.toml index b23a0af9..a32ea424 100644 --- a/src/hyperlight_wasm_runtime/Cargo.toml +++ b/src/hyperlight_wasm_runtime/Cargo.toml @@ -28,7 +28,10 @@ hyperlight-common = { workspace = true, default-features = false } hyperlight-guest-bin = { workspace = true, features = [ "printf" ] } hyperlight-guest.workspace = true hyperlight-wasm-macro.workspace = true -wasmtime = { version = "36.0.9", default-features = false, features = [ "runtime", "custom-virtual-memory", "custom-native-signals", "component-model" ] } +# Default to the LTS wasmtime version; use wasmtime_latest to opt into latest. +# These are marked optional to avoid pulling them both in. They should be mutually exclusive. +wasmtime = { version = "45.0.1", default-features = false, features = [ "runtime", "custom-virtual-memory", "custom-native-signals", "component-model" ], optional = true } +wasmtime_lts = { package = "wasmtime", version = "36.0.10", default-features = false, features = [ "runtime", "custom-virtual-memory", "custom-native-signals", "component-model" ], optional = true } spin = "0.10.0" tracing = { version = "0.1.44", default-features = false, features = ["attributes", "log"] } @@ -39,9 +42,11 @@ cfg-if = { version = "1" } cargo_metadata = "0.23" [features] -default = [] -gdb = ["wasmtime/debug-builtins"] -pulley = ["wasmtime/pulley"] +default = ["wasmtime_lts"] +wasmtime_latest = ["dep:wasmtime"] +wasmtime_lts = ["dep:wasmtime_lts"] +gdb = ["wasmtime?/debug-builtins", "wasmtime_lts?/debug-builtins"] +pulley = ["wasmtime?/pulley", "wasmtime_lts?/pulley"] trace_guest = ["hyperlight-common/trace_guest", "hyperlight-guest/trace_guest", "hyperlight-guest-bin/trace_guest"] [lints.rust] diff --git a/src/hyperlight_wasm_runtime/build.rs b/src/hyperlight_wasm_runtime/build.rs index 1052686b..1b6ed351 100644 --- a/src/hyperlight_wasm_runtime/build.rs +++ b/src/hyperlight_wasm_runtime/build.rs @@ -29,13 +29,27 @@ fn main() { let mut cfg = cc::Build::new(); // get the version of the wasmtime crate - + // The LTS wasmtime version is the default; wasmtime_latest opts into the latest version. let metadata = MetadataCommand::new().exec().unwrap(); - let wasmtime_package: Option<&Package> = - metadata.packages.iter().find(|p| *p.name == "wasmtime"); - let version_number = match wasmtime_package { - Some(pkg) => pkg.version.clone(), - None => panic!("wasmtime dependency not found"), + let wasmtime_packages: Vec<&Package> = metadata + .packages + .iter() + .filter(|p| *p.name == "wasmtime") + .collect(); + + let use_lts = env::var("CARGO_FEATURE_WASMTIME_LATEST").is_err(); + let version_number = if wasmtime_packages.len() == 1 { + wasmtime_packages[0].version.clone() + } else { + // Multiple wasmtime versions present; pick based on feature + wasmtime_packages + .iter() + .find(|p| { + (use_lts && p.version.major <= 36) || (!use_lts && p.version.major > 36) + }) + .unwrap_or_else(|| panic!("wasmtime dependency not found for lts={}", use_lts)) + .version + .clone() }; // Write the version number to the metadata.rs file so that it is included in the binary diff --git a/src/hyperlight_wasm_runtime/src/component.rs b/src/hyperlight_wasm_runtime/src/component.rs index 05afe97c..a2a37001 100644 --- a/src/hyperlight_wasm_runtime/src/component.rs +++ b/src/hyperlight_wasm_runtime/src/component.rs @@ -108,6 +108,16 @@ pub extern "C" fn hyperlight_main() { platform::register_page_fault_handler(); let mut config = Config::new(); + // Enable x86_float_abi_ok only for the latest Wasmtime version. + // Safety: + // We are using hyperlight cargo to build the guest which + // sets the Rust target to be compiled with the hard-float ABI manually via + // `-Zbuild-std` and a custom target JSON configuration + // See https://github.com/bytecodealliance/wasmtime/pull/11553 + #[cfg(not(feature = "wasmtime_lts"))] + unsafe { + config.x86_float_abi_ok(true) + }; config.with_custom_code_memory(Some(alloc::sync::Arc::new(platform::WasmtimeCodeMemory {}))); #[cfg(gdb)] config.debug_info(true); diff --git a/src/hyperlight_wasm_runtime/src/lib.rs b/src/hyperlight_wasm_runtime/src/lib.rs index 4db99a48..dbe9c804 100644 --- a/src/hyperlight_wasm_runtime/src/lib.rs +++ b/src/hyperlight_wasm_runtime/src/lib.rs @@ -19,6 +19,20 @@ limitations under the License. extern crate alloc; +// Re-export wasmtime based on expected version +#[cfg(all(feature = "wasmtime_latest", feature = "wasmtime_lts"))] +compile_error!( + "Features 'wasmtime_latest' and 'wasmtime_lts' are mutually exclusive. Please enable only one." +); + +#[cfg(not(any(feature = "wasmtime_latest", feature = "wasmtime_lts")))] +compile_error!("Either 'wasmtime_latest' or 'wasmtime_lts' feature must be enabled."); + +#[cfg(not(feature = "wasmtime_lts"))] +extern crate wasmtime; +#[cfg(feature = "wasmtime_lts")] +extern crate wasmtime_lts as wasmtime; + mod platform; #[cfg(not(component))] diff --git a/src/hyperlight_wasm_runtime/src/module.rs b/src/hyperlight_wasm_runtime/src/module.rs index 64a00665..14f7eb6f 100644 --- a/src/hyperlight_wasm_runtime/src/module.rs +++ b/src/hyperlight_wasm_runtime/src/module.rs @@ -98,6 +98,17 @@ pub fn guest_dispatch_function(function_call: FunctionCall) -> Result> { #[instrument(skip_all, level = "Info")] fn init_wasm_runtime(function_call: FunctionCall) -> Result> { let mut config = Config::new(); + // Enable x86_float_abi_ok only for the latest Wasmtime version. + // Safety: + // We are using hyperlight cargo to build the guest which + // sets the Rust target to be compiled with the hard-float ABI manually via + // `-Zbuild-std` and a custom target JSON configuration + // See https://github.com/bytecodealliance/wasmtime/pull/11553 + #[cfg(not(feature = "wasmtime_lts"))] + unsafe { + config.x86_float_abi_ok(true) + }; + config.with_custom_code_memory(Some(alloc::sync::Arc::new(platform::WasmtimeCodeMemory {}))); #[cfg(gdb)] config.debug_info(true); From 975ae5ebc89d5f4204dda9ec2da303af51fe2471 Mon Sep 17 00:00:00 2001 From: James Sturtevant Date: Wed, 10 Jun 2026 15:16:13 -0700 Subject: [PATCH 2/2] Fix Wasmtime latest runtime compatibility Map Wasmtime 45 direct errors into Hyperlight guest errors and avoid latest-only component post_return deprecation while preserving LTS behavior. Run clippy with the latest and LTS Wasmtime feature sets separately so mutually exclusive features are not enabled together. Signed-off-by: James Sturtevant Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- Justfile | 7 +- src/hyperlight_wasm_macro/src/wasmguest.rs | 23 ++- src/hyperlight_wasm_runtime/build.rs | 4 +- src/hyperlight_wasm_runtime/src/component.rs | 14 +- src/hyperlight_wasm_runtime/src/lib.rs | 9 + src/hyperlight_wasm_runtime/src/marshal.rs | 13 +- src/hyperlight_wasm_runtime/src/module.rs | 43 ++-- src/hyperlight_wasm_runtime/src/platform.rs | 10 +- src/hyperlight_wasm_runtime/src/wasip1.rs | 196 ++++++++++--------- 9 files changed, 190 insertions(+), 129 deletions(-) diff --git a/Justfile b/Justfile index 8e68245a..1d88cc73 100644 --- a/Justfile +++ b/Justfile @@ -6,6 +6,8 @@ latest-release:= if os() == "windows" {"$(git tag -l --sort=v:refname | select - wit-world := if os() == "windows" { "$env:WIT_WORLD=\"" + justfile_directory() + "\\src\\tests\\rust_guests\\component_sample\\wit\\component-world.wasm" + "\";" } else { "WIT_WORLD=" + justfile_directory() + "/src/tests/rust_guests/component_sample/wit/component-world.wasm" } wit-world-c := if os() == "windows" { "$env:WIT_WORLD=\"" + justfile_directory() + "\\src\\tests\\c_guests\\wasmsamples\\components\\runcomponent-world.wasm" + "\";" } else { "WIT_WORLD=" + justfile_directory() + "/src/tests/c_guests/wasmsamples/components/runcomponent-world.wasm" } wit-world-name-greeter := if os() == "windows" { "$env:WIT_WORLD_NAME=\"greeter-world\";" } else { "WIT_WORLD_NAME=greeter-world" } +workspace-features-latest := "hyperlight-wasm/function_call_metrics,hyperlight-wasm/print_debug,hyperlight-wasm/crashdump,hyperlight-wasm/gdb,hyperlight-wasm/kvm,hyperlight-wasm/mshv3,hyperlight-wasm/pulley,hyperlight-wasm/trace_guest,hyperlight-wasm/wasmtime_latest,hyperlight-wasm-aot/gdb" +workspace-features-lts := "hyperlight-wasm/function_call_metrics,hyperlight-wasm/print_debug,hyperlight-wasm/crashdump,hyperlight-wasm/gdb,hyperlight-wasm/kvm,hyperlight-wasm/mshv3,hyperlight-wasm/trace_guest,hyperlight-wasm/wasmtime_lts,hyperlight-wasm-aot/gdb" set windows-shell := ["pwsh.exe", "-NoLogo", "-Command"] @@ -91,12 +93,13 @@ fmt: cd src/hyperlight_wasm_macro && cargo +nightly fmt -v --all clippy target=default-target: (check target) - cargo clippy --profile={{ if target == "debug" {"dev"} else { target } }} --all-targets --all-features -- -D warnings + cargo clippy --workspace --exclude hyperlight-wasm-runtime --exclude hyperlight-wasm-macro --profile={{ if target == "debug" {"dev"} else { target } }} --all-targets --no-default-features --features {{ workspace-features-latest }} -- -D warnings + cargo clippy --workspace --exclude hyperlight-wasm-runtime --exclude hyperlight-wasm-macro --profile={{ if target == "debug" {"dev"} else { target } }} --all-targets --no-default-features --features {{ workspace-features-lts }} -- -D warnings cd src/tests/rust_guests/rust_wasm_samples && cargo clippy --profile={{ if target == "debug" {"dev"} else { target } }} --all-targets --all-features -- -D warnings cd src/tests/rust_guests/component_sample && cargo clippy --profile={{ if target == "debug" {"dev"} else { target } }} --all-targets --all-features -- -D warnings cd src/tests/rust_guests/greeter_sample && cargo clippy --profile={{ if target == "debug" {"dev"} else { target } }} --all-targets --all-features -- -D warnings # hyperlight_wasm_runtime has mutually exclusive wasmtime features, so we run clippy for each separately with all other features - cd src/hyperlight_wasm_runtime && cargo hyperlight clippy --profile={{ if target == "debug" {"dev"} else { target } }} --all-targets --features wasmtime_latest,gdb,trace_guest,pulley -- -D warnings + cd src/hyperlight_wasm_runtime && cargo hyperlight clippy --profile={{ if target == "debug" {"dev"} else { target } }} --all-targets --no-default-features --features wasmtime_latest,gdb,trace_guest,pulley -- -D warnings cd src/hyperlight_wasm_runtime && cargo hyperlight clippy --profile={{ if target == "debug" {"dev"} else { target } }} --all-targets --no-default-features --features wasmtime_lts,gdb,trace_guest -- -D warnings cd src/hyperlight_wasm_macro && cargo clippy --profile={{ if target == "debug" {"dev"} else { target } }} --all-targets --all-features -- -D warnings diff --git a/src/hyperlight_wasm_macro/src/wasmguest.rs b/src/hyperlight_wasm_macro/src/wasmguest.rs index 1ba93341..b9dbac80 100644 --- a/src/hyperlight_wasm_macro/src/wasmguest.rs +++ b/src/hyperlight_wasm_macro/src/wasmguest.rs @@ -214,17 +214,28 @@ fn emit_wasm_function_call( let rwt = match result { None => { quote! { - let func = instance.get_typed_func::<(#(#pwts,)*), ()>(&mut *store, func_idx)?; - func.call(&mut *store, (#(#pus,)*))?; - func.post_return(&mut *store)?; + let func = instance + .get_typed_func::<(#(#pwts,)*), ()>(&mut *store, func_idx) + .map_err(crate::map_wasmtime_error)?; + func.call(&mut *store, (#(#pus,)*)) + .map_err(crate::map_wasmtime_error)?; + #[cfg(feature = "wasmtime_lts")] + func.post_return(&mut *store) + .map_err(crate::map_wasmtime_error)?; } } _ => { let r = rtypes::emit_func_result(s, result); quote! { - let func = instance.get_typed_func::<(#(#pwts,)*), ((#r,))>(&mut *store, func_idx)?; - let #ret = func.call(&mut *store, (#(#pus,)*))?.0; - func.post_return(&mut *store)?; + let func = instance + .get_typed_func::<(#(#pwts,)*), ((#r,))>(&mut *store, func_idx) + .map_err(crate::map_wasmtime_error)?; + let #ret = func.call(&mut *store, (#(#pus,)*)) + .map_err(crate::map_wasmtime_error)? + .0; + #[cfg(feature = "wasmtime_lts")] + func.post_return(&mut *store) + .map_err(crate::map_wasmtime_error)?; } } }; diff --git a/src/hyperlight_wasm_runtime/build.rs b/src/hyperlight_wasm_runtime/build.rs index 1b6ed351..361bc142 100644 --- a/src/hyperlight_wasm_runtime/build.rs +++ b/src/hyperlight_wasm_runtime/build.rs @@ -44,9 +44,7 @@ fn main() { // Multiple wasmtime versions present; pick based on feature wasmtime_packages .iter() - .find(|p| { - (use_lts && p.version.major <= 36) || (!use_lts && p.version.major > 36) - }) + .find(|p| (use_lts && p.version.major <= 36) || (!use_lts && p.version.major > 36)) .unwrap_or_else(|| panic!("wasmtime dependency not found for lts={}", use_lts)) .version .clone() diff --git a/src/hyperlight_wasm_runtime/src/component.rs b/src/hyperlight_wasm_runtime/src/component.rs index a2a37001..42651df5 100644 --- a/src/hyperlight_wasm_runtime/src/component.rs +++ b/src/hyperlight_wasm_runtime/src/component.rs @@ -34,7 +34,7 @@ use tracing::instrument; use wasmtime::component::{Component, Instance, Linker}; use wasmtime::{Config, Engine, Store}; -use crate::platform; +use crate::{map_wasmtime_error, platform}; static CUR_ENGINE: Mutex> = Mutex::new(None); static CUR_LINKER: Mutex>> = Mutex::new(None); @@ -55,7 +55,8 @@ fn load_component_common(engine: &Engine, component: Component) -> Result<()> { let instance = (*CUR_LINKER.lock()) .as_ref() .unwrap() - .instantiate(&mut store, &component)?; + .instantiate(&mut store, &component) + .map_err(map_wasmtime_error)?; *CUR_STORE.lock() = Some(store); *CUR_INSTANCE.lock() = Some(instance); Ok(()) @@ -72,7 +73,8 @@ fn load_wasm_module(function_call: FunctionCall) -> Result> { &function_call.parameters.as_ref().unwrap()[1], &*CUR_ENGINE.lock(), ) { - let component = unsafe { Component::deserialize(engine, wasm_bytes)? }; + let component = + unsafe { Component::deserialize(engine, wasm_bytes).map_err(map_wasmtime_error)? }; load_component_common(engine, component)?; Ok(get_flatbuffer_result::(0)) } else { @@ -90,8 +92,10 @@ fn load_wasm_module_phys(function_call: FunctionCall) -> Result> { &function_call.parameters.as_ref().unwrap()[1], &*CUR_ENGINE.lock(), ) { - let component = - unsafe { Component::deserialize_raw(engine, platform::map_buffer(*phys, *len))? }; + let component = unsafe { + Component::deserialize_raw(engine, platform::map_buffer(*phys, *len)) + .map_err(map_wasmtime_error)? + }; load_component_common(engine, component)?; Ok(get_flatbuffer_result::<()>(())) } else { diff --git a/src/hyperlight_wasm_runtime/src/lib.rs b/src/hyperlight_wasm_runtime/src/lib.rs index dbe9c804..3ea79b58 100644 --- a/src/hyperlight_wasm_runtime/src/lib.rs +++ b/src/hyperlight_wasm_runtime/src/lib.rs @@ -19,6 +19,11 @@ limitations under the License. extern crate alloc; +use alloc::string::ToString; + +use hyperlight_common::flatbuffer_wrappers::guest_error::ErrorCode; +use hyperlight_guest::error::HyperlightGuestError; + // Re-export wasmtime based on expected version #[cfg(all(feature = "wasmtime_latest", feature = "wasmtime_lts"))] compile_error!( @@ -33,6 +38,10 @@ extern crate wasmtime; #[cfg(feature = "wasmtime_lts")] extern crate wasmtime_lts as wasmtime; +pub(crate) fn map_wasmtime_error(error: wasmtime::Error) -> HyperlightGuestError { + HyperlightGuestError::new(ErrorCode::GuestError, error.to_string()) +} + mod platform; #[cfg(not(component))] diff --git a/src/hyperlight_wasm_runtime/src/marshal.rs b/src/hyperlight_wasm_runtime/src/marshal.rs index 890cd698..01694128 100644 --- a/src/hyperlight_wasm_runtime/src/marshal.rs +++ b/src/hyperlight_wasm_runtime/src/marshal.rs @@ -60,6 +60,8 @@ use spin::Mutex; use tracing::instrument; use wasmtime::{AsContextMut, Extern, Val}; +use crate::map_wasmtime_error; + // Global tracking for return value allocations that need to be freed on next VM entry static RETURN_VALUE_ALLOCATIONS: Mutex> = Mutex::new(Vec::new()); @@ -95,8 +97,10 @@ fn malloc( "malloc function not exported".to_string(), ))?; let addr = malloc - .typed::(&mut *ctx)? - .call(&mut *ctx, len as i32)?; + .typed::(&mut *ctx) + .map_err(map_wasmtime_error)? + .call(&mut *ctx, len as i32) + .map_err(map_wasmtime_error)?; Ok(addr) } @@ -112,7 +116,10 @@ fn free( ErrorCode::GuestError, "free function not exported".to_string(), ))?; - free.typed::(&mut *ctx)?.call(&mut *ctx, addr)?; + free.typed::(&mut *ctx) + .map_err(map_wasmtime_error)? + .call(&mut *ctx, addr) + .map_err(map_wasmtime_error)?; Ok(()) } diff --git a/src/hyperlight_wasm_runtime/src/module.rs b/src/hyperlight_wasm_runtime/src/module.rs index 14f7eb6f..10f0c2ac 100644 --- a/src/hyperlight_wasm_runtime/src/module.rs +++ b/src/hyperlight_wasm_runtime/src/module.rs @@ -33,7 +33,7 @@ use spin::Mutex; use tracing::instrument; use wasmtime::{Config, Engine, Linker, Module, Store, Val}; -use crate::{hostfuncs, marshal, platform, wasip1}; +use crate::{hostfuncs, map_wasmtime_error, marshal, platform, wasip1}; // Set by transition to WasmSandbox (by init_wasm_runtime) static CUR_ENGINE: Mutex> = Mutex::new(None); @@ -86,7 +86,8 @@ pub fn guest_dispatch_function(function_call: FunctionCall) -> Result> { let is_void = ReturnType::Void == function_call.expected_return_type; let n_results = if is_void { 0 } else { 1 }; let mut results = vec![Val::I32(0); n_results]; - func.call(&mut *store, &w_params, &mut results)?; + func.call(&mut *store, &w_params, &mut results) + .map_err(map_wasmtime_error)?; marshal::val_to_hl_result( &mut *store, |ctx, name| instance.get_export(ctx, name), @@ -119,7 +120,7 @@ fn init_wasm_runtime(function_call: FunctionCall) -> Result> { "Failed to set wasmtime target: pulley64".to_string(), ) })?; - let engine = Engine::new(&config)?; + let engine = Engine::new(&config).map_err(map_wasmtime_error)?; let mut linker = Linker::new(&engine); wasip1::register_handlers(&mut linker)?; @@ -157,15 +158,17 @@ fn init_wasm_runtime(function_call: FunctionCall) -> Result> { for hostfunc in hostfuncs.iter() { let captured = hostfunc.clone(); - linker.func_new( - "env", - &hostfunc.function_name, - hostfuncs::hostfunc_type(hostfunc, &engine)?, - move |c, ps, rs| { - hostfuncs::call(&captured, c, ps, rs) - .map_err(|e| wasmtime::Error::msg(format!("{:?}", e))) - }, - )?; + linker + .func_new( + "env", + &hostfunc.function_name, + hostfuncs::hostfunc_type(hostfunc, &engine)?, + move |c, ps, rs| { + hostfuncs::call(&captured, c, ps, rs) + .map_err(|e| wasmtime::Error::msg(format!("{:?}", e))) + }, + ) + .map_err(map_wasmtime_error)?; } *CUR_ENGINE.lock() = Some(engine); @@ -190,9 +193,12 @@ fn load_wasm_module(function_call: FunctionCall) -> Result> { "impossible: wasm runtime has no valid linker".to_string(), ))?; - let module = unsafe { Module::deserialize(engine, wasm_bytes)? }; + let module = + unsafe { Module::deserialize(engine, wasm_bytes).map_err(map_wasmtime_error)? }; let mut store = Store::new(engine, ()); - let instance = linker.instantiate(&mut store, &module)?; + let instance = linker + .instantiate(&mut store, &module) + .map_err(map_wasmtime_error)?; *CUR_MODULE.lock() = Some(module); *CUR_STORE.lock() = Some(store); @@ -219,9 +225,14 @@ fn load_wasm_module_phys(function_call: FunctionCall) -> Result> { "impossible: wasm runtime has no valid linker".to_string(), ))?; - let module = unsafe { Module::deserialize_raw(engine, platform::map_buffer(*phys, *len))? }; + let module = unsafe { + Module::deserialize_raw(engine, platform::map_buffer(*phys, *len)) + .map_err(map_wasmtime_error)? + }; let mut store = Store::new(engine, ()); - let instance = linker.instantiate(&mut store, &module)?; + let instance = linker + .instantiate(&mut store, &module) + .map_err(map_wasmtime_error)?; *CUR_MODULE.lock() = Some(module); *CUR_STORE.lock() = Some(store); diff --git a/src/hyperlight_wasm_runtime/src/platform.rs b/src/hyperlight_wasm_runtime/src/platform.rs index c2e6982a..364ddae6 100644 --- a/src/hyperlight_wasm_runtime/src/platform.rs +++ b/src/hyperlight_wasm_runtime/src/platform.rs @@ -65,7 +65,10 @@ pub(crate) fn register_page_fault_handler() { // See AMD64 Architecture Programmer's Manual, Volume 2 // §8.2 Vectors, p. 245 // Table 8-1: Interrupt Vector Source and Cause - arch::HANDLERS[14].store(page_fault_handler as usize as u64, Ordering::Release); + arch::HANDLERS[14].store( + page_fault_handler as *const () as usize as u64, + Ordering::Release, + ); } // Wasmtime Embedding Interface @@ -161,7 +164,10 @@ pub extern "C" fn wasmtime_init_traps(handler: wasmtime_trap_handler_t) -> i32 { // See AMD64 Architecture Programmer's Manual, Volume 2 // §8.2 Vectors, p. 245 // Table 8-1: Interrupt Vector Source and Cause - arch::HANDLERS[6].store(wasmtime_trap_handler as usize as u64, Ordering::Release); + arch::HANDLERS[6].store( + wasmtime_trap_handler as *const () as usize as u64, + Ordering::Release, + ); // TODO: Add handlers for any other traps that wasmtime needs, // probably including at least some floating-point // exceptions diff --git a/src/hyperlight_wasm_runtime/src/wasip1.rs b/src/hyperlight_wasm_runtime/src/wasip1.rs index 0b235a1f..c8f21556 100644 --- a/src/hyperlight_wasm_runtime/src/wasip1.rs +++ b/src/hyperlight_wasm_runtime/src/wasip1.rs @@ -25,102 +25,114 @@ use hyperlight_guest::error::Result; use hyperlight_guest_bin::host_comm::call_host_function; use wasmtime::{Caller, Extern, Linker}; +use crate::map_wasmtime_error; + pub(crate) fn register_handlers(linker: &mut Linker) -> Result<()> { - linker.func_wrap( - "wasi_snapshot_preview1", - "fd_seek", - |fd: i32, filedelta: i64, whence: i32, _retptr: i32| -> i32 { - panic!("fd_seek called {} {} {}", fd, filedelta, whence); - }, - )?; - linker.func_wrap( - "wasi_snapshot_preview1", - "fd_write", - |mut ctx: Caller<'_, T>, fd: i32, iovs: i32, iovs_len: i32, retptr: i32| { - if fd != 1 { - return -1; - } - let iovs = iovs as usize; - let retptr = retptr as usize; - let Some(memory) = ctx.get_export("memory").and_then(Extern::into_memory) else { - return -1; - }; - let mut total_written: i32 = 0; - for i in 0..iovs_len as usize { - // iovec is size 8 - let iov = iovs + 8 * i; - let mut bytes = [0u8; 4]; - // offset 0 iovec.buf - memory.read(&mut ctx, iov, &mut bytes).unwrap(); - let buf = i32::from_le_bytes(bytes); - // offset 4 is iovec.buf_len - memory.read(&mut ctx, iov + 4, &mut bytes).unwrap(); - let buf_len = i32::from_le_bytes(bytes); - let mut string_bytes = vec![0u8; buf_len as usize]; - memory - .read(&mut ctx, buf as usize, &mut string_bytes) - .unwrap(); - let Ok(str) = core::str::from_utf8(&string_bytes) else { - return -2; - }; - let Ok(written) = call_host_function::( - "HostPrint", - Some(Vec::from(&[ParameterValue::String(str.to_string())])), - ReturnType::Int, - ) else { - return -3; - }; - total_written += written; - } - memory - .write(&mut ctx, retptr, &total_written.to_le_bytes()) - .unwrap(); - 0 - }, - )?; - linker.func_wrap("wasi_snapshot_preview1", "fd_close", |fd: i32| -> i32 { - panic!("fd_close called {}", fd); - })?; - linker.func_wrap( - "wasi_snapshot_preview1", - "random_get", - |buff: i32, len: i32| -> i32 { - panic!("random_get called for {} with len {}", buff, len); - }, - )?; - linker.func_wrap( - "wasi_snapshot_preview1", - "fd_fdstat_get", - |mut ctx: Caller<'_, T>, fd: i32, retptr: i32| { - if fd != 1 { - return -1; - } - if let Some(()) = (|| { + linker + .func_wrap( + "wasi_snapshot_preview1", + "fd_seek", + |fd: i32, filedelta: i64, whence: i32, _retptr: i32| -> i32 { + panic!("fd_seek called {} {} {}", fd, filedelta, whence); + }, + ) + .map_err(map_wasmtime_error)?; + linker + .func_wrap( + "wasi_snapshot_preview1", + "fd_write", + |mut ctx: Caller<'_, T>, fd: i32, iovs: i32, iovs_len: i32, retptr: i32| { + if fd != 1 { + return -1; + } + let iovs = iovs as usize; let retptr = retptr as usize; - let memory = ctx.get_export("memory")?.into_memory()?; - // offset 0 is fdstat.fs_filetype; 4 is regular_file - memory - .write(&mut ctx, retptr, &(4_u16).to_le_bytes()) - .unwrap(); - // offset 2 is fdstat.fs_flags; 0 is no particular flags - memory - .write(&mut ctx, retptr + 2, &(0_u16).to_le_bytes()) - .unwrap(); - // offset 8 fdstat.fs_rights_base; 0b100011 is read/write/seek - memory - .write(&mut ctx, retptr + 8, &(0b100011_u64).to_le_bytes()) - .unwrap(); - // offset 8 fdstat.fs_rights_inheriting; 0b100011 is read/write/seek + let Some(memory) = ctx.get_export("memory").and_then(Extern::into_memory) else { + return -1; + }; + let mut total_written: i32 = 0; + for i in 0..iovs_len as usize { + // iovec is size 8 + let iov = iovs + 8 * i; + let mut bytes = [0u8; 4]; + // offset 0 iovec.buf + memory.read(&mut ctx, iov, &mut bytes).unwrap(); + let buf = i32::from_le_bytes(bytes); + // offset 4 is iovec.buf_len + memory.read(&mut ctx, iov + 4, &mut bytes).unwrap(); + let buf_len = i32::from_le_bytes(bytes); + let mut string_bytes = vec![0u8; buf_len as usize]; + memory + .read(&mut ctx, buf as usize, &mut string_bytes) + .unwrap(); + let Ok(str) = core::str::from_utf8(&string_bytes) else { + return -2; + }; + let Ok(written) = call_host_function::( + "HostPrint", + Some(Vec::from(&[ParameterValue::String(str.to_string())])), + ReturnType::Int, + ) else { + return -3; + }; + total_written += written; + } memory - .write(&mut ctx, retptr + 16, &(0b100011_u64).to_le_bytes()) + .write(&mut ctx, retptr, &total_written.to_le_bytes()) .unwrap(); - Some(()) - })() { 0 - } else { - -1 - } - }, - )?; + }, + ) + .map_err(map_wasmtime_error)?; + linker + .func_wrap("wasi_snapshot_preview1", "fd_close", |fd: i32| -> i32 { + panic!("fd_close called {}", fd); + }) + .map_err(map_wasmtime_error)?; + linker + .func_wrap( + "wasi_snapshot_preview1", + "random_get", + |buff: i32, len: i32| -> i32 { + panic!("random_get called for {} with len {}", buff, len); + }, + ) + .map_err(map_wasmtime_error)?; + linker + .func_wrap( + "wasi_snapshot_preview1", + "fd_fdstat_get", + |mut ctx: Caller<'_, T>, fd: i32, retptr: i32| { + if fd != 1 { + return -1; + } + if let Some(()) = (|| { + let retptr = retptr as usize; + let memory = ctx.get_export("memory")?.into_memory()?; + // offset 0 is fdstat.fs_filetype; 4 is regular_file + memory + .write(&mut ctx, retptr, &(4_u16).to_le_bytes()) + .unwrap(); + // offset 2 is fdstat.fs_flags; 0 is no particular flags + memory + .write(&mut ctx, retptr + 2, &(0_u16).to_le_bytes()) + .unwrap(); + // offset 8 fdstat.fs_rights_base; 0b100011 is read/write/seek + memory + .write(&mut ctx, retptr + 8, &(0b100011_u64).to_le_bytes()) + .unwrap(); + // offset 8 fdstat.fs_rights_inheriting; 0b100011 is read/write/seek + memory + .write(&mut ctx, retptr + 16, &(0b100011_u64).to_le_bytes()) + .unwrap(); + Some(()) + })() { + 0 + } else { + -1 + } + }, + ) + .map_err(map_wasmtime_error)?; Ok(()) }