diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index e833ff3..a841eec 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -30,7 +30,7 @@ jobs: - uses: actions/setup-python@v5 with: - python-version: "3.14.0-rc.3" + python-version: "3.14.0" - name: Install latest Rust nightly toolchain uses: dtolnay/rust-toolchain@nightly @@ -145,7 +145,7 @@ jobs: - uses: actions/setup-python@v5 with: - python-version: "3.14.0-rc.3" + python-version: "3.14.0" - name: Install latest Rust nightly toolchain uses: dtolnay/rust-toolchain@nightly diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index bca5c41..12712de 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -28,7 +28,7 @@ jobs: - uses: actions/setup-python@v5 with: - python-version: "3.14.0-rc.3" + python-version: "3.14.0" - name: Install latest Rust nightly toolchain uses: dtolnay/rust-toolchain@nightly @@ -138,7 +138,7 @@ jobs: - uses: actions/setup-python@v5 with: - python-version: "3.14.0-rc.3" + python-version: "3.14.0" - name: Test shell: bash diff --git a/Cargo.lock b/Cargo.lock index 7ffbefe..a28a64f 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -478,7 +478,7 @@ dependencies = [ [[package]] name = "componentize-py" -version = "0.19.2" +version = "0.19.3" dependencies = [ "anyhow", "assert_cmd", @@ -508,13 +508,13 @@ dependencies = [ "test-generator", "tokio", "toml 0.8.23", - "wasm-encoder 0.240.0 (git+https://github.com/bytecodealliance/wasm-tools?rev=37f05db5)", - "wasmparser 0.240.0 (git+https://github.com/bytecodealliance/wasm-tools?rev=37f05db5)", + "wasm-encoder 0.240.0 (git+https://github.com/bytecodealliance/wasm-tools?rev=e2bb0a24)", + "wasmparser 0.240.0 (git+https://github.com/bytecodealliance/wasm-tools?rev=e2bb0a24)", "wasmtime", "wasmtime-wasi", "wit-component 0.240.0", "wit-dylib", - "wit-parser 0.240.0 (git+https://github.com/bytecodealliance/wasm-tools?rev=37f05db5)", + "wit-parser 0.240.0 (git+https://github.com/bytecodealliance/wasm-tools?rev=e2bb0a24)", "zstd", ] @@ -578,7 +578,8 @@ dependencies = [ [[package]] name = "cranelift-assembler-x64" version = "0.126.0" -source = "git+https://github.com/bytecodealliance/wasmtime?rev=efd56f68#efd56f682b6d1d37e43bf407947e8ee5406a837f" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bf7631e609c97f063f9777aae405e8492abf9bf92336d7aa3f875403dd4ffd7d" dependencies = [ "cranelift-assembler-x64-meta", ] @@ -586,7 +587,8 @@ dependencies = [ [[package]] name = "cranelift-assembler-x64-meta" version = "0.126.0" -source = "git+https://github.com/bytecodealliance/wasmtime?rev=efd56f68#efd56f682b6d1d37e43bf407947e8ee5406a837f" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c030edccdc4a5bbf28fbfe7701b5cd1f9854b4445184dd34af2a7e8f8db6f45" dependencies = [ "cranelift-srcgen", ] @@ -594,7 +596,8 @@ dependencies = [ [[package]] name = "cranelift-bforest" version = "0.126.0" -source = "git+https://github.com/bytecodealliance/wasmtime?rev=efd56f68#efd56f682b6d1d37e43bf407947e8ee5406a837f" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bb544c1242d0ca98baf01873ebba96c79d5df155d5108d9bb699aefc741f5e6d" dependencies = [ "cranelift-entity", ] @@ -602,7 +605,8 @@ dependencies = [ [[package]] name = "cranelift-bitset" version = "0.126.0" -source = "git+https://github.com/bytecodealliance/wasmtime?rev=efd56f68#efd56f682b6d1d37e43bf407947e8ee5406a837f" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f0325aecbafec053d3d3f082edfdca7937e2945e7f09c5ff9672e05198312282" dependencies = [ "serde", "serde_derive", @@ -611,7 +615,8 @@ dependencies = [ [[package]] name = "cranelift-codegen" version = "0.126.0" -source = "git+https://github.com/bytecodealliance/wasmtime?rev=efd56f68#efd56f682b6d1d37e43bf407947e8ee5406a837f" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "abb3236fd319ae897ba00c8a25105081de5c1348576def0e96c062ad259f87a7" dependencies = [ "bumpalo", "cranelift-assembler-x64", @@ -637,7 +642,8 @@ dependencies = [ [[package]] name = "cranelift-codegen-meta" version = "0.126.0" -source = "git+https://github.com/bytecodealliance/wasmtime?rev=efd56f68#efd56f682b6d1d37e43bf407947e8ee5406a837f" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7b8791c911a361c539130ace34fb726b16aca4216470ec75d75264b1495c8a3a" dependencies = [ "cranelift-assembler-x64-meta", "cranelift-codegen-shared", @@ -649,12 +655,14 @@ dependencies = [ [[package]] name = "cranelift-codegen-shared" version = "0.126.0" -source = "git+https://github.com/bytecodealliance/wasmtime?rev=efd56f68#efd56f682b6d1d37e43bf407947e8ee5406a837f" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "12ead718c2a10990870c19b2497b5a04b8aae6024485e33da25b5d02e35819e0" [[package]] name = "cranelift-control" version = "0.126.0" -source = "git+https://github.com/bytecodealliance/wasmtime?rev=efd56f68#efd56f682b6d1d37e43bf407947e8ee5406a837f" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c0a57fc972b5651047efddccb99440d103d9d8c13393ccebde15ddd5b6a1181b" dependencies = [ "arbitrary", ] @@ -662,7 +670,8 @@ dependencies = [ [[package]] name = "cranelift-entity" version = "0.126.0" -source = "git+https://github.com/bytecodealliance/wasmtime?rev=efd56f68#efd56f682b6d1d37e43bf407947e8ee5406a837f" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5aae980b4a1678b601eab2f52e372ed0b3c9565a31c17f380008cb97b3a699c5" dependencies = [ "cranelift-bitset", "serde", @@ -672,7 +681,8 @@ dependencies = [ [[package]] name = "cranelift-frontend" version = "0.126.0" -source = "git+https://github.com/bytecodealliance/wasmtime?rev=efd56f68#efd56f682b6d1d37e43bf407947e8ee5406a837f" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a78877016b607982ca1708c0dd4ce23bde04581a39854c9b43a1dca43625b54c" dependencies = [ "cranelift-codegen", "log", @@ -683,12 +693,14 @@ dependencies = [ [[package]] name = "cranelift-isle" version = "0.126.0" -source = "git+https://github.com/bytecodealliance/wasmtime?rev=efd56f68#efd56f682b6d1d37e43bf407947e8ee5406a837f" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5dc46a68b46d4f53f9f2f02ab8d3a34b00f03a21c124a7a965b8cbf5fdb6773b" [[package]] name = "cranelift-native" version = "0.126.0" -source = "git+https://github.com/bytecodealliance/wasmtime?rev=efd56f68#efd56f682b6d1d37e43bf407947e8ee5406a837f" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "03faa07ec8cf373250a8252eb773d098ff88259fa1c19ee1ecde8012839f4097" dependencies = [ "cranelift-codegen", "libc", @@ -698,7 +710,8 @@ dependencies = [ [[package]] name = "cranelift-srcgen" version = "0.126.0" -source = "git+https://github.com/bytecodealliance/wasmtime?rev=efd56f68#efd56f682b6d1d37e43bf407947e8ee5406a837f" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0484cb32c527a742e1bba09ef174acac0afb1dcf623ef1adda42849200edcd2e" [[package]] name = "crc32fast" @@ -1865,7 +1878,8 @@ dependencies = [ [[package]] name = "pulley-interpreter" version = "39.0.0" -source = "git+https://github.com/bytecodealliance/wasmtime?rev=efd56f68#efd56f682b6d1d37e43bf407947e8ee5406a837f" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1bc616e1513d22922fd69ef8294f243f9b268790a1bf6c2f4dbd0fefb82badaf" dependencies = [ "cranelift-bitset", "log", @@ -1876,7 +1890,8 @@ dependencies = [ [[package]] name = "pulley-macros" version = "39.0.0" -source = "git+https://github.com/bytecodealliance/wasmtime?rev=efd56f68#efd56f682b6d1d37e43bf407947e8ee5406a837f" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7416ec5b280e7c12c457452d8d1569591ff29136f12fa699e848b9cc77de2845" dependencies = [ "proc-macro2", "quote", @@ -3132,19 +3147,19 @@ dependencies = [ [[package]] name = "wasm-encoder" version = "0.240.0" -source = "git+https://github.com/bytecodealliance/wasm-tools?rev=37f05db5#37f05db5d62705c433e1231241dd6e3dcc234b53" +source = "git+https://github.com/bytecodealliance/wasm-tools?rev=b1d8ff59#b1d8ff591bcb8c052b54c3c17495bbbef401897c" dependencies = [ "leb128fmt", - "wasmparser 0.240.0 (git+https://github.com/bytecodealliance/wasm-tools?rev=37f05db5)", + "wasmparser 0.240.0 (git+https://github.com/bytecodealliance/wasm-tools?rev=b1d8ff59)", ] [[package]] name = "wasm-encoder" version = "0.240.0" -source = "git+https://github.com/bytecodealliance/wasm-tools?rev=b1d8ff59#b1d8ff591bcb8c052b54c3c17495bbbef401897c" +source = "git+https://github.com/bytecodealliance/wasm-tools?rev=e2bb0a24#e2bb0a249b038c54e404394f60411f4e8aa914c4" dependencies = [ "leb128fmt", - "wasmparser 0.240.0 (git+https://github.com/bytecodealliance/wasm-tools?rev=b1d8ff59)", + "wasmparser 0.240.0 (git+https://github.com/bytecodealliance/wasm-tools?rev=e2bb0a24)", ] [[package]] @@ -3166,17 +3181,6 @@ dependencies = [ "wasmparser 0.227.1", ] -[[package]] -name = "wasm-metadata" -version = "0.240.0" -source = "git+https://github.com/bytecodealliance/wasm-tools?rev=37f05db5#37f05db5d62705c433e1231241dd6e3dcc234b53" -dependencies = [ - "anyhow", - "indexmap", - "wasm-encoder 0.240.0 (git+https://github.com/bytecodealliance/wasm-tools?rev=37f05db5)", - "wasmparser 0.240.0 (git+https://github.com/bytecodealliance/wasm-tools?rev=37f05db5)", -] - [[package]] name = "wasm-metadata" version = "0.240.0" @@ -3195,6 +3199,17 @@ dependencies = [ "wasmparser 0.240.0 (git+https://github.com/bytecodealliance/wasm-tools?rev=b1d8ff59)", ] +[[package]] +name = "wasm-metadata" +version = "0.240.0" +source = "git+https://github.com/bytecodealliance/wasm-tools?rev=e2bb0a24#e2bb0a249b038c54e404394f60411f4e8aa914c4" +dependencies = [ + "anyhow", + "indexmap", + "wasm-encoder 0.240.0 (git+https://github.com/bytecodealliance/wasm-tools?rev=e2bb0a24)", + "wasmparser 0.240.0 (git+https://github.com/bytecodealliance/wasm-tools?rev=e2bb0a24)", +] + [[package]] name = "wasmparser" version = "0.227.1" @@ -3223,7 +3238,7 @@ dependencies = [ [[package]] name = "wasmparser" version = "0.240.0" -source = "git+https://github.com/bytecodealliance/wasm-tools?rev=37f05db5#37f05db5d62705c433e1231241dd6e3dcc234b53" +source = "git+https://github.com/bytecodealliance/wasm-tools?rev=b1d8ff59#b1d8ff591bcb8c052b54c3c17495bbbef401897c" dependencies = [ "bitflags", "hashbrown 0.15.5", @@ -3235,7 +3250,7 @@ dependencies = [ [[package]] name = "wasmparser" version = "0.240.0" -source = "git+https://github.com/bytecodealliance/wasm-tools?rev=b1d8ff59#b1d8ff591bcb8c052b54c3c17495bbbef401897c" +source = "git+https://github.com/bytecodealliance/wasm-tools?rev=e2bb0a24#e2bb0a249b038c54e404394f60411f4e8aa914c4" dependencies = [ "bitflags", "hashbrown 0.15.5", @@ -3258,7 +3273,8 @@ dependencies = [ [[package]] name = "wasmtime" version = "39.0.0" -source = "git+https://github.com/bytecodealliance/wasmtime?rev=efd56f68#efd56f682b6d1d37e43bf407947e8ee5406a837f" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fa8756404ba797b1df7e4bbb1b9b9261d48c0b4c9ae8b511b9f0050f2982f7c7" dependencies = [ "addr2line", "anyhow", @@ -3315,7 +3331,8 @@ dependencies = [ [[package]] name = "wasmtime-environ" version = "39.0.0" -source = "git+https://github.com/bytecodealliance/wasmtime?rev=efd56f68#efd56f682b6d1d37e43bf407947e8ee5406a837f" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dbe588bc688673cbd4085cbb82db681a6591c87538dce6aa44c0057a3c82bbca" dependencies = [ "anyhow", "cpp_demangle", @@ -3341,7 +3358,8 @@ dependencies = [ [[package]] name = "wasmtime-internal-cache" version = "39.0.0" -source = "git+https://github.com/bytecodealliance/wasmtime?rev=efd56f68#efd56f682b6d1d37e43bf407947e8ee5406a837f" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a6883ad2840d15d463f3bf6a4e2f276074c9ff580f290fe57301ba7d9e41ae20" dependencies = [ "anyhow", "base64", @@ -3360,7 +3378,8 @@ dependencies = [ [[package]] name = "wasmtime-internal-component-macro" version = "39.0.0" -source = "git+https://github.com/bytecodealliance/wasmtime?rev=efd56f68#efd56f682b6d1d37e43bf407947e8ee5406a837f" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "784eacadc1ce66d111c2e2b80eb1cef0ba6f9a47e40cf1ec51bb60d7e3c7b8eb" dependencies = [ "anyhow", "proc-macro2", @@ -3374,12 +3393,14 @@ dependencies = [ [[package]] name = "wasmtime-internal-component-util" version = "39.0.0" -source = "git+https://github.com/bytecodealliance/wasmtime?rev=efd56f68#efd56f682b6d1d37e43bf407947e8ee5406a837f" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f0864d5af4d2689c1fd7f279bd548de614da9667428914a5655237b55e5a0e8c" [[package]] name = "wasmtime-internal-cranelift" version = "39.0.0" -source = "git+https://github.com/bytecodealliance/wasmtime?rev=efd56f68#efd56f682b6d1d37e43bf407947e8ee5406a837f" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f7da9085c89bd382e95e5bddedb95f6304ef7866b04f84d2bb3ac7d46d9e6219" dependencies = [ "anyhow", "cfg-if", @@ -3406,7 +3427,8 @@ dependencies = [ [[package]] name = "wasmtime-internal-fiber" version = "39.0.0" -source = "git+https://github.com/bytecodealliance/wasmtime?rev=efd56f68#efd56f682b6d1d37e43bf407947e8ee5406a837f" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4e9c0146a0cb1de6f8f1539f7ce95b4464f57940b2b608db730b43407f09902f" dependencies = [ "anyhow", "cc", @@ -3420,7 +3442,8 @@ dependencies = [ [[package]] name = "wasmtime-internal-jit-debug" version = "39.0.0" -source = "git+https://github.com/bytecodealliance/wasmtime?rev=efd56f68#efd56f682b6d1d37e43bf407947e8ee5406a837f" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "774ed19958d2fe67bdb817501aad9d399be50ee5752f63fdb866e061fc034186" dependencies = [ "cc", "object", @@ -3431,7 +3454,8 @@ dependencies = [ [[package]] name = "wasmtime-internal-jit-icache-coherence" version = "39.0.0" -source = "git+https://github.com/bytecodealliance/wasmtime?rev=efd56f68#efd56f682b6d1d37e43bf407947e8ee5406a837f" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f67986f5c499274ae5b2ba5b173bba0b95d1381f5ca70d8eec657f2392117d8" dependencies = [ "anyhow", "cfg-if", @@ -3442,7 +3466,8 @@ dependencies = [ [[package]] name = "wasmtime-internal-math" version = "39.0.0" -source = "git+https://github.com/bytecodealliance/wasmtime?rev=efd56f68#efd56f682b6d1d37e43bf407947e8ee5406a837f" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a681733e9b5d5d8804ee6cacd59f92c0d87ba2274f42ee1d4e5a943828d0075d" dependencies = [ "libm", ] @@ -3450,12 +3475,14 @@ dependencies = [ [[package]] name = "wasmtime-internal-slab" version = "39.0.0" -source = "git+https://github.com/bytecodealliance/wasmtime?rev=efd56f68#efd56f682b6d1d37e43bf407947e8ee5406a837f" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f70d4cccc4e7947fee614e939c88495b97234b15932d0f1e547ed333cb45b8f2" [[package]] name = "wasmtime-internal-unwinder" version = "39.0.0" -source = "git+https://github.com/bytecodealliance/wasmtime?rev=efd56f68#efd56f682b6d1d37e43bf407947e8ee5406a837f" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "268719806a64beed50c571066c8d809e99118d03cc7a3f2a2112776540387b04" dependencies = [ "anyhow", "cfg-if", @@ -3467,7 +3494,8 @@ dependencies = [ [[package]] name = "wasmtime-internal-versioned-export-macros" version = "39.0.0" -source = "git+https://github.com/bytecodealliance/wasmtime?rev=efd56f68#efd56f682b6d1d37e43bf407947e8ee5406a837f" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f159bbb87a078b67f1bfd75d2acb9d2e47c2177044bcccb20d031addbc6245c3" dependencies = [ "proc-macro2", "quote", @@ -3477,7 +3505,8 @@ dependencies = [ [[package]] name = "wasmtime-internal-winch" version = "39.0.0" -source = "git+https://github.com/bytecodealliance/wasmtime?rev=efd56f68#efd56f682b6d1d37e43bf407947e8ee5406a837f" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "398c815d9bd313e9f3e768c1c39859f02c89cbbacccbc9fdb1943937b588c0a3" dependencies = [ "anyhow", "cranelift-codegen", @@ -3494,7 +3523,8 @@ dependencies = [ [[package]] name = "wasmtime-internal-wit-bindgen" version = "39.0.0" -source = "git+https://github.com/bytecodealliance/wasmtime?rev=efd56f68#efd56f682b6d1d37e43bf407947e8ee5406a837f" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ee6e4341cf80f6f2b50923553a92d14a0aa9f921fbf4370b3bde367db90f3e6" dependencies = [ "anyhow", "bitflags", @@ -3506,7 +3536,8 @@ dependencies = [ [[package]] name = "wasmtime-wasi" version = "39.0.0" -source = "git+https://github.com/bytecodealliance/wasmtime?rev=efd56f68#efd56f682b6d1d37e43bf407947e8ee5406a837f" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d4364e3dbe9b4586a7ebf4e4e520ba30b305f1b616de7aa451e2bb70e620b357" dependencies = [ "anyhow", "async-trait", @@ -3536,7 +3567,8 @@ dependencies = [ [[package]] name = "wasmtime-wasi-io" version = "39.0.0" -source = "git+https://github.com/bytecodealliance/wasmtime?rev=efd56f68#efd56f682b6d1d37e43bf407947e8ee5406a837f" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c0ca2b0297ee1f1ebb0466f6eaa559d50befe9a6e06fc52cf070e56475544e0d" dependencies = [ "anyhow", "async-trait", @@ -3608,7 +3640,8 @@ dependencies = [ [[package]] name = "wiggle" version = "39.0.0" -source = "git+https://github.com/bytecodealliance/wasmtime?rev=efd56f68#efd56f682b6d1d37e43bf407947e8ee5406a837f" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ca9dcd24f64c200aa0618c5e595e044226aa169fc287b4267709a926d929e0f" dependencies = [ "anyhow", "bitflags", @@ -3621,7 +3654,8 @@ dependencies = [ [[package]] name = "wiggle-generate" version = "39.0.0" -source = "git+https://github.com/bytecodealliance/wasmtime?rev=efd56f68#efd56f682b6d1d37e43bf407947e8ee5406a837f" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9836f1ccbbfea133c07a7a0a0ce54162be6e338982adb8ae893e5eafc9e25c3a" dependencies = [ "anyhow", "heck 0.5.0", @@ -3634,7 +3668,8 @@ dependencies = [ [[package]] name = "wiggle-macro" version = "39.0.0" -source = "git+https://github.com/bytecodealliance/wasmtime?rev=efd56f68#efd56f682b6d1d37e43bf407947e8ee5406a837f" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4c251c6a9c6022d22777d71a938d6970e45f59665ffdd1cce3bebfe77e23f9f3" dependencies = [ "proc-macro2", "quote", @@ -3676,7 +3711,8 @@ checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" [[package]] name = "winch-codegen" version = "39.0.0" -source = "git+https://github.com/bytecodealliance/wasmtime?rev=efd56f68#efd56f682b6d1d37e43bf407947e8ee5406a837f" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ae842e40a6f06efc8882a3c175f6331dceb0d6275d48072944e1bb3ee93177a7" dependencies = [ "anyhow", "cranelift-assembler-x64", @@ -4024,7 +4060,7 @@ dependencies = [ [[package]] name = "wit-component" version = "0.240.0" -source = "git+https://github.com/bytecodealliance/wasm-tools?rev=37f05db5#37f05db5d62705c433e1231241dd6e3dcc234b53" +source = "git+https://github.com/bytecodealliance/wasm-tools?rev=e2bb0a24#e2bb0a249b038c54e404394f60411f4e8aa914c4" dependencies = [ "anyhow", "bitflags", @@ -4033,21 +4069,21 @@ dependencies = [ "serde", "serde_derive", "serde_json", - "wasm-encoder 0.240.0 (git+https://github.com/bytecodealliance/wasm-tools?rev=37f05db5)", - "wasm-metadata 0.240.0 (git+https://github.com/bytecodealliance/wasm-tools?rev=37f05db5)", - "wasmparser 0.240.0 (git+https://github.com/bytecodealliance/wasm-tools?rev=37f05db5)", - "wit-parser 0.240.0 (git+https://github.com/bytecodealliance/wasm-tools?rev=37f05db5)", + "wasm-encoder 0.240.0 (git+https://github.com/bytecodealliance/wasm-tools?rev=e2bb0a24)", + "wasm-metadata 0.240.0 (git+https://github.com/bytecodealliance/wasm-tools?rev=e2bb0a24)", + "wasmparser 0.240.0 (git+https://github.com/bytecodealliance/wasm-tools?rev=e2bb0a24)", + "wit-parser 0.240.0 (git+https://github.com/bytecodealliance/wasm-tools?rev=e2bb0a24)", ] [[package]] name = "wit-dylib" version = "0.240.0" -source = "git+https://github.com/bytecodealliance/wasm-tools?rev=37f05db5#37f05db5d62705c433e1231241dd6e3dcc234b53" +source = "git+https://github.com/bytecodealliance/wasm-tools?rev=e2bb0a24#e2bb0a249b038c54e404394f60411f4e8aa914c4" dependencies = [ "anyhow", "indexmap", - "wasm-encoder 0.240.0 (git+https://github.com/bytecodealliance/wasm-tools?rev=37f05db5)", - "wit-parser 0.240.0 (git+https://github.com/bytecodealliance/wasm-tools?rev=37f05db5)", + "wasm-encoder 0.240.0 (git+https://github.com/bytecodealliance/wasm-tools?rev=e2bb0a24)", + "wit-parser 0.240.0 (git+https://github.com/bytecodealliance/wasm-tools?rev=e2bb0a24)", ] [[package]] @@ -4094,7 +4130,7 @@ dependencies = [ [[package]] name = "wit-parser" version = "0.240.0" -source = "git+https://github.com/bytecodealliance/wasm-tools?rev=37f05db5#37f05db5d62705c433e1231241dd6e3dcc234b53" +source = "git+https://github.com/bytecodealliance/wasm-tools?rev=e2bb0a24#e2bb0a249b038c54e404394f60411f4e8aa914c4" dependencies = [ "anyhow", "id-arena", @@ -4105,7 +4141,7 @@ dependencies = [ "serde_derive", "serde_json", "unicode-xid", - "wasmparser 0.240.0 (git+https://github.com/bytecodealliance/wasm-tools?rev=37f05db5)", + "wasmparser 0.240.0 (git+https://github.com/bytecodealliance/wasm-tools?rev=e2bb0a24)", ] [[package]] diff --git a/Cargo.toml b/Cargo.toml index b56f888..78a141a 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "componentize-py" -version = "0.19.2" +version = "0.19.3" edition = "2024" exclude = ["cpython"] @@ -15,14 +15,17 @@ tar = "0.4.42" tempfile = "3.13.0" zstd = "0.13.2" # TODO: switch to wasm-tools release once -# https://github.com/bytecodealliance/wasm-tools/pull/2367 and -# https://github.com/bytecodealliance/wasm-tools/pull/2371 have been merged and -# released -wasm-encoder = { git = "https://github.com/bytecodealliance/wasm-tools", rev = "37f05db5", features = ["wasmparser"] } -wit-dylib = { git = "https://github.com/bytecodealliance/wasm-tools", rev = "37f05db5" } -wit-parser = { git = "https://github.com/bytecodealliance/wasm-tools", rev = "37f05db5" } -wit-component = { git = "https://github.com/bytecodealliance/wasm-tools", rev = "37f05db5" } -wasmparser = { git = "https://github.com/bytecodealliance/wasm-tools", rev = "37f05db5" } +# https://github.com/bytecodealliance/wasm-tools/pull/2367, +# https://github.com/bytecodealliance/wasm-tools/pull/2371, and +# https://github.com/bytecodealliance/wasm-tools/pull/2375 have been released, +# but note that https://github.com/bytecodealliance/wasm-tools/pull/2376 broke +# ABI compatibilty, so we'll also need to upgrade to Wasmtime 40+ to get +# everything aligned. +wasm-encoder = { git = "https://github.com/bytecodealliance/wasm-tools", rev = "e2bb0a24", features = ["wasmparser"] } +wit-dylib = { git = "https://github.com/bytecodealliance/wasm-tools", rev = "e2bb0a24" } +wit-parser = { git = "https://github.com/bytecodealliance/wasm-tools", rev = "e2bb0a24" } +wit-component = { git = "https://github.com/bytecodealliance/wasm-tools", rev = "e2bb0a24" } +wasmparser = { git = "https://github.com/bytecodealliance/wasm-tools", rev = "e2bb0a24" } indexmap = "2.6.0" bincode = "1.3.3" heck = "0.5.0" @@ -30,9 +33,8 @@ pyo3 = { version = "0.26.0", features = [ "abi3-py39", "extension-module", ], optional = true } -# TODO: switch to wasmtime 39.0.x when available -wasmtime = { git = "https://github.com/bytecodealliance/wasmtime", rev = "efd56f68", features = [ "component-model-async" ] } -wasmtime-wasi = { git = "https://github.com/bytecodealliance/wasmtime", rev = "efd56f68", features = [ "p3" ] } +wasmtime = "39.0.0" +wasmtime-wasi = { version = "39.0.0", features = [ "p3" ] } once_cell = "1.20.2" component-init-transform = { git = "https://github.com/dicej/component-init", rev = "2d965957" } async-trait = "0.1.83" diff --git a/bundled/componentize_py_async_support/__init__.py b/bundled/componentize_py_async_support/__init__.py index 59c2f18..a7bd016 100644 --- a/bundled/componentize_py_async_support/__init__.py +++ b/bundled/componentize_py_async_support/__init__.py @@ -424,7 +424,7 @@ def _set_future_state(future_state: _FutureState) -> None: _future_state.set(future_state) -async def _return_result(export_index: int, coroutine: Any) -> None: +async def _return_result(export_index: int, borrows: int, coroutine: Any) -> None: global _future_state try: @@ -433,18 +433,18 @@ async def _return_result(export_index: int, coroutine: Any) -> None: except Err as e: result = e - componentize_py_runtime.call_task_return(export_index, result) + componentize_py_runtime.call_task_return(export_index, borrows, result) except Exception as e: _loop.exception = e assert _future_state.get().pending_count > 0 _future_state.get().pending_count -= 1 -def first_poll(export_index: int, coroutine: Any) -> int: +def first_poll(export_index: int, borrows: int, coroutine: Any) -> int: context = Context() future_state = _FutureState(None, {}, [], 1) context.run(_set_future_state, future_state) - asyncio.create_task(_return_result(export_index, coroutine), context=context) + asyncio.create_task(_return_result(export_index, borrows, coroutine), context=context) return _poll(future_state) def _poll(future_state: _FutureState) -> int: diff --git a/bundled/componentize_py_runtime.pyi b/bundled/componentize_py_runtime.pyi index 5377e92..ff09cf8 100644 --- a/bundled/componentize_py_runtime.pyi +++ b/bundled/componentize_py_runtime.pyi @@ -1,7 +1,7 @@ from typing import Any from componentize_py_types import Result -def call_task_return(index: int, result: Any) -> None: ... +def call_task_return(index: int, borrows: int, result: Any) -> None: ... def waitable_set_drop(set: int) -> None: ... diff --git a/examples/cli/README.md b/examples/cli/README.md index 1c9f7e3..5a1e4df 100644 --- a/examples/cli/README.md +++ b/examples/cli/README.md @@ -10,7 +10,7 @@ run a Python-based component targetting the [wasi-cli] `command` world. ## Prerequisites * `Wasmtime` 38.0.0 or later -* `componentize-py` 0.19.2 +* `componentize-py` 0.19.3 Below, we use [Rust](https://rustup.rs/)'s `cargo` to install `Wasmtime`. If you don't have `cargo`, you can download and install from @@ -18,7 +18,7 @@ https://github.com/bytecodealliance/wasmtime/releases/tag/v38.0.0. ``` cargo install --version 38.0.0 wasmtime-cli -pip install componentize-py==0.19.2 +pip install componentize-py==0.19.3 ``` ## Running the demo diff --git a/examples/http-p3/README.md b/examples/http-p3/README.md index b107ff8..61c1d18 100644 --- a/examples/http-p3/README.md +++ b/examples/http-p3/README.md @@ -11,7 +11,7 @@ run a Python-based component targetting version `0.3.0-rc-2025-09-16` of the ## Prerequisites * `Wasmtime` 38.0.0 or later -* `componentize-py` 0.19.2 +* `componentize-py` 0.19.3 Below, we use [Rust](https://rustup.rs/)'s `cargo` to install `Wasmtime`. If you don't have `cargo`, you can download and install from @@ -19,7 +19,7 @@ https://github.com/bytecodealliance/wasmtime/releases/tag/v38.0.0. ``` cargo install --version 38.0.0 wasmtime-cli -pip install componentize-py==0.19.2 +pip install componentize-py==0.19.3 ``` ## Running the demo diff --git a/examples/http/README.md b/examples/http/README.md index e3fe55f..8f4a99b 100644 --- a/examples/http/README.md +++ b/examples/http/README.md @@ -10,7 +10,7 @@ run a Python-based component targetting the [wasi-http] `proxy` world. ## Prerequisites * `Wasmtime` 38.0.0 or later -* `componentize-py` 0.19.2 +* `componentize-py` 0.19.3 Below, we use [Rust](https://rustup.rs/)'s `cargo` to install `Wasmtime`. If you don't have `cargo`, you can download and install from @@ -18,7 +18,7 @@ https://github.com/bytecodealliance/wasmtime/releases/tag/v38.0.0. ``` cargo install --version 38.0.0 wasmtime-cli -pip install componentize-py==0.19.2 +pip install componentize-py==0.19.3 ``` ## Running the demo diff --git a/examples/matrix-math/README.md b/examples/matrix-math/README.md index e0b70da..31b6bbe 100644 --- a/examples/matrix-math/README.md +++ b/examples/matrix-math/README.md @@ -11,7 +11,7 @@ within a guest component. ## Prerequisites * `wasmtime` 38.0.0 or later -* `componentize-py` 0.19.2 +* `componentize-py` 0.19.3 * `NumPy`, built for WASI Note that we use an unofficial build of NumPy since the upstream project does @@ -23,7 +23,7 @@ https://github.com/bytecodealliance/wasmtime/releases/tag/v38.0.0. ``` cargo install --version 38.0.0 wasmtime-cli -pip install componentize-py==0.19.2 +pip install componentize-py==0.19.3 curl -OL https://github.com/dicej/wasi-wheels/releases/download/v0.0.2/numpy-wasi.tar.gz tar xf numpy-wasi.tar.gz ``` diff --git a/examples/sandbox/README.md b/examples/sandbox/README.md index c2b7494..cbecd2a 100644 --- a/examples/sandbox/README.md +++ b/examples/sandbox/README.md @@ -8,10 +8,10 @@ sandboxed Python code snippets from within a Python app. ## Prerequisites * `wasmtime-py` 38.0.0 or later -* `componentize-py` 0.19.2 +* `componentize-py` 0.19.3 ``` -pip install componentize-py==0.19.2 wasmtime==38.0.0 +pip install componentize-py==0.19.3 wasmtime==38.0.0 ``` ## Running the demo @@ -55,7 +55,7 @@ Traceback (most recent call last): ### Memory limit -`host.py` limits guest memory usage to 20MB. Any attempt to allocate beyond +`host.py` limits guest memory usage to 40MB. Any attempt to allocate beyond that limit will fail. ```shell-session diff --git a/examples/sandbox/host.py b/examples/sandbox/host.py index ee24fff..af689e4 100644 --- a/examples/sandbox/host.py +++ b/examples/sandbox/host.py @@ -7,7 +7,7 @@ from typing import List, Tuple TIMEOUT_SECONDS = 20 -MEMORY_LIMIT_BYTES = 20 * 1024 * 1024 +MEMORY_LIMIT_BYTES = 40 * 1024 * 1024 args = sys.argv[1:] if len(args) == 0: diff --git a/examples/tcp/README.md b/examples/tcp/README.md index 192807c..a0f6e72 100644 --- a/examples/tcp/README.md +++ b/examples/tcp/README.md @@ -11,7 +11,7 @@ making an outbound TCP request using `wasi-sockets`. ## Prerequisites * `Wasmtime` 38.0.0 or later -* `componentize-py` 0.19.2 +* `componentize-py` 0.19.3 Below, we use [Rust](https://rustup.rs/)'s `cargo` to install `Wasmtime`. If you don't have `cargo`, you can download and install from @@ -19,7 +19,7 @@ https://github.com/bytecodealliance/wasmtime/releases/tag/v38.0.0. ``` cargo install --version 38.0.0 wasmtime-cli -pip install componentize-py==0.19.2 +pip install componentize-py==0.19.3 ``` ## Running the demo diff --git a/pyproject.toml b/pyproject.toml index 22133e1..4ac8b6a 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -7,7 +7,7 @@ features = ["pyo3/extension-module"] [project] name = "componentize-py" -version = "0.19.2" +version = "0.19.3" description = "Tool to package Python applications as WebAssembly components" readme = "README.md" license = { file = "LICENSE" } diff --git a/runtime/src/lib.rs b/runtime/src/lib.rs index 9848de1..d8b2524 100644 --- a/runtime/src/lib.rs +++ b/runtime/src/lib.rs @@ -32,10 +32,8 @@ use { alloc::{self, Layout}, iter, marker::PhantomData, - mem, - ops::DerefMut, - slice, str, - sync::{Mutex, Once}, + mem, slice, str, + sync::Once, }, wit_dylib_ffi::{ self as wit, Call, ExportFunction, Interpreter, List, Type, Wit, WitOption, WitResult, @@ -84,8 +82,6 @@ struct Borrow { drop: unsafe extern "C" fn(u32), } -static BORROWS: Mutex> = Mutex::new(Vec::new()); - #[derive(Debug)] struct Case { constructor: Py, @@ -160,8 +156,7 @@ impl From for Anyhow { } } -fn release_borrows(py: Python) { - let borrows = mem::take(BORROWS.lock().unwrap().deref_mut()); +fn release_borrows(py: Python, borrows: Vec) { for Borrow { value, handle, @@ -492,7 +487,7 @@ mod async_ { #[pyo3::pyfunction] #[pyo3(pass_module)] - fn call_task_return(module: Bound, index: u32, result: Bound) { + fn call_task_return(module: Bound, index: u32, borrows: usize, result: Bound) { let py = module.py(); let index = usize::try_from(index).unwrap(); let func = WIT.get().unwrap().export_func(index); @@ -507,7 +502,9 @@ mod async_ { let mut call = MyCall::new(results); func.call_task_return(&mut call); - release_borrows(py); + if borrows != 0 { + release_borrows(py, *unsafe { Box::from_raw(borrows as *mut Vec) }); + } } #[pyo3::pyfunction] @@ -1239,6 +1236,20 @@ impl MyInterpreter { }); } + if async_ { + cx.stack.push( + if cx.borrows.is_empty() { + 0 + } else { + Box::into_raw(Box::new(mem::take(&mut cx.borrows))) as usize + } + .into_pyobject(py) + .unwrap() + .into_any() + .unbind(), + ); + } + let mut params_py = mem::take(&mut cx.stack).into_iter(); let export = &EXPORTS.get().unwrap()[func.index()]; let result = match &export.kind { @@ -1298,7 +1309,7 @@ impl MyInterpreter { cx.stack.push(result); } - release_borrows(py); + release_borrows(py, mem::take(&mut cx.borrows)); 0 } @@ -1366,6 +1377,7 @@ struct MyCall<'a> { iter_stack: Vec, deferred_deallocations: Vec<(*mut u8, Layout)>, strings: Vec, + borrows: Vec, stack: Vec>, #[cfg(feature = "async")] resources: Option>, @@ -1378,6 +1390,7 @@ impl MyCall<'_> { iter_stack: Vec::new(), deferred_deallocations: Vec::new(), strings: Vec::new(), + borrows: Vec::new(), stack, #[cfg(feature = "async")] resources: None, @@ -1899,7 +1912,7 @@ impl Call for MyCall<'_> { // imported resource type let value = imported_resource_from_canon(py, ty, handle); - BORROWS.lock().unwrap().push(Borrow { + self.borrows.push(Borrow { value: value.clone_ref(py), handle, drop: ty.drop(), diff --git a/src/summary.rs b/src/summary.rs index 66b1ba4..938fcb8 100644 --- a/src/summary.rs +++ b/src/summary.rs @@ -1286,6 +1286,12 @@ impl<'a> Summary<'a> { .collect::>() .join(", "); + let params = if params.is_empty() { + "borrows: int".to_string() + } else { + format!("{params}, borrows: int") + }; + ( "async ", if stub_runtime_calls { @@ -1298,7 +1304,7 @@ impl<'a> Summary<'a> { {class_method} def {ASYNC_START_PREFIX}{snake}({params}) -> int: - return componentize_py_async_support.first_poll({index}, {prefix}{snake}({args}))" + return componentize_py_async_support.first_poll({index}, borrows, {prefix}{snake}({args}))" ) }, ) diff --git a/src/test/python_source/streams_and_futures.py b/src/test/python_source/streams_and_futures.py index 58281cc..4de1859 100644 --- a/src/test/python_source/streams_and_futures.py +++ b/src/test/python_source/streams_and_futures.py @@ -1,8 +1,13 @@ +import tests + from tests.exports import streams_and_futures class Thing(streams_and_futures.Thing): def __init__(self, v: str): self.value = v - async def get(self) -> str: + async def get(self, delay_millis: int) -> str: + if delay_millis > 0: + await tests.sleep(delay_millis) + return self.value diff --git a/src/test/tests.rs b/src/test/tests.rs index c2f6018..93cf2c6 100644 --- a/src/test/tests.rs +++ b/src/test/tests.rs @@ -4,9 +4,10 @@ use { super::{Ctx, SEED, Tester}, anyhow::{Error, Result, anyhow}, exports::componentize_py::test::streams_and_futures, - futures::FutureExt, + futures::{FutureExt, TryStreamExt, stream::FuturesUnordered}, once_cell::sync::Lazy, std::{ + collections::BTreeMap, mem, ops::DerefMut, pin::Pin, @@ -82,6 +83,13 @@ impl TestsImports for Ctx { } } +impl TestsImportsWithStore for HasSelf { + async fn sleep(_: &Accessor, delay_millis: u32) -> Result<()> { + tokio::time::sleep(Duration::from_millis(delay_millis as _)).await; + Ok(()) + } +} + macro_rules! load_guest_code { ($($input_string:expr),*) => { &[ @@ -1222,16 +1230,37 @@ fn test_short_reads(delay: bool) -> Result<()> { assert_eq!(count, received_things.lock().unwrap().len()); - let mut received_strings = Vec::with_capacity(strings.len()); let received_things = mem::take(received_things.lock().unwrap().deref_mut()); - for &it in &received_things { - received_strings.push(thing.call_get(store, it).await?.0); + + // Dispatch the `thing.get` calls concurrently to test that + // the runtime release borrows in async-lifted exports + // correctly. + let mut futures = FuturesUnordered::new(); + for (index, &it) in received_things.iter().enumerate() { + futures.push( + thing + .call_get( + store, + it, + if delay { + u32::try_from(DELAY.as_millis()).unwrap() + } else { + 0 + }, + ) + .map(move |v| v.map(move |v| (index, v))), + ); + } + + let mut received_strings = BTreeMap::new(); + while let Some((index, (string, _))) = futures.try_next().await? { + received_strings.insert(index, string); } assert_eq!( &strings[..], &received_strings - .iter() + .values() .map(|s| s.as_str()) .collect::>() ); @@ -1381,7 +1410,7 @@ fn test_dropped_future_reader(delay: bool) -> Result<()> { let it = received.lock().unwrap().take().unwrap(); - assert_eq!(expected, &thing.call_get(store, it).await?.0); + assert_eq!(expected, &thing.call_get(store, it, 0).await?.0); anyhow::Ok(it) }) diff --git a/src/test/wit/tests.wit b/src/test/wit/tests.wit index 39b91f3..c645cfa 100644 --- a/src/test/wit/tests.wit +++ b/src/test/wit/tests.wit @@ -154,7 +154,7 @@ interface streams-and-futures { resource thing { constructor(s: string); - get: async func() -> string; + get: async func(delay-millis: u32) -> string; } echo-stream-u8: async func(s: stream) -> stream; @@ -224,4 +224,6 @@ world tests { import output: func(frame: frame); import get-bytes: func(count: u32) -> list; + + import sleep: async func(delay-millis: u32); } diff --git a/tests/componentize.rs b/tests/componentize.rs index 675e143..66d03b7 100644 --- a/tests/componentize.rs +++ b/tests/componentize.rs @@ -204,7 +204,7 @@ fn sandbox_example() -> anyhow::Result<()> { Command::new(venv_path(&path).join("pip")) .current_dir(&path) - .args(["install", "wasmtime"]) + .args(["install", "wasmtime==38.0.0"]) .assert() .success();