diff --git a/.github/actions/spin-ci-dependencies/action.yml b/.github/actions/spin-ci-dependencies/action.yml index 3d35d371b..82253bdb1 100644 --- a/.github/actions/spin-ci-dependencies/action.yml +++ b/.github/actions/spin-ci-dependencies/action.yml @@ -8,7 +8,7 @@ inputs: type: bool rust-version: description: 'Rust version to setup' - default: '1.86' + default: '1.87' required: false type: string diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index a7370bd1b..1dfba9dbc 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -17,7 +17,7 @@ concurrency: env: CARGO_TERM_COLOR: always - RUST_VERSION: 1.86 + RUST_VERSION: 1.87 jobs: dependency-review: diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 6c1fd21a7..0a88b94ad 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -11,7 +11,7 @@ on: concurrency: ${{ github.workflow }}-${{ github.ref }} env: - RUST_VERSION: 1.86 + RUST_VERSION: 1.87 jobs: build-and-sign: diff --git a/Cargo.lock b/Cargo.lock index 07c1e4317..1de7627fd 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1887,36 +1887,32 @@ dependencies = [ [[package]] name = "cranelift-assembler-x64" -version = "0.123.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0920ef6863433fa28ece7e53925be4cd39a913adba2dc3738f4edd182f76d168" +version = "0.124.0" +source = "git+https://github.com/bytecodealliance/wasmtime?branch=release-37.0.0#cda17438e06e49a037a24800a9ec0034d708b5b7" dependencies = [ "cranelift-assembler-x64-meta", ] [[package]] name = "cranelift-assembler-x64-meta" -version = "0.123.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8990a217e2529a378af1daf4f8afa889f928f07ebbde6ae2f058ae60e40e2c20" +version = "0.124.0" +source = "git+https://github.com/bytecodealliance/wasmtime?branch=release-37.0.0#cda17438e06e49a037a24800a9ec0034d708b5b7" dependencies = [ "cranelift-srcgen", ] [[package]] name = "cranelift-bforest" -version = "0.123.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62225596b687f69a42c038485a28369badc186cb7c74bd9436eeec9f539011b1" +version = "0.124.0" +source = "git+https://github.com/bytecodealliance/wasmtime?branch=release-37.0.0#cda17438e06e49a037a24800a9ec0034d708b5b7" dependencies = [ "cranelift-entity", ] [[package]] name = "cranelift-bitset" -version = "0.123.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c23914fc4062558650a6f0d8c1846c97b541215a291fdeabc85f68bdc9bbcca3" +version = "0.124.0" +source = "git+https://github.com/bytecodealliance/wasmtime?branch=release-37.0.0#cda17438e06e49a037a24800a9ec0034d708b5b7" dependencies = [ "serde", "serde_derive", @@ -1924,9 +1920,8 @@ dependencies = [ [[package]] name = "cranelift-codegen" -version = "0.123.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "41a238b2f7e7ec077eb170145fa15fd8b3d0f36cc83d8e354e29ca550f339ca7" +version = "0.124.0" +source = "git+https://github.com/bytecodealliance/wasmtime?branch=release-37.0.0#cda17438e06e49a037a24800a9ec0034d708b5b7" dependencies = [ "bumpalo", "cranelift-assembler-x64", @@ -1951,9 +1946,8 @@ dependencies = [ [[package]] name = "cranelift-codegen-meta" -version = "0.123.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9315ddcc2512513a9d66455ec89bb70ae5498cb472f5ed990230536f4cd5c011" +version = "0.124.0" +source = "git+https://github.com/bytecodealliance/wasmtime?branch=release-37.0.0#cda17438e06e49a037a24800a9ec0034d708b5b7" dependencies = [ "cranelift-assembler-x64-meta", "cranelift-codegen-shared", @@ -1964,24 +1958,21 @@ dependencies = [ [[package]] name = "cranelift-codegen-shared" -version = "0.123.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dc6acea40ef860f28cb36eaad479e26556c1e538b0a66fc44598cf1b1689393d" +version = "0.124.0" +source = "git+https://github.com/bytecodealliance/wasmtime?branch=release-37.0.0#cda17438e06e49a037a24800a9ec0034d708b5b7" [[package]] name = "cranelift-control" -version = "0.123.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6b2af895da90761cfda4a4445960554fcec971e637882eda5a87337d993fe1b9" +version = "0.124.0" +source = "git+https://github.com/bytecodealliance/wasmtime?branch=release-37.0.0#cda17438e06e49a037a24800a9ec0034d708b5b7" dependencies = [ "arbitrary", ] [[package]] name = "cranelift-entity" -version = "0.123.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6e8c542c856feb50d504e4fc0526b3db3a514f882a9f68f956164531517828ab" +version = "0.124.0" +source = "git+https://github.com/bytecodealliance/wasmtime?branch=release-37.0.0#cda17438e06e49a037a24800a9ec0034d708b5b7" dependencies = [ "cranelift-bitset", "serde", @@ -1990,9 +1981,8 @@ dependencies = [ [[package]] name = "cranelift-frontend" -version = "0.123.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9996dd9c20929c03360fe0c4edf3594c0cbb94525bdbfa04b6bb639ec14573c7" +version = "0.124.0" +source = "git+https://github.com/bytecodealliance/wasmtime?branch=release-37.0.0#cda17438e06e49a037a24800a9ec0034d708b5b7" dependencies = [ "cranelift-codegen", "log", @@ -2002,15 +1992,13 @@ dependencies = [ [[package]] name = "cranelift-isle" -version = "0.123.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "928b8dccad51b9e0ffe54accbd617da900239439b13d48f0f122ab61105ca6ad" +version = "0.124.0" +source = "git+https://github.com/bytecodealliance/wasmtime?branch=release-37.0.0#cda17438e06e49a037a24800a9ec0034d708b5b7" [[package]] name = "cranelift-native" -version = "0.123.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f75ef0a6a2efed3a2a14812318e28dc82c214eab5399c13d70878e2f88947b5" +version = "0.124.0" +source = "git+https://github.com/bytecodealliance/wasmtime?branch=release-37.0.0#cda17438e06e49a037a24800a9ec0034d708b5b7" dependencies = [ "cranelift-codegen", "libc", @@ -2019,9 +2007,8 @@ dependencies = [ [[package]] name = "cranelift-srcgen" -version = "0.123.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "673bd6d1c83cb41d60afb140a1474ef6caf1a3e02f3820fc522aefbc93ac67d6" +version = "0.124.0" +source = "git+https://github.com/bytecodealliance/wasmtime?branch=release-37.0.0#cda17438e06e49a037a24800a9ec0034d708b5b7" [[package]] name = "crc32fast" @@ -4837,7 +4824,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4979f22fdb869068da03c9f7528f8297c6fd2606bc3a4affe42e6a823fdb8da4" dependencies = [ "cfg-if", - "windows-targets 0.52.6", + "windows-targets 0.48.5", ] [[package]] @@ -6586,7 +6573,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "22505a5c94da8e3b7c2996394d1c933236c4d743e81a410bcca4e6989fc066a4" dependencies = [ "bytes", - "heck 0.5.0", + "heck 0.4.1", "itertools 0.12.1", "log", "multimap", @@ -6712,9 +6699,8 @@ dependencies = [ [[package]] name = "pulley-interpreter" -version = "36.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e4e2d31146038fd9e62bfa331db057aca325d5ca10451a9fe341356cead7da53" +version = "37.0.0" +source = "git+https://github.com/bytecodealliance/wasmtime?branch=release-37.0.0#cda17438e06e49a037a24800a9ec0034d708b5b7" dependencies = [ "cranelift-bitset", "log", @@ -6724,9 +6710,8 @@ dependencies = [ [[package]] name = "pulley-macros" -version = "36.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "efb9fdafaca625f9ea8cfa793364ea1bdd32d306cff18f166b00ddaa61ecbb27" +version = "37.0.0" +source = "git+https://github.com/bytecodealliance/wasmtime?branch=release-37.0.0#cda17438e06e49a037a24800a9ec0034d708b5b7" dependencies = [ "proc-macro2", "quote", @@ -7072,9 +7057,9 @@ dependencies = [ [[package]] name = "regalloc2" -version = "0.12.2" +version = "0.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5216b1837de2149f8bc8e6d5f88a9326b63b8c836ed58ce4a0a29ec736a59734" +checksum = "68e18e1ef763167dc6718c28a5585e62f907590a21028b8e87be1318f19ef1cb" dependencies = [ "allocator-api2", "bumpalo", @@ -8337,14 +8322,14 @@ dependencies = [ "tokio", "toml", "tracing", - "wasm-encoder 0.236.1", - "wasm-metadata 0.236.1", - "wasmparser 0.236.1", + "wasm-encoder 0.239.0", + "wasm-metadata 0.239.0", + "wasmparser 0.239.0", "wasmtime", "wasmtime-wasi", "wat", - "wit-component 0.236.1", - "wit-parser 0.236.1", + "wit-component 0.239.0", + "wit-parser 0.239.0", ] [[package]] @@ -8431,10 +8416,10 @@ dependencies = [ "wac-graph", "wac-types", "wasm-pkg-client", - "wasmparser 0.236.1", - "wit-component 0.236.1", + "wasmparser 0.239.0", + "wit-component 0.239.0", "wit-encoder", - "wit-parser 0.236.1", + "wit-parser 0.239.0", ] [[package]] @@ -8928,11 +8913,11 @@ dependencies = [ "tokio-util", "tracing", "walkdir", - "wasm-encoder 0.236.1", - "wasmparser 0.236.1", + "wasm-encoder 0.239.0", + "wasmparser 0.239.0", "wat", - "wit-component 0.236.1", - "wit-parser 0.236.1", + "wit-component 0.239.0", + "wit-parser 0.239.0", ] [[package]] @@ -9637,7 +9622,7 @@ name = "test-components" version = "0.1.0" dependencies = [ "cargo_toml", - "wit-component 0.236.1", + "wit-component 0.239.0", ] [[package]] @@ -10845,12 +10830,12 @@ dependencies = [ [[package]] name = "wasm-encoder" -version = "0.236.1" +version = "0.239.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "724fccfd4f3c24b7e589d333fc0429c68042897a7e8a5f8694f31792471841e7" +checksum = "5be00faa2b4950c76fe618c409d2c3ea5a3c9422013e079482d78544bb2d184c" dependencies = [ "leb128fmt", - "wasmparser 0.236.1", + "wasmparser 0.239.0", ] [[package]] @@ -10891,9 +10876,9 @@ dependencies = [ [[package]] name = "wasm-metadata" -version = "0.236.1" +version = "0.239.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c909f94a49a8de3365f3c0344f064818f1e369ff1740c5b04f455f85d454768e" +checksum = "20b3ec880a9ac69ccd92fbdbcf46ee833071cf09f82bb005b2327c7ae6025ae2" dependencies = [ "anyhow", "auditable-serde", @@ -10904,8 +10889,8 @@ dependencies = [ "serde_json", "spdx", "url", - "wasm-encoder 0.236.1", - "wasmparser 0.236.1", + "wasm-encoder 0.239.0", + "wasmparser 0.239.0", ] [[package]] @@ -11014,9 +10999,9 @@ dependencies = [ [[package]] name = "wasmparser" -version = "0.236.1" +version = "0.239.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a9b1e81f3eb254cf7404a82cee6926a4a3ccc5aad80cc3d43608a070c67aa1d7" +checksum = "8c9d90bb93e764f6beabf1d02028c70a2156a6583e63ac4218dd07ef733368b0" dependencies = [ "bitflags 2.6.0", "hashbrown 0.15.2", @@ -11037,20 +11022,19 @@ dependencies = [ [[package]] name = "wasmprinter" -version = "0.236.1" +version = "0.239.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2df225df06a6df15b46e3f73ca066ff92c2e023670969f7d50ce7d5e695abbb1" +checksum = "b3981f3d51f39f24f5fc90f93049a90f08dbbca8deba602cd46bb8ca67a94718" dependencies = [ "anyhow", "termcolor", - "wasmparser 0.236.1", + "wasmparser 0.239.0", ] [[package]] name = "wasmtime" -version = "36.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b3e1fab634681494213138ea3a18e958e5ea99da13a4a01a4b870d51a41680b" +version = "37.0.0" +source = "git+https://github.com/bytecodealliance/wasmtime?branch=release-37.0.0#cda17438e06e49a037a24800a9ec0034d708b5b7" dependencies = [ "addr2line 0.25.0", "anyhow", @@ -11081,8 +11065,8 @@ dependencies = [ "serde_json", "smallvec", "target-lexicon", - "wasm-encoder 0.236.1", - "wasmparser 0.236.1", + "wasm-encoder 0.239.0", + "wasmparser 0.239.0", "wasmtime-environ", "wasmtime-internal-asm-macros", "wasmtime-internal-cache", @@ -11103,9 +11087,8 @@ dependencies = [ [[package]] name = "wasmtime-environ" -version = "36.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6750e519977953a018fe994aada7e02510aea4babb03310aa5f5b4145b6e6577" +version = "37.0.0" +source = "git+https://github.com/bytecodealliance/wasmtime?branch=release-37.0.0#cda17438e06e49a037a24800a9ec0034d708b5b7" dependencies = [ "anyhow", "cpp_demangle", @@ -11122,26 +11105,24 @@ dependencies = [ "serde_derive", "smallvec", "target-lexicon", - "wasm-encoder 0.236.1", - "wasmparser 0.236.1", - "wasmprinter 0.236.1", + "wasm-encoder 0.239.0", + "wasmparser 0.239.0", + "wasmprinter 0.239.0", "wasmtime-internal-component-util", ] [[package]] name = "wasmtime-internal-asm-macros" -version = "36.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bdbf38adac6e81d5c0326e8fd25f80450e3038f2fc103afd3c5cc8b83d5dd78b" +version = "37.0.0" +source = "git+https://github.com/bytecodealliance/wasmtime?branch=release-37.0.0#cda17438e06e49a037a24800a9ec0034d708b5b7" dependencies = [ "cfg-if", ] [[package]] name = "wasmtime-internal-cache" -version = "36.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c0c9085d8c04cc294612d743e2f355382b39250de4bd20bf4b0b0b7c0ae7067a" +version = "37.0.0" +source = "git+https://github.com/bytecodealliance/wasmtime?branch=release-37.0.0#cda17438e06e49a037a24800a9ec0034d708b5b7" dependencies = [ "anyhow", "base64 0.22.1", @@ -11159,9 +11140,8 @@ dependencies = [ [[package]] name = "wasmtime-internal-component-macro" -version = "36.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26a578a474e3b7ddce063cd169ced292b5185013341457522891b10e989aa42a" +version = "37.0.0" +source = "git+https://github.com/bytecodealliance/wasmtime?branch=release-37.0.0#cda17438e06e49a037a24800a9ec0034d708b5b7" dependencies = [ "anyhow", "proc-macro2", @@ -11169,20 +11149,18 @@ dependencies = [ "syn 2.0.87", "wasmtime-internal-component-util", "wasmtime-internal-wit-bindgen", - "wit-parser 0.236.1", + "wit-parser 0.239.0", ] [[package]] name = "wasmtime-internal-component-util" -version = "36.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "edc23d46ec1b1cd42b6f73205eb80498ed94b47098ec53456c0b18299405b158" +version = "37.0.0" +source = "git+https://github.com/bytecodealliance/wasmtime?branch=release-37.0.0#cda17438e06e49a037a24800a9ec0034d708b5b7" [[package]] name = "wasmtime-internal-cranelift" -version = "36.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d85b8ba128525bff91b89ac8a97755136a4fb0fb59df5ffb7539dd646455d441" +version = "37.0.0" +source = "git+https://github.com/bytecodealliance/wasmtime?branch=release-37.0.0#cda17438e06e49a037a24800a9ec0034d708b5b7" dependencies = [ "anyhow", "cfg-if", @@ -11199,17 +11177,17 @@ dependencies = [ "smallvec", "target-lexicon", "thiserror 2.0.12", - "wasmparser 0.236.1", + "wasmparser 0.239.0", "wasmtime-environ", "wasmtime-internal-math", + "wasmtime-internal-unwinder", "wasmtime-internal-versioned-export-macros", ] [[package]] name = "wasmtime-internal-fiber" -version = "36.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c566f5137de1f55339df8a236a5ec89698b466a3d33f9cc07823a58a3f85e16" +version = "37.0.0" +source = "git+https://github.com/bytecodealliance/wasmtime?branch=release-37.0.0#cda17438e06e49a037a24800a9ec0034d708b5b7" dependencies = [ "anyhow", "cc", @@ -11223,9 +11201,8 @@ dependencies = [ [[package]] name = "wasmtime-internal-jit-debug" -version = "36.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e03f0b11f8fe4d456feac11e7e9dc6f02ddb34d4f6a1912775dbc63c5bdd5670" +version = "37.0.0" +source = "git+https://github.com/bytecodealliance/wasmtime?branch=release-37.0.0#cda17438e06e49a037a24800a9ec0034d708b5b7" dependencies = [ "cc", "object 0.37.3", @@ -11235,9 +11212,8 @@ dependencies = [ [[package]] name = "wasmtime-internal-jit-icache-coherence" -version = "36.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "71aeb74f9b3fd9225319c723e59832a77a674b0c899ba9795f9b2130a6d1b167" +version = "37.0.0" +source = "git+https://github.com/bytecodealliance/wasmtime?branch=release-37.0.0#cda17438e06e49a037a24800a9ec0034d708b5b7" dependencies = [ "anyhow", "cfg-if", @@ -11247,24 +11223,21 @@ dependencies = [ [[package]] name = "wasmtime-internal-math" -version = "36.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "31d5dad8a609c6cc47a5f265f13b52e347e893450a69641af082b8a276043fa7" +version = "37.0.0" +source = "git+https://github.com/bytecodealliance/wasmtime?branch=release-37.0.0#cda17438e06e49a037a24800a9ec0034d708b5b7" dependencies = [ "libm", ] [[package]] name = "wasmtime-internal-slab" -version = "36.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6d152a7b875d62e395bfe0ae7d12e7b47cd332eb380353cce3eb831f9843731d" +version = "37.0.0" +source = "git+https://github.com/bytecodealliance/wasmtime?branch=release-37.0.0#cda17438e06e49a037a24800a9ec0034d708b5b7" [[package]] name = "wasmtime-internal-unwinder" -version = "36.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2aaacc0fea00293f7af7e6c25cef74b7d213ebbe7560c86305eec15fc318fab8" +version = "37.0.0" +source = "git+https://github.com/bytecodealliance/wasmtime?branch=release-37.0.0#cda17438e06e49a037a24800a9ec0034d708b5b7" dependencies = [ "anyhow", "cfg-if", @@ -11275,9 +11248,8 @@ dependencies = [ [[package]] name = "wasmtime-internal-versioned-export-macros" -version = "36.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c61c7f75326434944cc5f3b75409a063fa37e537f6247f00f0f733679f0be406" +version = "37.0.0" +source = "git+https://github.com/bytecodealliance/wasmtime?branch=release-37.0.0#cda17438e06e49a037a24800a9ec0034d708b5b7" dependencies = [ "proc-macro2", "quote", @@ -11286,16 +11258,16 @@ dependencies = [ [[package]] name = "wasmtime-internal-winch" -version = "36.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6cfbaa87e1ac4972bb096c9cb1800fedc113e36332cc4bc2c96a2ef1d7c5e750" +version = "37.0.0" +source = "git+https://github.com/bytecodealliance/wasmtime?branch=release-37.0.0#cda17438e06e49a037a24800a9ec0034d708b5b7" dependencies = [ "anyhow", "cranelift-codegen", "gimli 0.32.0", + "log", "object 0.37.3", "target-lexicon", - "wasmparser 0.236.1", + "wasmparser 0.239.0", "wasmtime-environ", "wasmtime-internal-cranelift", "winch-codegen", @@ -11303,22 +11275,20 @@ dependencies = [ [[package]] name = "wasmtime-internal-wit-bindgen" -version = "36.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "169042d58002f16da149ab7d608b71164411abd1fc5140f48f4c200b44bb5565" +version = "37.0.0" +source = "git+https://github.com/bytecodealliance/wasmtime?branch=release-37.0.0#cda17438e06e49a037a24800a9ec0034d708b5b7" dependencies = [ "anyhow", "bitflags 2.6.0", "heck 0.5.0", "indexmap 2.7.1", - "wit-parser 0.236.1", + "wit-parser 0.239.0", ] [[package]] name = "wasmtime-wasi" -version = "36.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b9049a5fedcd24fa0f665ba7c17c4445c1a547536a9560d960e15bee2d8428d0" +version = "37.0.0" +source = "git+https://github.com/bytecodealliance/wasmtime?branch=release-37.0.0#cda17438e06e49a037a24800a9ec0034d708b5b7" dependencies = [ "anyhow", "async-trait", @@ -11347,9 +11317,8 @@ dependencies = [ [[package]] name = "wasmtime-wasi-http" -version = "36.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c1eea0b00539f0a3defce68bddb746736debea787e2f3a67cb562df977eb65a7" +version = "37.0.0" +source = "git+https://github.com/bytecodealliance/wasmtime?branch=release-37.0.0#cda17438e06e49a037a24800a9ec0034d708b5b7" dependencies = [ "anyhow", "async-trait", @@ -11371,9 +11340,8 @@ dependencies = [ [[package]] name = "wasmtime-wasi-io" -version = "36.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d62156d8695d80df8e85baeb56379b3ba6b6bf5996671594724c24d40b67825f" +version = "37.0.0" +source = "git+https://github.com/bytecodealliance/wasmtime?branch=release-37.0.0#cda17438e06e49a037a24800a9ec0034d708b5b7" dependencies = [ "anyhow", "async-trait", @@ -11393,24 +11361,24 @@ dependencies = [ [[package]] name = "wast" -version = "236.0.1" +version = "239.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d3bec4b4db9c6808d394632fd4b0cd4654c32c540bd3237f55ee6a40fff6e51f" +checksum = "9139176fe8a2590e0fb174cdcaf373b224cb93c3dde08e4297c1361d2ba1ea5d" dependencies = [ "bumpalo", "leb128fmt", "memchr", "unicode-width 0.2.0", - "wasm-encoder 0.236.1", + "wasm-encoder 0.239.0", ] [[package]] name = "wat" -version = "1.236.1" +version = "1.239.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "64475e2f77d6071ce90624098fc236285ddafa8c3ea1fb386f2c4154b6c2bbdb" +checksum = "3e1c941927d34709f255558166f8901a2005f8ab4a9650432e9281b7cc6f3b75" dependencies = [ - "wast 236.0.1", + "wast 239.0.0", ] [[package]] @@ -11548,9 +11516,8 @@ dependencies = [ [[package]] name = "wiggle" -version = "36.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e233166bc0ef02371ebe2c630aba51dd3f015bcaf616d32b4171efab84d09137" +version = "37.0.0" +source = "git+https://github.com/bytecodealliance/wasmtime?branch=release-37.0.0#cda17438e06e49a037a24800a9ec0034d708b5b7" dependencies = [ "anyhow", "async-trait", @@ -11563,9 +11530,8 @@ dependencies = [ [[package]] name = "wiggle-generate" -version = "36.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "93048543902e61c65b75d8a9ea0e78d5a8723e5db6e11ff93870165807c4463d" +version = "37.0.0" +source = "git+https://github.com/bytecodealliance/wasmtime?branch=release-37.0.0#cda17438e06e49a037a24800a9ec0034d708b5b7" dependencies = [ "anyhow", "heck 0.5.0", @@ -11577,9 +11543,8 @@ dependencies = [ [[package]] name = "wiggle-macro" -version = "36.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fd7e511edbcaa045079dea564486c4ff7946ae491002227c41d74ea62a59d329" +version = "37.0.0" +source = "git+https://github.com/bytecodealliance/wasmtime?branch=release-37.0.0#cda17438e06e49a037a24800a9ec0034d708b5b7" dependencies = [ "proc-macro2", "quote", @@ -11609,7 +11574,7 @@ version = "0.1.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cf221c93e13a30d793f7645a0e7762c55d169dbb0a49671918a2319d289b10bb" dependencies = [ - "windows-sys 0.59.0", + "windows-sys 0.48.0", ] [[package]] @@ -11620,9 +11585,8 @@ checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" [[package]] name = "winch-codegen" -version = "36.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6e615fe205d7d4c9aa62217862f2e0969d00b9b0843af0b1b8181adaea3cfef3" +version = "37.0.0" +source = "git+https://github.com/bytecodealliance/wasmtime?branch=release-37.0.0#cda17438e06e49a037a24800a9ec0034d708b5b7" dependencies = [ "anyhow", "cranelift-assembler-x64", @@ -11632,7 +11596,7 @@ dependencies = [ "smallvec", "target-lexicon", "thiserror 2.0.12", - "wasmparser 0.236.1", + "wasmparser 0.239.0", "wasmtime-environ", "wasmtime-internal-cranelift", "wasmtime-internal-math", @@ -12175,9 +12139,9 @@ dependencies = [ [[package]] name = "wit-component" -version = "0.236.1" +version = "0.239.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3622959ed7ed6341c38e5aa35af243632534b0a36226852faa802939ce11e00f" +checksum = "88a866b19dba2c94d706ec58c92a4c62ab63e482b4c935d2a085ac94caecb136" dependencies = [ "anyhow", "bitflags 2.6.0", @@ -12186,11 +12150,11 @@ dependencies = [ "serde", "serde_derive", "serde_json", - "wasm-encoder 0.236.1", - "wasm-metadata 0.236.1", - "wasmparser 0.236.1", + "wasm-encoder 0.239.0", + "wasm-metadata 0.239.0", + "wasmparser 0.239.0", "wat", - "wit-parser 0.236.1", + "wit-parser 0.239.0", ] [[package]] @@ -12244,9 +12208,9 @@ dependencies = [ [[package]] name = "wit-parser" -version = "0.236.1" +version = "0.239.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "16e4833a20cd6e85d6abfea0e63a399472d6f88c6262957c17f546879a80ba15" +checksum = "55c92c939d667b7bf0c6bf2d1f67196529758f99a2a45a3355cc56964fd5315d" dependencies = [ "anyhow", "id-arena", @@ -12257,7 +12221,7 @@ dependencies = [ "serde_derive", "serde_json", "unicode-xid", - "wasmparser 0.236.1", + "wasmparser 0.239.0", ] [[package]] diff --git a/Cargo.toml b/Cargo.toml index 0b43d5971..b0aa55271 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -170,16 +170,16 @@ tower-service = "0.3.3" tracing = { version = "0.1.41", features = ["log"] } url = "2" walkdir = "2" -wasm-encoder = "0.236.1" -wasm-metadata = "0.236.1" +wasm-encoder = "0.239.0" +wasm-metadata = "0.239.0" wasm-pkg-client = "0.11" wasm-pkg-common = "0.11" -wasmparser = "0.236.1" -wasmtime = "36.0.2" -wasmtime-wasi = "36.0.2" -wasmtime-wasi-http = "36.0.2" -wit-component = "0.236.1" -wit-parser = "0.236.1" +wasmparser = "0.239.0" +wasmtime = { git = "https://github.com/bytecodealliance/wasmtime", branch = "release-37.0.0" } +wasmtime-wasi = { git = "https://github.com/bytecodealliance/wasmtime", branch = "release-37.0.0" } +wasmtime-wasi-http = { git = "https://github.com/bytecodealliance/wasmtime", branch = "release-37.0.0" } +wit-component = "0.239.0" +wit-parser = "0.239.0" spin-componentize = { path = "crates/componentize" } diff --git a/crates/core/tests/integration_test.rs b/crates/core/tests/integration_test.rs index 7d2c1aca3..b05fd2315 100644 --- a/crates/core/tests/integration_test.rs +++ b/crates/core/tests/integration_test.rs @@ -9,7 +9,7 @@ use spin_core::{AsState, Component, Config, Engine, State, Store, StoreBuilder, use spin_factor_wasi::{DummyFilesMounter, WasiFactor}; use spin_factors::{App, AsInstanceState, RuntimeFactors}; use spin_locked_app::locked::LockedApp; -use tokio::{fs, io::AsyncWrite}; +use tokio::fs; use wasmtime_wasi::I32Exit; #[tokio::test(flavor = "multi_thread")] @@ -169,44 +169,3 @@ async fn run_test( .0 .map_err(|()| anyhow::anyhow!("command failed")) } - -// Write with `print!`, required for test output capture -struct TestWriter(tokio::io::Stdout); - -impl std::io::Write for TestWriter { - fn write(&mut self, buf: &[u8]) -> std::io::Result { - print!("{}", String::from_utf8_lossy(buf)); - Ok(buf.len()) - } - - fn flush(&mut self) -> std::io::Result<()> { - Ok(()) - } -} - -impl AsyncWrite for TestWriter { - fn poll_write( - self: std::pin::Pin<&mut Self>, - cx: &mut std::task::Context<'_>, - buf: &[u8], - ) -> std::task::Poll> { - let this = self.get_mut(); - std::pin::Pin::new(&mut this.0).poll_write(cx, buf) - } - - fn poll_flush( - self: std::pin::Pin<&mut Self>, - cx: &mut std::task::Context<'_>, - ) -> std::task::Poll> { - let this = self.get_mut(); - std::pin::Pin::new(&mut this.0).poll_flush(cx) - } - - fn poll_shutdown( - self: std::pin::Pin<&mut Self>, - cx: &mut std::task::Context<'_>, - ) -> std::task::Poll> { - let this = self.get_mut(); - std::pin::Pin::new(&mut this.0).poll_shutdown(cx) - } -} diff --git a/crates/environments/src/environment.rs b/crates/environments/src/environment.rs index 0b1bf21ac..2ba48683a 100644 --- a/crates/environments/src/environment.rs +++ b/crates/environments/src/environment.rs @@ -459,7 +459,7 @@ mod test { let mut resolve = wit_parser::Resolve::default(); let package_id = resolve.push_str("test", wit).expect("should parse WIT"); let world_id = resolve - .select_world(package_id, Some(world)) + .select_world(&[package_id], Some(world)) .expect("should select world"); let mut wasm = wit_component::dummy_module( diff --git a/crates/factor-outbound-networking/tests/factor_test.rs b/crates/factor-outbound-networking/tests/factor_test.rs index 7c7120599..4918d70ff 100644 --- a/crates/factor-outbound-networking/tests/factor_test.rs +++ b/crates/factor-outbound-networking/tests/factor_test.rs @@ -5,7 +5,7 @@ use spin_factor_wasi::{DummyFilesMounter, WasiFactor}; use spin_factors::{anyhow, RuntimeFactors}; use spin_factors_test::{toml, TestEnvironment}; use wasmtime_wasi::p2::bindings::sockets::instance_network::Host; -use wasmtime_wasi::SocketAddrUse; +use wasmtime_wasi::sockets::SocketAddrUse; #[derive(RuntimeFactors)] struct TestFactors { @@ -35,10 +35,10 @@ async fn configures_wasi_socket_addr_check() -> anyhow::Result<()> { ..Default::default() })?; let mut state = env.build_instance_state().await?; - let mut wasi = WasiFactor::get_wasi_impl(&mut state).unwrap(); + let mut sockets = WasiFactor::get_sockets_impl(&mut state).unwrap(); - let network_resource = wasi.instance_network()?; - let network = wasi.table.get(&network_resource)?; + let network_resource = sockets.instance_network()?; + let network = sockets.table.get(&network_resource)?; network .check_socket_addr( diff --git a/crates/factor-wasi/src/lib.rs b/crates/factor-wasi/src/lib.rs index e4a5c3e62..316111286 100644 --- a/crates/factor-wasi/src/lib.rs +++ b/crates/factor-wasi/src/lib.rs @@ -16,11 +16,14 @@ use spin_factors::{ RuntimeFactors, RuntimeFactorsInstanceState, }; use wasmtime::component::HasData; -use wasmtime_wasi::cli::{StdinStream, StdoutStream}; +use wasmtime_wasi::cli::{StdinStream, StdoutStream, WasiCliCtxView}; +use wasmtime_wasi::clocks::WasiClocksCtxView; +use wasmtime_wasi::filesystem::WasiFilesystemCtxView; use wasmtime_wasi::random::WasiRandomCtx; +use wasmtime_wasi::sockets::WasiSocketsCtxView; use wasmtime_wasi::{DirPerms, FilePerms, ResourceTable, WasiCtx, WasiCtxBuilder, WasiCtxView}; -pub use wasmtime_wasi::SocketAddrUse; +pub use wasmtime_wasi::sockets::SocketAddrUse; pub struct WasiFactor { files_mounter: Box, @@ -42,6 +45,26 @@ impl WasiFactor { table, }) } + + pub fn get_cli_impl( + runtime_instance_state: &mut impl RuntimeFactorsInstanceState, + ) -> Option> { + let (state, table) = runtime_instance_state.get_with_table::()?; + Some(WasiCliCtxView { + ctx: state.ctx.cli(), + table, + }) + } + + pub fn get_sockets_impl( + runtime_instance_state: &mut impl RuntimeFactorsInstanceState, + ) -> Option> { + let (state, table) = runtime_instance_state.get_with_table::()?; + Some(WasiSocketsCtxView { + ctx: state.ctx.sockets(), + table, + }) + } } /// Helper trait to extend `InitContext` with some more `link_*_bindings` @@ -54,46 +77,116 @@ trait InitContextExt: InitContext { table } - fn link_io_bindings( + fn get_clocks(data: &mut Self::StoreData) -> WasiClocksCtxView<'_> { + let (state, table) = Self::get_data_with_table(data); + WasiClocksCtxView { + ctx: state.ctx.clocks(), + table, + } + } + + fn link_clocks_bindings( &mut self, add_to_linker: fn( &mut wasmtime::component::Linker, - fn(&mut Self::StoreData) -> &mut ResourceTable, + fn(&mut Self::StoreData) -> WasiClocksCtxView<'_>, ) -> anyhow::Result<()>, ) -> anyhow::Result<()> { - add_to_linker(self.linker(), Self::get_table) + add_to_linker(self.linker(), Self::get_clocks) } - fn get_wasi(data: &mut Self::StoreData) -> WasiCtxView<'_> { + fn get_cli(data: &mut Self::StoreData) -> WasiCliCtxView<'_> { let (state, table) = Self::get_data_with_table(data); - WasiCtxView { - ctx: &mut state.ctx, + WasiCliCtxView { + ctx: state.ctx.cli(), table, } } - fn link_wasi_bindings( + fn link_cli_bindings( &mut self, add_to_linker: fn( &mut wasmtime::component::Linker, - fn(&mut Self::StoreData) -> WasiCtxView<'_>, + fn(&mut Self::StoreData) -> WasiCliCtxView<'_>, ) -> anyhow::Result<()>, ) -> anyhow::Result<()> { - add_to_linker(self.linker(), Self::get_wasi) + add_to_linker(self.linker(), Self::get_cli) } - fn link_wasi_default_bindings( + fn link_cli_default_bindings( &mut self, add_to_linker: fn( &mut wasmtime::component::Linker, &O, - fn(&mut Self::StoreData) -> WasiCtxView<'_>, + fn(&mut Self::StoreData) -> WasiCliCtxView<'_>, ) -> anyhow::Result<()>, - ) -> anyhow::Result<()> - where - O: Default, - { - add_to_linker(self.linker(), &O::default(), Self::get_wasi) + ) -> anyhow::Result<()> { + add_to_linker(self.linker(), &O::default(), Self::get_cli) + } + + fn get_filesystem(data: &mut Self::StoreData) -> WasiFilesystemCtxView<'_> { + let (state, table) = Self::get_data_with_table(data); + WasiFilesystemCtxView { + ctx: state.ctx.filesystem(), + table, + } + } + + fn link_filesystem_bindings( + &mut self, + add_to_linker: fn( + &mut wasmtime::component::Linker, + fn(&mut Self::StoreData) -> WasiFilesystemCtxView<'_>, + ) -> anyhow::Result<()>, + ) -> anyhow::Result<()> { + add_to_linker(self.linker(), Self::get_filesystem) + } + + fn get_sockets(data: &mut Self::StoreData) -> WasiSocketsCtxView<'_> { + let (state, table) = Self::get_data_with_table(data); + WasiSocketsCtxView { + ctx: state.ctx.sockets(), + table, + } + } + + fn link_sockets_bindings( + &mut self, + add_to_linker: fn( + &mut wasmtime::component::Linker, + fn(&mut Self::StoreData) -> WasiSocketsCtxView<'_>, + ) -> anyhow::Result<()>, + ) -> anyhow::Result<()> { + add_to_linker(self.linker(), Self::get_sockets) + } + + fn link_sockets_default_bindings( + &mut self, + add_to_linker: fn( + &mut wasmtime::component::Linker, + &O, + fn(&mut Self::StoreData) -> WasiSocketsCtxView<'_>, + ) -> anyhow::Result<()>, + ) -> anyhow::Result<()> { + add_to_linker(self.linker(), &O::default(), Self::get_sockets) + } + + fn link_io_bindings( + &mut self, + add_to_linker: fn( + &mut wasmtime::component::Linker, + fn(&mut Self::StoreData) -> &mut ResourceTable, + ) -> anyhow::Result<()>, + ) -> anyhow::Result<()> { + add_to_linker(self.linker(), Self::get_table) + } + + fn get_wasi(data: &mut Self::StoreData) -> WasiCtxView<'_> { + let (state, table) = Self::get_data_with_table(data); + WasiCtxView { + ctx: &mut state.ctx, + table, + } } fn link_random_bindings( @@ -108,6 +201,27 @@ trait InitContextExt: InitContext { state.ctx.random() }) } + + fn link_all_bindings( + &mut self, + add_to_linker: fn( + &mut wasmtime::component::Linker, + fn(&mut Self::StoreData) -> WasiCtxView<'_>, + fn(&mut Self::StoreData) -> WasiClocksCtxView<'_>, + fn(&mut Self::StoreData) -> WasiCliCtxView<'_>, + fn(&mut Self::StoreData) -> WasiFilesystemCtxView<'_>, + fn(&mut Self::StoreData) -> WasiSocketsCtxView<'_>, + ) -> anyhow::Result<()>, + ) -> anyhow::Result<()> { + add_to_linker( + self.linker(), + Self::get_wasi, + Self::get_clocks, + Self::get_cli, + Self::get_filesystem, + Self::get_sockets, + ) + } } impl InitContextExt for T where T: InitContext {} @@ -118,6 +232,30 @@ impl HasData for HasWasi { type Data<'a> = WasiCtxView<'a>; } +struct HasClocks; + +impl HasData for HasClocks { + type Data<'a> = WasiClocksCtxView<'a>; +} + +struct HasCli; + +impl HasData for HasCli { + type Data<'a> = WasiCliCtxView<'a>; +} + +struct HasFilesystem; + +impl HasData for HasFilesystem { + type Data<'a> = WasiFilesystemCtxView<'a>; +} + +struct HasSockets; + +impl HasData for HasSockets { + type Data<'a> = WasiSocketsCtxView<'a>; +} + struct HasIo; impl HasData for HasIo { @@ -138,36 +276,50 @@ impl Factor for WasiFactor { fn init(&mut self, ctx: &mut impl InitContext) -> anyhow::Result<()> { use wasmtime_wasi::p2::bindings; - ctx.link_wasi_bindings(bindings::clocks::wall_clock::add_to_linker::<_, HasWasi>)?; - ctx.link_wasi_bindings(bindings::clocks::monotonic_clock::add_to_linker::<_, HasWasi>)?; - ctx.link_wasi_bindings(bindings::filesystem::types::add_to_linker::<_, HasWasi>)?; - ctx.link_wasi_bindings(bindings::filesystem::preopens::add_to_linker::<_, HasWasi>)?; + ctx.link_clocks_bindings(bindings::clocks::wall_clock::add_to_linker::<_, HasClocks>)?; + ctx.link_clocks_bindings(bindings::clocks::monotonic_clock::add_to_linker::<_, HasClocks>)?; + ctx.link_filesystem_bindings( + bindings::filesystem::types::add_to_linker::<_, HasFilesystem>, + )?; + ctx.link_filesystem_bindings( + bindings::filesystem::preopens::add_to_linker::<_, HasFilesystem>, + )?; ctx.link_io_bindings(bindings::io::error::add_to_linker::<_, HasIo>)?; ctx.link_io_bindings(bindings::io::poll::add_to_linker::<_, HasIo>)?; ctx.link_io_bindings(bindings::io::streams::add_to_linker::<_, HasIo>)?; ctx.link_random_bindings(bindings::random::random::add_to_linker::<_, HasRandom>)?; ctx.link_random_bindings(bindings::random::insecure::add_to_linker::<_, HasRandom>)?; ctx.link_random_bindings(bindings::random::insecure_seed::add_to_linker::<_, HasRandom>)?; - ctx.link_wasi_default_bindings(bindings::cli::exit::add_to_linker::<_, HasWasi>)?; - ctx.link_wasi_bindings(bindings::cli::environment::add_to_linker::<_, HasWasi>)?; - ctx.link_wasi_bindings(bindings::cli::stdin::add_to_linker::<_, HasWasi>)?; - ctx.link_wasi_bindings(bindings::cli::stdout::add_to_linker::<_, HasWasi>)?; - ctx.link_wasi_bindings(bindings::cli::stderr::add_to_linker::<_, HasWasi>)?; - ctx.link_wasi_bindings(bindings::cli::terminal_input::add_to_linker::<_, HasWasi>)?; - ctx.link_wasi_bindings(bindings::cli::terminal_output::add_to_linker::<_, HasWasi>)?; - ctx.link_wasi_bindings(bindings::cli::terminal_stdin::add_to_linker::<_, HasWasi>)?; - ctx.link_wasi_bindings(bindings::cli::terminal_stdout::add_to_linker::<_, HasWasi>)?; - ctx.link_wasi_bindings(bindings::cli::terminal_stderr::add_to_linker::<_, HasWasi>)?; - ctx.link_wasi_bindings(bindings::sockets::tcp::add_to_linker::<_, HasWasi>)?; - ctx.link_wasi_bindings(bindings::sockets::tcp_create_socket::add_to_linker::<_, HasWasi>)?; - ctx.link_wasi_bindings(bindings::sockets::udp::add_to_linker::<_, HasWasi>)?; - ctx.link_wasi_bindings(bindings::sockets::udp_create_socket::add_to_linker::<_, HasWasi>)?; - ctx.link_wasi_bindings(bindings::sockets::instance_network::add_to_linker::<_, HasWasi>)?; - ctx.link_wasi_default_bindings(bindings::sockets::network::add_to_linker::<_, HasWasi>)?; - ctx.link_wasi_bindings(bindings::sockets::ip_name_lookup::add_to_linker::<_, HasWasi>)?; - - ctx.link_wasi_bindings(wasi_2023_10_18::add_to_linker)?; - ctx.link_wasi_bindings(wasi_2023_11_10::add_to_linker)?; + ctx.link_cli_default_bindings(bindings::cli::exit::add_to_linker::<_, HasCli>)?; + ctx.link_cli_bindings(bindings::cli::environment::add_to_linker::<_, HasCli>)?; + ctx.link_cli_bindings(bindings::cli::stdin::add_to_linker::<_, HasCli>)?; + ctx.link_cli_bindings(bindings::cli::stdout::add_to_linker::<_, HasCli>)?; + ctx.link_cli_bindings(bindings::cli::stderr::add_to_linker::<_, HasCli>)?; + ctx.link_cli_bindings(bindings::cli::terminal_input::add_to_linker::<_, HasCli>)?; + ctx.link_cli_bindings(bindings::cli::terminal_output::add_to_linker::<_, HasCli>)?; + ctx.link_cli_bindings(bindings::cli::terminal_stdin::add_to_linker::<_, HasCli>)?; + ctx.link_cli_bindings(bindings::cli::terminal_stdout::add_to_linker::<_, HasCli>)?; + ctx.link_cli_bindings(bindings::cli::terminal_stderr::add_to_linker::<_, HasCli>)?; + ctx.link_sockets_bindings(bindings::sockets::tcp::add_to_linker::<_, HasSockets>)?; + ctx.link_sockets_bindings( + bindings::sockets::tcp_create_socket::add_to_linker::<_, HasSockets>, + )?; + ctx.link_sockets_bindings(bindings::sockets::udp::add_to_linker::<_, HasSockets>)?; + ctx.link_sockets_bindings( + bindings::sockets::udp_create_socket::add_to_linker::<_, HasSockets>, + )?; + ctx.link_sockets_bindings( + bindings::sockets::instance_network::add_to_linker::<_, HasSockets>, + )?; + ctx.link_sockets_default_bindings( + bindings::sockets::network::add_to_linker::<_, HasSockets>, + )?; + ctx.link_sockets_bindings( + bindings::sockets::ip_name_lookup::add_to_linker::<_, HasSockets>, + )?; + + ctx.link_all_bindings(wasi_2023_10_18::add_to_linker)?; + ctx.link_all_bindings(wasi_2023_11_10::add_to_linker)?; Ok(()) } @@ -333,13 +485,11 @@ impl InstanceBuilder { let check = check.clone(); Box::pin(async move { match addr_use { - wasmtime_wasi::SocketAddrUse::TcpBind => false, - wasmtime_wasi::SocketAddrUse::TcpConnect - | wasmtime_wasi::SocketAddrUse::UdpBind - | wasmtime_wasi::SocketAddrUse::UdpConnect - | wasmtime_wasi::SocketAddrUse::UdpOutgoingDatagram => { - check(addr, addr_use).await - } + SocketAddrUse::TcpBind => false, + SocketAddrUse::TcpConnect + | SocketAddrUse::UdpBind + | SocketAddrUse::UdpConnect + | SocketAddrUse::UdpOutgoingDatagram => check(addr, addr_use).await, } }) }); diff --git a/crates/factor-wasi/src/wasi_2023_10_18.rs b/crates/factor-wasi/src/wasi_2023_10_18.rs index cc3c338f5..1bf88c712 100644 --- a/crates/factor-wasi/src/wasi_2023_10_18.rs +++ b/crates/factor-wasi/src/wasi_2023_10_18.rs @@ -1,7 +1,11 @@ use spin_factors::anyhow::{self, Result}; use std::mem; use wasmtime::component::{Linker, Resource}; +use wasmtime_wasi::cli::WasiCliCtxView; +use wasmtime_wasi::clocks::WasiClocksCtxView; +use wasmtime_wasi::filesystem::WasiFilesystemCtxView; use wasmtime_wasi::p2::DynPollable; +use wasmtime_wasi::sockets::WasiSocketsCtxView; use wasmtime_wasi::{TrappableError, WasiCtxView}; mod latest { @@ -112,45 +116,49 @@ use wasi::sockets::tcp::{ }; use wasi::sockets::udp::Datagram; -use crate::HasWasi; +use crate::{HasCli, HasClocks, HasFilesystem, HasSockets, HasWasi}; pub fn add_to_linker( linker: &mut Linker, closure: fn(&mut T) -> WasiCtxView<'_>, + clocks_closure: fn(&mut T) -> WasiClocksCtxView<'_>, + cli_closure: fn(&mut T) -> WasiCliCtxView<'_>, + filesystem_closure: fn(&mut T) -> WasiFilesystemCtxView<'_>, + sockets_closure: fn(&mut T) -> WasiSocketsCtxView<'_>, ) -> Result<()> where T: Send + 'static, { - wasi::clocks::monotonic_clock::add_to_linker::<_, HasWasi>(linker, closure)?; - wasi::clocks::wall_clock::add_to_linker::<_, HasWasi>(linker, closure)?; - wasi::filesystem::types::add_to_linker::<_, HasWasi>(linker, closure)?; - wasi::filesystem::preopens::add_to_linker::<_, HasWasi>(linker, closure)?; + wasi::clocks::monotonic_clock::add_to_linker::<_, HasClocks>(linker, clocks_closure)?; + wasi::clocks::wall_clock::add_to_linker::<_, HasClocks>(linker, clocks_closure)?; + wasi::filesystem::types::add_to_linker::<_, HasFilesystem>(linker, filesystem_closure)?; + wasi::filesystem::preopens::add_to_linker::<_, HasFilesystem>(linker, filesystem_closure)?; wasi::io::poll::add_to_linker::<_, HasWasi>(linker, closure)?; wasi::io::streams::add_to_linker::<_, HasWasi>(linker, closure)?; wasi::random::random::add_to_linker::<_, HasWasi>(linker, closure)?; wasi::random::insecure::add_to_linker::<_, HasWasi>(linker, closure)?; wasi::random::insecure_seed::add_to_linker::<_, HasWasi>(linker, closure)?; - wasi::cli::exit::add_to_linker::<_, HasWasi>(linker, closure)?; - wasi::cli::environment::add_to_linker::<_, HasWasi>(linker, closure)?; - wasi::cli::stdin::add_to_linker::<_, HasWasi>(linker, closure)?; - wasi::cli::stdout::add_to_linker::<_, HasWasi>(linker, closure)?; - wasi::cli::stderr::add_to_linker::<_, HasWasi>(linker, closure)?; - wasi::cli::terminal_input::add_to_linker::<_, HasWasi>(linker, closure)?; - wasi::cli::terminal_output::add_to_linker::<_, HasWasi>(linker, closure)?; - wasi::cli::terminal_stdin::add_to_linker::<_, HasWasi>(linker, closure)?; - wasi::cli::terminal_stdout::add_to_linker::<_, HasWasi>(linker, closure)?; - wasi::cli::terminal_stderr::add_to_linker::<_, HasWasi>(linker, closure)?; - wasi::sockets::tcp::add_to_linker::<_, HasWasi>(linker, closure)?; - wasi::sockets::tcp_create_socket::add_to_linker::<_, HasWasi>(linker, closure)?; - wasi::sockets::udp::add_to_linker::<_, HasWasi>(linker, closure)?; - wasi::sockets::udp_create_socket::add_to_linker::<_, HasWasi>(linker, closure)?; - wasi::sockets::instance_network::add_to_linker::<_, HasWasi>(linker, closure)?; - wasi::sockets::network::add_to_linker::<_, HasWasi>(linker, closure)?; - wasi::sockets::ip_name_lookup::add_to_linker::<_, HasWasi>(linker, closure)?; + wasi::cli::exit::add_to_linker::<_, HasCli>(linker, cli_closure)?; + wasi::cli::environment::add_to_linker::<_, HasCli>(linker, cli_closure)?; + wasi::cli::stdin::add_to_linker::<_, HasCli>(linker, cli_closure)?; + wasi::cli::stdout::add_to_linker::<_, HasCli>(linker, cli_closure)?; + wasi::cli::stderr::add_to_linker::<_, HasCli>(linker, cli_closure)?; + wasi::cli::terminal_input::add_to_linker::<_, HasCli>(linker, cli_closure)?; + wasi::cli::terminal_output::add_to_linker::<_, HasCli>(linker, cli_closure)?; + wasi::cli::terminal_stdin::add_to_linker::<_, HasCli>(linker, cli_closure)?; + wasi::cli::terminal_stdout::add_to_linker::<_, HasCli>(linker, cli_closure)?; + wasi::cli::terminal_stderr::add_to_linker::<_, HasCli>(linker, cli_closure)?; + wasi::sockets::tcp::add_to_linker::<_, HasSockets>(linker, sockets_closure)?; + wasi::sockets::tcp_create_socket::add_to_linker::<_, HasSockets>(linker, sockets_closure)?; + wasi::sockets::udp::add_to_linker::<_, HasSockets>(linker, sockets_closure)?; + wasi::sockets::udp_create_socket::add_to_linker::<_, HasSockets>(linker, sockets_closure)?; + wasi::sockets::instance_network::add_to_linker::<_, HasSockets>(linker, sockets_closure)?; + wasi::sockets::network::add_to_linker::<_, HasSockets>(linker, sockets_closure)?; + wasi::sockets::ip_name_lookup::add_to_linker::<_, HasSockets>(linker, sockets_closure)?; Ok(()) } -impl wasi::clocks::monotonic_clock::Host for WasiCtxView<'_> { +impl wasi::clocks::monotonic_clock::Host for WasiClocksCtxView<'_> { fn now(&mut self) -> wasmtime::Result { latest::clocks::monotonic_clock::Host::now(self) } @@ -172,7 +180,7 @@ impl wasi::clocks::monotonic_clock::Host for WasiCtxView<'_> { } } -impl wasi::clocks::wall_clock::Host for WasiCtxView<'_> { +impl wasi::clocks::wall_clock::Host for WasiClocksCtxView<'_> { fn now(&mut self) -> wasmtime::Result { Ok(latest::clocks::wall_clock::Host::now(self)?.into()) } @@ -182,7 +190,7 @@ impl wasi::clocks::wall_clock::Host for WasiCtxView<'_> { } } -impl wasi::filesystem::types::Host for WasiCtxView<'_> { +impl wasi::filesystem::types::Host for WasiFilesystemCtxView<'_> { fn filesystem_error_code( &mut self, err: Resource, @@ -191,7 +199,7 @@ impl wasi::filesystem::types::Host for WasiCtxView<'_> { } } -impl wasi::filesystem::types::HostDescriptor for WasiCtxView<'_> { +impl wasi::filesystem::types::HostDescriptor for WasiFilesystemCtxView<'_> { fn read_via_stream( &mut self, self_: Resource, @@ -585,7 +593,7 @@ impl wasi::filesystem::types::HostDescriptor for WasiCtxView<'_> { } } -impl wasi::filesystem::types::HostDirectoryEntryStream for WasiCtxView<'_> { +impl wasi::filesystem::types::HostDirectoryEntryStream for WasiFilesystemCtxView<'_> { async fn read_directory_entry( &mut self, self_: Resource, @@ -602,7 +610,7 @@ impl wasi::filesystem::types::HostDirectoryEntryStream for WasiCtxView<'_> { } } -impl wasi::filesystem::preopens::Host for WasiCtxView<'_> { +impl wasi::filesystem::preopens::Host for WasiFilesystemCtxView<'_> { fn get_directories(&mut self) -> wasmtime::Result, String)>> { latest::filesystem::preopens::Host::get_directories(self) } @@ -822,13 +830,13 @@ impl wasi::random::insecure_seed::Host for WasiCtxView<'_> { } } -impl wasi::cli::exit::Host for WasiCtxView<'_> { +impl wasi::cli::exit::Host for WasiCliCtxView<'_> { fn exit(&mut self, status: Result<(), ()>) -> wasmtime::Result<()> { latest::cli::exit::Host::exit(self, status) } } -impl wasi::cli::environment::Host for WasiCtxView<'_> { +impl wasi::cli::environment::Host for WasiCliCtxView<'_> { fn get_environment(&mut self) -> wasmtime::Result> { latest::cli::environment::Host::get_environment(self) } @@ -842,61 +850,61 @@ impl wasi::cli::environment::Host for WasiCtxView<'_> { } } -impl wasi::cli::stdin::Host for WasiCtxView<'_> { +impl wasi::cli::stdin::Host for WasiCliCtxView<'_> { fn get_stdin(&mut self) -> wasmtime::Result> { latest::cli::stdin::Host::get_stdin(self) } } -impl wasi::cli::stdout::Host for WasiCtxView<'_> { +impl wasi::cli::stdout::Host for WasiCliCtxView<'_> { fn get_stdout(&mut self) -> wasmtime::Result> { latest::cli::stdout::Host::get_stdout(self) } } -impl wasi::cli::stderr::Host for WasiCtxView<'_> { +impl wasi::cli::stderr::Host for WasiCliCtxView<'_> { fn get_stderr(&mut self) -> wasmtime::Result> { latest::cli::stderr::Host::get_stderr(self) } } -impl wasi::cli::terminal_stdin::Host for WasiCtxView<'_> { +impl wasi::cli::terminal_stdin::Host for WasiCliCtxView<'_> { fn get_terminal_stdin(&mut self) -> wasmtime::Result>> { latest::cli::terminal_stdin::Host::get_terminal_stdin(self) } } -impl wasi::cli::terminal_stdout::Host for WasiCtxView<'_> { +impl wasi::cli::terminal_stdout::Host for WasiCliCtxView<'_> { fn get_terminal_stdout(&mut self) -> wasmtime::Result>> { latest::cli::terminal_stdout::Host::get_terminal_stdout(self) } } -impl wasi::cli::terminal_stderr::Host for WasiCtxView<'_> { +impl wasi::cli::terminal_stderr::Host for WasiCliCtxView<'_> { fn get_terminal_stderr(&mut self) -> wasmtime::Result>> { latest::cli::terminal_stderr::Host::get_terminal_stderr(self) } } -impl wasi::cli::terminal_input::Host for WasiCtxView<'_> {} +impl wasi::cli::terminal_input::Host for WasiCliCtxView<'_> {} -impl wasi::cli::terminal_input::HostTerminalInput for WasiCtxView<'_> { +impl wasi::cli::terminal_input::HostTerminalInput for WasiCliCtxView<'_> { fn drop(&mut self, rep: Resource) -> wasmtime::Result<()> { latest::cli::terminal_input::HostTerminalInput::drop(self, rep) } } -impl wasi::cli::terminal_output::Host for WasiCtxView<'_> {} +impl wasi::cli::terminal_output::Host for WasiCliCtxView<'_> {} -impl wasi::cli::terminal_output::HostTerminalOutput for WasiCtxView<'_> { +impl wasi::cli::terminal_output::HostTerminalOutput for WasiCliCtxView<'_> { fn drop(&mut self, rep: Resource) -> wasmtime::Result<()> { latest::cli::terminal_output::HostTerminalOutput::drop(self, rep) } } -impl wasi::sockets::tcp::Host for WasiCtxView<'_> {} +impl wasi::sockets::tcp::Host for WasiSocketsCtxView<'_> {} -impl wasi::sockets::tcp::HostTcpSocket for WasiCtxView<'_> { +impl wasi::sockets::tcp::HostTcpSocket for WasiSocketsCtxView<'_> { async fn start_bind( &mut self, self_: Resource, @@ -1141,7 +1149,7 @@ impl wasi::sockets::tcp::HostTcpSocket for WasiCtxView<'_> { } } -impl wasi::sockets::tcp_create_socket::Host for WasiCtxView<'_> { +impl wasi::sockets::tcp_create_socket::Host for WasiSocketsCtxView<'_> { fn create_tcp_socket( &mut self, address_family: IpAddressFamily, @@ -1153,7 +1161,7 @@ impl wasi::sockets::tcp_create_socket::Host for WasiCtxView<'_> { } } -impl wasi::sockets::udp::Host for WasiCtxView<'_> {} +impl wasi::sockets::udp::Host for WasiSocketsCtxView<'_> {} /// Between the snapshot of WASI that this file is implementing and the current /// implementation of WASI UDP sockets were redesigned slightly to deal with @@ -1174,7 +1182,7 @@ pub enum UdpSocket { impl UdpSocket { async fn finish_connect( - table: &mut WasiCtxView<'_>, + table: &mut WasiSocketsCtxView<'_>, socket: &Resource, explicit: bool, ) -> wasmtime::Result> { @@ -1217,7 +1225,7 @@ impl UdpSocket { } } -impl wasi::sockets::udp::HostUdpSocket for WasiCtxView<'_> { +impl wasi::sockets::udp::HostUdpSocket for WasiSocketsCtxView<'_> { async fn start_bind( &mut self, self_: Resource, @@ -1474,7 +1482,7 @@ impl wasi::sockets::udp::HostUdpSocket for WasiCtxView<'_> { } } -impl wasi::sockets::udp_create_socket::Host for WasiCtxView<'_> { +impl wasi::sockets::udp_create_socket::Host for WasiSocketsCtxView<'_> { fn create_udp_socket( &mut self, address_family: IpAddressFamily, @@ -1492,21 +1500,21 @@ impl wasi::sockets::udp_create_socket::Host for WasiCtxView<'_> { } } -impl wasi::sockets::instance_network::Host for WasiCtxView<'_> { +impl wasi::sockets::instance_network::Host for WasiSocketsCtxView<'_> { fn instance_network(&mut self) -> wasmtime::Result> { latest::sockets::instance_network::Host::instance_network(self) } } -impl wasi::sockets::network::Host for WasiCtxView<'_> {} +impl wasi::sockets::network::Host for WasiSocketsCtxView<'_> {} -impl wasi::sockets::network::HostNetwork for WasiCtxView<'_> { +impl wasi::sockets::network::HostNetwork for WasiSocketsCtxView<'_> { fn drop(&mut self, rep: Resource) -> wasmtime::Result<()> { latest::sockets::network::HostNetwork::drop(self, rep) } } -impl wasi::sockets::ip_name_lookup::Host for WasiCtxView<'_> { +impl wasi::sockets::ip_name_lookup::Host for WasiSocketsCtxView<'_> { fn resolve_addresses( &mut self, network: Resource, @@ -1520,7 +1528,7 @@ impl wasi::sockets::ip_name_lookup::Host for WasiCtxView<'_> { } } -impl wasi::sockets::ip_name_lookup::HostResolveAddressStream for WasiCtxView<'_> { +impl wasi::sockets::ip_name_lookup::HostResolveAddressStream for WasiSocketsCtxView<'_> { fn resolve_next_address( &mut self, self_: Resource, diff --git a/crates/factor-wasi/src/wasi_2023_11_10.rs b/crates/factor-wasi/src/wasi_2023_11_10.rs index 50c59cddf..6d87ca284 100644 --- a/crates/factor-wasi/src/wasi_2023_11_10.rs +++ b/crates/factor-wasi/src/wasi_2023_11_10.rs @@ -1,6 +1,10 @@ use super::wasi_2023_10_18::{convert, convert_result}; use spin_factors::anyhow::{self, Result}; use wasmtime::component::{Linker, Resource}; +use wasmtime_wasi::cli::WasiCliCtxView; +use wasmtime_wasi::clocks::WasiClocksCtxView; +use wasmtime_wasi::filesystem::WasiFilesystemCtxView; +use wasmtime_wasi::sockets::WasiSocketsCtxView; use wasmtime_wasi::WasiCtxView; mod latest { @@ -106,46 +110,50 @@ use wasi::sockets::udp::{ IncomingDatagram, IncomingDatagramStream, OutgoingDatagram, OutgoingDatagramStream, UdpSocket, }; -use crate::HasWasi; +use crate::{HasCli, HasClocks, HasFilesystem, HasSockets, HasWasi}; pub fn add_to_linker( linker: &mut Linker, closure: fn(&mut T) -> WasiCtxView<'_>, + clocks_closure: fn(&mut T) -> WasiClocksCtxView<'_>, + cli_closure: fn(&mut T) -> WasiCliCtxView<'_>, + filesystem_closure: fn(&mut T) -> WasiFilesystemCtxView<'_>, + sockets_closure: fn(&mut T) -> WasiSocketsCtxView<'_>, ) -> Result<()> where T: Send + 'static, { - wasi::clocks::monotonic_clock::add_to_linker::<_, HasWasi>(linker, closure)?; - wasi::clocks::wall_clock::add_to_linker::<_, HasWasi>(linker, closure)?; - wasi::filesystem::types::add_to_linker::<_, HasWasi>(linker, closure)?; - wasi::filesystem::preopens::add_to_linker::<_, HasWasi>(linker, closure)?; + wasi::clocks::monotonic_clock::add_to_linker::<_, HasClocks>(linker, clocks_closure)?; + wasi::clocks::wall_clock::add_to_linker::<_, HasClocks>(linker, clocks_closure)?; + wasi::filesystem::types::add_to_linker::<_, HasFilesystem>(linker, filesystem_closure)?; + wasi::filesystem::preopens::add_to_linker::<_, HasFilesystem>(linker, filesystem_closure)?; wasi::io::error::add_to_linker::<_, HasWasi>(linker, closure)?; wasi::io::poll::add_to_linker::<_, HasWasi>(linker, closure)?; wasi::io::streams::add_to_linker::<_, HasWasi>(linker, closure)?; wasi::random::random::add_to_linker::<_, HasWasi>(linker, closure)?; wasi::random::insecure::add_to_linker::<_, HasWasi>(linker, closure)?; wasi::random::insecure_seed::add_to_linker::<_, HasWasi>(linker, closure)?; - wasi::cli::exit::add_to_linker::<_, HasWasi>(linker, closure)?; - wasi::cli::environment::add_to_linker::<_, HasWasi>(linker, closure)?; - wasi::cli::stdin::add_to_linker::<_, HasWasi>(linker, closure)?; - wasi::cli::stdout::add_to_linker::<_, HasWasi>(linker, closure)?; - wasi::cli::stderr::add_to_linker::<_, HasWasi>(linker, closure)?; - wasi::cli::terminal_input::add_to_linker::<_, HasWasi>(linker, closure)?; - wasi::cli::terminal_output::add_to_linker::<_, HasWasi>(linker, closure)?; - wasi::cli::terminal_stdin::add_to_linker::<_, HasWasi>(linker, closure)?; - wasi::cli::terminal_stdout::add_to_linker::<_, HasWasi>(linker, closure)?; - wasi::cli::terminal_stderr::add_to_linker::<_, HasWasi>(linker, closure)?; - wasi::sockets::tcp::add_to_linker::<_, HasWasi>(linker, closure)?; - wasi::sockets::tcp_create_socket::add_to_linker::<_, HasWasi>(linker, closure)?; - wasi::sockets::udp::add_to_linker::<_, HasWasi>(linker, closure)?; - wasi::sockets::udp_create_socket::add_to_linker::<_, HasWasi>(linker, closure)?; - wasi::sockets::instance_network::add_to_linker::<_, HasWasi>(linker, closure)?; - wasi::sockets::network::add_to_linker::<_, HasWasi>(linker, closure)?; - wasi::sockets::ip_name_lookup::add_to_linker::<_, HasWasi>(linker, closure)?; + wasi::cli::exit::add_to_linker::<_, HasCli>(linker, cli_closure)?; + wasi::cli::environment::add_to_linker::<_, HasCli>(linker, cli_closure)?; + wasi::cli::stdin::add_to_linker::<_, HasCli>(linker, cli_closure)?; + wasi::cli::stdout::add_to_linker::<_, HasCli>(linker, cli_closure)?; + wasi::cli::stderr::add_to_linker::<_, HasCli>(linker, cli_closure)?; + wasi::cli::terminal_input::add_to_linker::<_, HasCli>(linker, cli_closure)?; + wasi::cli::terminal_output::add_to_linker::<_, HasCli>(linker, cli_closure)?; + wasi::cli::terminal_stdin::add_to_linker::<_, HasCli>(linker, cli_closure)?; + wasi::cli::terminal_stdout::add_to_linker::<_, HasCli>(linker, cli_closure)?; + wasi::cli::terminal_stderr::add_to_linker::<_, HasCli>(linker, cli_closure)?; + wasi::sockets::tcp::add_to_linker::<_, HasSockets>(linker, sockets_closure)?; + wasi::sockets::tcp_create_socket::add_to_linker::<_, HasSockets>(linker, sockets_closure)?; + wasi::sockets::udp::add_to_linker::<_, HasSockets>(linker, sockets_closure)?; + wasi::sockets::udp_create_socket::add_to_linker::<_, HasSockets>(linker, sockets_closure)?; + wasi::sockets::instance_network::add_to_linker::<_, HasSockets>(linker, sockets_closure)?; + wasi::sockets::network::add_to_linker::<_, HasSockets>(linker, sockets_closure)?; + wasi::sockets::ip_name_lookup::add_to_linker::<_, HasSockets>(linker, sockets_closure)?; Ok(()) } -impl wasi::clocks::monotonic_clock::Host for WasiCtxView<'_> { +impl wasi::clocks::monotonic_clock::Host for WasiClocksCtxView<'_> { fn now(&mut self) -> wasmtime::Result { latest::clocks::monotonic_clock::Host::now(self) } @@ -163,7 +171,7 @@ impl wasi::clocks::monotonic_clock::Host for WasiCtxView<'_> { } } -impl wasi::clocks::wall_clock::Host for WasiCtxView<'_> { +impl wasi::clocks::wall_clock::Host for WasiClocksCtxView<'_> { fn now(&mut self) -> wasmtime::Result { Ok(latest::clocks::wall_clock::Host::now(self)?.into()) } @@ -173,7 +181,7 @@ impl wasi::clocks::wall_clock::Host for WasiCtxView<'_> { } } -impl wasi::filesystem::types::Host for WasiCtxView<'_> { +impl wasi::filesystem::types::Host for WasiFilesystemCtxView<'_> { fn filesystem_error_code( &mut self, err: Resource, @@ -182,7 +190,7 @@ impl wasi::filesystem::types::Host for WasiCtxView<'_> { } } -impl wasi::filesystem::types::HostDescriptor for WasiCtxView<'_> { +impl wasi::filesystem::types::HostDescriptor for WasiFilesystemCtxView<'_> { fn read_via_stream( &mut self, self_: Resource, @@ -506,7 +514,7 @@ impl wasi::filesystem::types::HostDescriptor for WasiCtxView<'_> { } } -impl wasi::filesystem::types::HostDirectoryEntryStream for WasiCtxView<'_> { +impl wasi::filesystem::types::HostDirectoryEntryStream for WasiFilesystemCtxView<'_> { async fn read_directory_entry( &mut self, self_: Resource, @@ -523,7 +531,7 @@ impl wasi::filesystem::types::HostDirectoryEntryStream for WasiCtxView<'_> { } } -impl wasi::filesystem::preopens::Host for WasiCtxView<'_> { +impl wasi::filesystem::preopens::Host for WasiFilesystemCtxView<'_> { fn get_directories(&mut self) -> wasmtime::Result, String)>> { latest::filesystem::preopens::Host::get_directories(self) } @@ -753,13 +761,13 @@ impl wasi::random::insecure_seed::Host for WasiCtxView<'_> { } } -impl wasi::cli::exit::Host for WasiCtxView<'_> { +impl wasi::cli::exit::Host for WasiCliCtxView<'_> { fn exit(&mut self, status: Result<(), ()>) -> wasmtime::Result<()> { latest::cli::exit::Host::exit(self, status) } } -impl wasi::cli::environment::Host for WasiCtxView<'_> { +impl wasi::cli::environment::Host for WasiCliCtxView<'_> { fn get_environment(&mut self) -> wasmtime::Result> { latest::cli::environment::Host::get_environment(self) } @@ -773,61 +781,61 @@ impl wasi::cli::environment::Host for WasiCtxView<'_> { } } -impl wasi::cli::stdin::Host for WasiCtxView<'_> { +impl wasi::cli::stdin::Host for WasiCliCtxView<'_> { fn get_stdin(&mut self) -> wasmtime::Result> { latest::cli::stdin::Host::get_stdin(self) } } -impl wasi::cli::stdout::Host for WasiCtxView<'_> { +impl wasi::cli::stdout::Host for WasiCliCtxView<'_> { fn get_stdout(&mut self) -> wasmtime::Result> { latest::cli::stdout::Host::get_stdout(self) } } -impl wasi::cli::stderr::Host for WasiCtxView<'_> { +impl wasi::cli::stderr::Host for WasiCliCtxView<'_> { fn get_stderr(&mut self) -> wasmtime::Result> { latest::cli::stderr::Host::get_stderr(self) } } -impl wasi::cli::terminal_stdin::Host for WasiCtxView<'_> { +impl wasi::cli::terminal_stdin::Host for WasiCliCtxView<'_> { fn get_terminal_stdin(&mut self) -> wasmtime::Result>> { latest::cli::terminal_stdin::Host::get_terminal_stdin(self) } } -impl wasi::cli::terminal_stdout::Host for WasiCtxView<'_> { +impl wasi::cli::terminal_stdout::Host for WasiCliCtxView<'_> { fn get_terminal_stdout(&mut self) -> wasmtime::Result>> { latest::cli::terminal_stdout::Host::get_terminal_stdout(self) } } -impl wasi::cli::terminal_stderr::Host for WasiCtxView<'_> { +impl wasi::cli::terminal_stderr::Host for WasiCliCtxView<'_> { fn get_terminal_stderr(&mut self) -> wasmtime::Result>> { latest::cli::terminal_stderr::Host::get_terminal_stderr(self) } } -impl wasi::cli::terminal_input::Host for WasiCtxView<'_> {} +impl wasi::cli::terminal_input::Host for WasiCliCtxView<'_> {} -impl wasi::cli::terminal_input::HostTerminalInput for WasiCtxView<'_> { +impl wasi::cli::terminal_input::HostTerminalInput for WasiCliCtxView<'_> { fn drop(&mut self, rep: Resource) -> wasmtime::Result<()> { latest::cli::terminal_input::HostTerminalInput::drop(self, rep) } } -impl wasi::cli::terminal_output::Host for WasiCtxView<'_> {} +impl wasi::cli::terminal_output::Host for WasiCliCtxView<'_> {} -impl wasi::cli::terminal_output::HostTerminalOutput for WasiCtxView<'_> { +impl wasi::cli::terminal_output::HostTerminalOutput for WasiCliCtxView<'_> { fn drop(&mut self, rep: Resource) -> wasmtime::Result<()> { latest::cli::terminal_output::HostTerminalOutput::drop(self, rep) } } -impl wasi::sockets::tcp::Host for WasiCtxView<'_> {} +impl wasi::sockets::tcp::Host for WasiSocketsCtxView<'_> {} -impl wasi::sockets::tcp::HostTcpSocket for WasiCtxView<'_> { +impl wasi::sockets::tcp::HostTcpSocket for WasiSocketsCtxView<'_> { async fn start_bind( &mut self, self_: Resource, @@ -1118,7 +1126,7 @@ impl wasi::sockets::tcp::HostTcpSocket for WasiCtxView<'_> { } } -impl wasi::sockets::tcp_create_socket::Host for WasiCtxView<'_> { +impl wasi::sockets::tcp_create_socket::Host for WasiSocketsCtxView<'_> { fn create_tcp_socket( &mut self, address_family: IpAddressFamily, @@ -1130,9 +1138,9 @@ impl wasi::sockets::tcp_create_socket::Host for WasiCtxView<'_> { } } -impl wasi::sockets::udp::Host for WasiCtxView<'_> {} +impl wasi::sockets::udp::Host for WasiSocketsCtxView<'_> {} -impl wasi::sockets::udp::HostUdpSocket for WasiCtxView<'_> { +impl wasi::sockets::udp::HostUdpSocket for WasiSocketsCtxView<'_> { async fn start_bind( &mut self, self_: Resource, @@ -1285,7 +1293,7 @@ impl wasi::sockets::udp::HostUdpSocket for WasiCtxView<'_> { } } -impl wasi::sockets::udp::HostOutgoingDatagramStream for WasiCtxView<'_> { +impl wasi::sockets::udp::HostOutgoingDatagramStream for WasiSocketsCtxView<'_> { fn check_send( &mut self, self_: Resource, @@ -1320,7 +1328,7 @@ impl wasi::sockets::udp::HostOutgoingDatagramStream for WasiCtxView<'_> { } } -impl wasi::sockets::udp::HostIncomingDatagramStream for WasiCtxView<'_> { +impl wasi::sockets::udp::HostIncomingDatagramStream for WasiSocketsCtxView<'_> { fn receive( &mut self, self_: Resource, @@ -1346,7 +1354,7 @@ impl wasi::sockets::udp::HostIncomingDatagramStream for WasiCtxView<'_> { } } -impl wasi::sockets::udp_create_socket::Host for WasiCtxView<'_> { +impl wasi::sockets::udp_create_socket::Host for WasiSocketsCtxView<'_> { fn create_udp_socket( &mut self, address_family: IpAddressFamily, @@ -1358,21 +1366,21 @@ impl wasi::sockets::udp_create_socket::Host for WasiCtxView<'_> { } } -impl wasi::sockets::instance_network::Host for WasiCtxView<'_> { +impl wasi::sockets::instance_network::Host for WasiSocketsCtxView<'_> { fn instance_network(&mut self) -> wasmtime::Result> { latest::sockets::instance_network::Host::instance_network(self) } } -impl wasi::sockets::network::Host for WasiCtxView<'_> {} +impl wasi::sockets::network::Host for WasiSocketsCtxView<'_> {} -impl wasi::sockets::network::HostNetwork for WasiCtxView<'_> { +impl wasi::sockets::network::HostNetwork for WasiSocketsCtxView<'_> { fn drop(&mut self, rep: Resource) -> wasmtime::Result<()> { latest::sockets::network::HostNetwork::drop(self, rep) } } -impl wasi::sockets::ip_name_lookup::Host for WasiCtxView<'_> { +impl wasi::sockets::ip_name_lookup::Host for WasiSocketsCtxView<'_> { fn resolve_addresses( &mut self, network: Resource, @@ -1384,7 +1392,7 @@ impl wasi::sockets::ip_name_lookup::Host for WasiCtxView<'_> { } } -impl wasi::sockets::ip_name_lookup::HostResolveAddressStream for WasiCtxView<'_> { +impl wasi::sockets::ip_name_lookup::HostResolveAddressStream for WasiSocketsCtxView<'_> { fn resolve_next_address( &mut self, self_: Resource, diff --git a/crates/factor-wasi/tests/factor_test.rs b/crates/factor-wasi/tests/factor_test.rs index 34020c64a..faf8f4a1b 100644 --- a/crates/factor-wasi/tests/factor_test.rs +++ b/crates/factor-wasi/tests/factor_test.rs @@ -19,9 +19,9 @@ async fn environment_works() -> anyhow::Result<()> { environment = { FOO = "bar" } }); let mut state = env.build_instance_state().await?; - let mut wasi = WasiFactor::get_wasi_impl(&mut state).unwrap(); + let mut cli = WasiFactor::get_cli_impl(&mut state).unwrap(); - let val = wasi + let val = cli .get_environment()? .into_iter() .find_map(|(key, val)| (key == "FOO").then_some(val)); diff --git a/crates/oci/src/client.rs b/crates/oci/src/client.rs index 7ec254bf4..ba962f7d8 100644 --- a/crates/oci/src/client.rs +++ b/crates/oci/src/client.rs @@ -732,7 +732,10 @@ impl Client { Ok(c) => Ok(c), Err(_) => match docker_credential::get_credential(server) { Err(e) => { - tracing::trace!("Cannot retrieve credentials from Docker, attempting to use anonymous auth: {}", e); + tracing::trace!( + "Cannot retrieve credentials from Docker, attempting to use anonymous auth: {}", + e + ); Ok(RegistryAuth::Anonymous) } @@ -741,7 +744,9 @@ impl Client { Ok(RegistryAuth::Basic(username, password)) } Ok(DockerCredential::IdentityToken(_)) => { - tracing::trace!("Cannot use contents of Docker config, identity token not supported. Using anonymous auth"); + tracing::trace!( + "Cannot use contents of Docker config, identity token not supported. Using anonymous auth" + ); Ok(RegistryAuth::Anonymous) } }, @@ -1329,7 +1334,7 @@ mod test { let mut resolve = wit_parser::Resolve::default(); let package_id = resolve.push_str("test", wit).expect("should parse WIT"); let world_id = resolve - .select_world(package_id, Some(world)) + .select_world(&[package_id], Some(world)) .expect("should select world"); let mut wasm = wit_component::dummy_module( diff --git a/crates/runtime-config/src/lib.rs b/crates/runtime-config/src/lib.rs index d8bbc49a1..4c0d6f4b1 100644 --- a/crates/runtime-config/src/lib.rs +++ b/crates/runtime-config/src/lib.rs @@ -478,6 +478,7 @@ mod tests { macro_rules! define_test_factor { ($field:ident : $factor:ty) => { #[derive(RuntimeFactors)] + #[allow(unused)] struct TestFactors { $field: $factor, } diff --git a/examples/spin-timer/Cargo.lock b/examples/spin-timer/Cargo.lock index fd0ca88a1..2d7d989f4 100644 --- a/examples/spin-timer/Cargo.lock +++ b/examples/spin-timer/Cargo.lock @@ -780,9 +780,9 @@ dependencies = [ [[package]] name = "backon" -version = "1.5.0" +version = "1.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fd0b50b1b78dbadd44ab18b3c794e496f3a139abb9fbc27d9c94c4eebbb96496" +checksum = "592277618714fbcecda9a02ba7a8781f319d26532a88553bbacc77ba5d2b3a8d" dependencies = [ "fastrand 2.3.0", ] @@ -1199,36 +1199,32 @@ dependencies = [ [[package]] name = "cranelift-assembler-x64" -version = "0.123.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3870e823d79cafc9c868fbea77e83fc12ec9c0e87f17ad392c71a55ec01f12a9" +version = "0.124.0" +source = "git+https://github.com/bytecodealliance/wasmtime?branch=release-37.0.0#cda17438e06e49a037a24800a9ec0034d708b5b7" dependencies = [ "cranelift-assembler-x64-meta", ] [[package]] name = "cranelift-assembler-x64-meta" -version = "0.123.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0a9fe971fab18724cbfc9a0579dd9cb6e370891991ccc8f85f3390d81392a3c0" +version = "0.124.0" +source = "git+https://github.com/bytecodealliance/wasmtime?branch=release-37.0.0#cda17438e06e49a037a24800a9ec0034d708b5b7" dependencies = [ "cranelift-srcgen", ] [[package]] name = "cranelift-bforest" -version = "0.123.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac391df81890fc9f820461e76fb344bcebcbf72614ef99bdd03d9fb1a8cdcc5e" +version = "0.124.0" +source = "git+https://github.com/bytecodealliance/wasmtime?branch=release-37.0.0#cda17438e06e49a037a24800a9ec0034d708b5b7" dependencies = [ "cranelift-entity", ] [[package]] name = "cranelift-bitset" -version = "0.123.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "712de3ed567438f3ca42d12547dbf30d92aef37d63ae45eabe32dd53c4ee5d00" +version = "0.124.0" +source = "git+https://github.com/bytecodealliance/wasmtime?branch=release-37.0.0#cda17438e06e49a037a24800a9ec0034d708b5b7" dependencies = [ "serde", "serde_derive", @@ -1236,9 +1232,8 @@ dependencies = [ [[package]] name = "cranelift-codegen" -version = "0.123.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "68e6fc48d06ef89c1ad3675fe093f2642d260eea8ceb96a9ee9ae94e51698277" +version = "0.124.0" +source = "git+https://github.com/bytecodealliance/wasmtime?branch=release-37.0.0#cda17438e06e49a037a24800a9ec0034d708b5b7" dependencies = [ "bumpalo", "cranelift-assembler-x64", @@ -1263,9 +1258,8 @@ dependencies = [ [[package]] name = "cranelift-codegen-meta" -version = "0.123.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a45a98cfcd528bd06c6ef2fd1846cda3695d41bd4b2823ce965a82f4abec362f" +version = "0.124.0" +source = "git+https://github.com/bytecodealliance/wasmtime?branch=release-37.0.0#cda17438e06e49a037a24800a9ec0034d708b5b7" dependencies = [ "cranelift-assembler-x64-meta", "cranelift-codegen-shared", @@ -1276,24 +1270,21 @@ dependencies = [ [[package]] name = "cranelift-codegen-shared" -version = "0.123.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "66b12b2fef743dffdb51a5cdb95f5f92ab263ed518a7ec73aa272a4a86ea17bf" +version = "0.124.0" +source = "git+https://github.com/bytecodealliance/wasmtime?branch=release-37.0.0#cda17438e06e49a037a24800a9ec0034d708b5b7" [[package]] name = "cranelift-control" -version = "0.123.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5dc203df5ac23968c8ded672b6c4b6dbc0639521e50b8d27ac67c2e221f3c98b" +version = "0.124.0" +source = "git+https://github.com/bytecodealliance/wasmtime?branch=release-37.0.0#cda17438e06e49a037a24800a9ec0034d708b5b7" dependencies = [ "arbitrary", ] [[package]] name = "cranelift-entity" -version = "0.123.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2d01c5dca220ed9c664a4c0cf2085aa0bebaddc306be365bdd2691d4a55dd2ae" +version = "0.124.0" +source = "git+https://github.com/bytecodealliance/wasmtime?branch=release-37.0.0#cda17438e06e49a037a24800a9ec0034d708b5b7" dependencies = [ "cranelift-bitset", "serde", @@ -1302,9 +1293,8 @@ dependencies = [ [[package]] name = "cranelift-frontend" -version = "0.123.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ecd02bd4641b10658668bf195ef92af0ecffa49a8a563de8e98f0c2d843a229d" +version = "0.124.0" +source = "git+https://github.com/bytecodealliance/wasmtime?branch=release-37.0.0#cda17438e06e49a037a24800a9ec0034d708b5b7" dependencies = [ "cranelift-codegen", "log", @@ -1314,15 +1304,13 @@ dependencies = [ [[package]] name = "cranelift-isle" -version = "0.123.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "51da2281ea3db0b1f6029b4321acf541ef856baafdf16e990d64953c9737bc3f" +version = "0.124.0" +source = "git+https://github.com/bytecodealliance/wasmtime?branch=release-37.0.0#cda17438e06e49a037a24800a9ec0034d708b5b7" [[package]] name = "cranelift-native" -version = "0.123.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ff037ce35e9d513dcf64e9f613ec4816cb7b0b1b0b4e23788745f2200d278fec" +version = "0.124.0" +source = "git+https://github.com/bytecodealliance/wasmtime?branch=release-37.0.0#cda17438e06e49a037a24800a9ec0034d708b5b7" dependencies = [ "cranelift-codegen", "libc", @@ -1331,9 +1319,8 @@ dependencies = [ [[package]] name = "cranelift-srcgen" -version = "0.123.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d13dc01a8588b7f7733de0c31b766d85cac04aec078897cde706cebd891f8212" +version = "0.124.0" +source = "git+https://github.com/bytecodealliance/wasmtime?branch=release-37.0.0#cda17438e06e49a037a24800a9ec0034d708b5b7" [[package]] name = "crc32fast" @@ -2254,7 +2241,7 @@ dependencies = [ "httpdate", "itoa", "pin-project-lite", - "socket2", + "socket2 0.5.9", "tokio", "tower-service", "tracing", @@ -2377,7 +2364,7 @@ dependencies = [ "hyper 1.6.0", "libc", "pin-project-lite", - "socket2", + "socket2 0.5.9", "tokio", "tower-service", "tracing", @@ -2731,9 +2718,9 @@ checksum = "09edd9e8b54e49e587e4f6295a7d29c3ea94d469cb40ab8ca70b288248a81db2" [[package]] name = "libc" -version = "0.2.171" +version = "0.2.175" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c19937216e9d3aa9956d9bb8dfc0b0c8beb6058fc4f7a4dc4d850edf86a237d6" +checksum = "6a82ae493e598baaea5209805c49bbf2ea7de956d50d7da0da1164f9c6d28543" [[package]] name = "libm" @@ -2997,7 +2984,7 @@ dependencies = [ "rand 0.8.5", "serde", "serde_json", - "socket2", + "socket2 0.5.9", "thiserror 2.0.12", "tokio", "tokio-native-tls", @@ -3700,9 +3687,8 @@ dependencies = [ [[package]] name = "pulley-interpreter" -version = "36.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c53c41637e4052ec0010b923a3ffc99a124f2b6f19062147eae6458904d3e46" +version = "37.0.0" +source = "git+https://github.com/bytecodealliance/wasmtime?branch=release-37.0.0#cda17438e06e49a037a24800a9ec0034d708b5b7" dependencies = [ "cranelift-bitset", "log", @@ -3712,9 +3698,8 @@ dependencies = [ [[package]] name = "pulley-macros" -version = "36.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aed513b785fd6b142c6708c29990d92475971df8370b018c2c236dfd1c47b77d" +version = "37.0.0" +source = "git+https://github.com/bytecodealliance/wasmtime?branch=release-37.0.0#cda17438e06e49a037a24800a9ec0034d708b5b7" dependencies = [ "proc-macro2", "quote", @@ -3734,7 +3719,7 @@ dependencies = [ "quinn-udp", "rustc-hash", "rustls 0.23.25", - "socket2", + "socket2 0.5.9", "thiserror 2.0.12", "tokio", "tracing", @@ -3770,7 +3755,7 @@ dependencies = [ "cfg_aliases", "libc", "once_cell", - "socket2", + "socket2 0.5.9", "tracing", "windows-sys 0.59.0", ] @@ -3919,36 +3904,14 @@ dependencies = [ [[package]] name = "redis" -version = "0.25.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e0d7a6955c7511f60f3ba9e86c6d02b3c3f144f8c24b288d1f4e18074ab8bbec" -dependencies = [ - "async-trait", - "bytes", - "combine", - "futures-util", - "itoa", - "native-tls", - "percent-encoding", - "pin-project-lite", - "ryu", - "sha1_smol", - "socket2", - "tokio", - "tokio-native-tls", - "tokio-util", - "url", -] - -[[package]] -name = "redis" -version = "0.29.5" +version = "0.32.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1bc42f3a12fd4408ce64d8efef67048a924e543bd35c6591c0447fda9054695f" +checksum = "7cd3650deebc68526b304898b192fa4102a4ef0b9ada24da096559cb60e0eef8" dependencies = [ "arc-swap", "backon", "bytes", + "cfg-if", "combine", "futures-channel", "futures-util", @@ -3959,7 +3922,7 @@ dependencies = [ "pin-project-lite", "ryu", "sha1_smol", - "socket2", + "socket2 0.6.0", "tokio", "tokio-native-tls", "tokio-util", @@ -4008,9 +3971,9 @@ dependencies = [ [[package]] name = "regalloc2" -version = "0.12.2" +version = "0.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5216b1837de2149f8bc8e6d5f88a9326b63b8c836ed58ce4a0a29ec736a59734" +checksum = "68e18e1ef763167dc6718c28a5585e62f907590a21028b8e87be1318f19ef1cb" dependencies = [ "allocator-api2", "bumpalo", @@ -4742,6 +4705,16 @@ dependencies = [ "windows-sys 0.52.0", ] +[[package]] +name = "socket2" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "233504af464074f9d066d7b5416c5f9b894a5862a6506e306f7b816cdd6f1807" +dependencies = [ + "libc", + "windows-sys 0.59.0", +] + [[package]] name = "spdx" version = "0.10.8" @@ -4788,9 +4761,9 @@ version = "3.5.0-pre0" dependencies = [ "anyhow", "tracing", - "wasm-encoder 0.236.1", - "wasm-metadata 0.236.1", - "wasmparser 0.236.1", + "wasm-encoder 0.239.0", + "wasm-metadata 0.239.0", + "wasmparser 0.239.0", "wit-component", "wit-parser", ] @@ -4979,7 +4952,7 @@ name = "spin-factor-outbound-redis" version = "3.5.0-pre0" dependencies = [ "anyhow", - "redis 0.25.4", + "redis", "spin-core", "spin-factor-outbound-networking", "spin-factors", @@ -5091,7 +5064,7 @@ name = "spin-key-value-redis" version = "3.5.0-pre0" dependencies = [ "anyhow", - "redis 0.29.5", + "redis", "serde", "spin-core", "spin-factor-key-value", @@ -5687,7 +5660,7 @@ dependencies = [ "parking_lot", "pin-project-lite", "signal-hook-registry", - "socket2", + "socket2 0.5.9", "tokio-macros", "windows-sys 0.52.0", ] @@ -5733,7 +5706,7 @@ dependencies = [ "postgres-protocol", "postgres-types", "rand 0.8.5", - "socket2", + "socket2 0.5.9", "tokio", "tokio-util", "whoami", @@ -5860,7 +5833,7 @@ dependencies = [ "percent-encoding", "pin-project", "prost 0.13.5", - "socket2", + "socket2 0.5.9", "tokio", "tokio-stream", "tower 0.4.13", @@ -6351,12 +6324,12 @@ dependencies = [ [[package]] name = "wasm-encoder" -version = "0.236.1" +version = "0.239.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "724fccfd4f3c24b7e589d333fc0429c68042897a7e8a5f8694f31792471841e7" +checksum = "5be00faa2b4950c76fe618c409d2c3ea5a3c9422013e079482d78544bb2d184c" dependencies = [ "leb128fmt", - "wasmparser 0.236.1", + "wasmparser 0.239.0", ] [[package]] @@ -6380,9 +6353,9 @@ dependencies = [ [[package]] name = "wasm-metadata" -version = "0.236.1" +version = "0.239.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c909f94a49a8de3365f3c0344f064818f1e369ff1740c5b04f455f85d454768e" +checksum = "20b3ec880a9ac69ccd92fbdbcf46ee833071cf09f82bb005b2327c7ae6025ae2" dependencies = [ "anyhow", "auditable-serde", @@ -6393,8 +6366,8 @@ dependencies = [ "serde_json", "spdx", "url", - "wasm-encoder 0.236.1", - "wasmparser 0.236.1", + "wasm-encoder 0.239.0", + "wasmparser 0.239.0", ] [[package]] @@ -6442,9 +6415,9 @@ dependencies = [ [[package]] name = "wasmparser" -version = "0.236.1" +version = "0.239.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a9b1e81f3eb254cf7404a82cee6926a4a3ccc5aad80cc3d43608a070c67aa1d7" +checksum = "8c9d90bb93e764f6beabf1d02028c70a2156a6583e63ac4218dd07ef733368b0" dependencies = [ "bitflags 2.9.0", "hashbrown 0.15.2", @@ -6455,20 +6428,19 @@ dependencies = [ [[package]] name = "wasmprinter" -version = "0.236.1" +version = "0.239.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2df225df06a6df15b46e3f73ca066ff92c2e023670969f7d50ce7d5e695abbb1" +checksum = "b3981f3d51f39f24f5fc90f93049a90f08dbbca8deba602cd46bb8ca67a94718" dependencies = [ "anyhow", "termcolor", - "wasmparser 0.236.1", + "wasmparser 0.239.0", ] [[package]] name = "wasmtime" -version = "36.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "72eb410993c268be048b7745a49649e3390348b0fe9ee050253a74a79192574f" +version = "37.0.0" +source = "git+https://github.com/bytecodealliance/wasmtime?branch=release-37.0.0#cda17438e06e49a037a24800a9ec0034d708b5b7" dependencies = [ "addr2line 0.25.0", "anyhow", @@ -6499,8 +6471,8 @@ dependencies = [ "serde_json", "smallvec", "target-lexicon", - "wasm-encoder 0.236.1", - "wasmparser 0.236.1", + "wasm-encoder 0.239.0", + "wasmparser 0.239.0", "wasmtime-environ", "wasmtime-internal-asm-macros", "wasmtime-internal-cache", @@ -6521,9 +6493,8 @@ dependencies = [ [[package]] name = "wasmtime-environ" -version = "36.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "88d3047dfcd4c0eeb2dbd9d639dd4eef65cbe53f17211c549543f208466246ed" +version = "37.0.0" +source = "git+https://github.com/bytecodealliance/wasmtime?branch=release-37.0.0#cda17438e06e49a037a24800a9ec0034d708b5b7" dependencies = [ "anyhow", "cpp_demangle", @@ -6540,26 +6511,24 @@ dependencies = [ "serde_derive", "smallvec", "target-lexicon", - "wasm-encoder 0.236.1", - "wasmparser 0.236.1", + "wasm-encoder 0.239.0", + "wasmparser 0.239.0", "wasmprinter", "wasmtime-internal-component-util", ] [[package]] name = "wasmtime-internal-asm-macros" -version = "36.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "82c3ac22f7209c35a913b4423a9f83fc12b74239af3cb5ac6c39a5df34e1970b" +version = "37.0.0" +source = "git+https://github.com/bytecodealliance/wasmtime?branch=release-37.0.0#cda17438e06e49a037a24800a9ec0034d708b5b7" dependencies = [ "cfg-if", ] [[package]] name = "wasmtime-internal-cache" -version = "36.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dbd49572a149c84a28079a0fb06f2c67c6290e75405f71855e943e4bb4703ae0" +version = "37.0.0" +source = "git+https://github.com/bytecodealliance/wasmtime?branch=release-37.0.0#cda17438e06e49a037a24800a9ec0034d708b5b7" dependencies = [ "anyhow", "base64 0.22.1", @@ -6577,9 +6546,8 @@ dependencies = [ [[package]] name = "wasmtime-internal-component-macro" -version = "36.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0badcd2acaa2901910a2ec0815abd24b80ffeecb5683029082e26220be2b44c5" +version = "37.0.0" +source = "git+https://github.com/bytecodealliance/wasmtime?branch=release-37.0.0#cda17438e06e49a037a24800a9ec0034d708b5b7" dependencies = [ "anyhow", "proc-macro2", @@ -6592,15 +6560,13 @@ dependencies = [ [[package]] name = "wasmtime-internal-component-util" -version = "36.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "399a9f4d25c0dcf4829751cbb63de438f3b715abc49277c15c86460539f4a7e7" +version = "37.0.0" +source = "git+https://github.com/bytecodealliance/wasmtime?branch=release-37.0.0#cda17438e06e49a037a24800a9ec0034d708b5b7" [[package]] name = "wasmtime-internal-cranelift" -version = "36.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "41370ede67231853b2f96a7f03b8e3db61802ad3ee0d7497b366f815e616f4fc" +version = "37.0.0" +source = "git+https://github.com/bytecodealliance/wasmtime?branch=release-37.0.0#cda17438e06e49a037a24800a9ec0034d708b5b7" dependencies = [ "anyhow", "cfg-if", @@ -6617,17 +6583,17 @@ dependencies = [ "smallvec", "target-lexicon", "thiserror 2.0.12", - "wasmparser 0.236.1", + "wasmparser 0.239.0", "wasmtime-environ", "wasmtime-internal-math", + "wasmtime-internal-unwinder", "wasmtime-internal-versioned-export-macros", ] [[package]] name = "wasmtime-internal-fiber" -version = "36.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6baf30fe62eb18fdc83395011ebd32dd74af3e86cecffb74dec05d8af2243515" +version = "37.0.0" +source = "git+https://github.com/bytecodealliance/wasmtime?branch=release-37.0.0#cda17438e06e49a037a24800a9ec0034d708b5b7" dependencies = [ "anyhow", "cc", @@ -6641,9 +6607,8 @@ dependencies = [ [[package]] name = "wasmtime-internal-jit-debug" -version = "36.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "416e2d2193073fe65355315bd144a9a26cbdf1f0c27faa7fdd3266a09b2689d3" +version = "37.0.0" +source = "git+https://github.com/bytecodealliance/wasmtime?branch=release-37.0.0#cda17438e06e49a037a24800a9ec0034d708b5b7" dependencies = [ "cc", "object 0.37.3", @@ -6653,9 +6618,8 @@ dependencies = [ [[package]] name = "wasmtime-internal-jit-icache-coherence" -version = "36.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b787315e8acb988ce5da8439ce827f84a01b912d3b157aafe0ddd8779fef219e" +version = "37.0.0" +source = "git+https://github.com/bytecodealliance/wasmtime?branch=release-37.0.0#cda17438e06e49a037a24800a9ec0034d708b5b7" dependencies = [ "anyhow", "cfg-if", @@ -6665,24 +6629,21 @@ dependencies = [ [[package]] name = "wasmtime-internal-math" -version = "36.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08d8b81a4083aa76d3cd3ebf24f0564b6d17d4faffd47c42dd218798aa5894d4" +version = "37.0.0" +source = "git+https://github.com/bytecodealliance/wasmtime?branch=release-37.0.0#cda17438e06e49a037a24800a9ec0034d708b5b7" dependencies = [ "libm", ] [[package]] name = "wasmtime-internal-slab" -version = "36.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e701cdea321a3c288990dcc1ed7b4c89d120e10bf50052e942243251e710c42" +version = "37.0.0" +source = "git+https://github.com/bytecodealliance/wasmtime?branch=release-37.0.0#cda17438e06e49a037a24800a9ec0034d708b5b7" [[package]] name = "wasmtime-internal-unwinder" -version = "36.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "60ddcc1b024ae8e16f043b0dbea676048f3b710efbaa63f2647bc287315b8704" +version = "37.0.0" +source = "git+https://github.com/bytecodealliance/wasmtime?branch=release-37.0.0#cda17438e06e49a037a24800a9ec0034d708b5b7" dependencies = [ "anyhow", "cfg-if", @@ -6693,9 +6654,8 @@ dependencies = [ [[package]] name = "wasmtime-internal-versioned-export-macros" -version = "36.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e4bd56c30d60d617935d1a68272223341b67c27fb3776fee025e481f3ac53cd0" +version = "37.0.0" +source = "git+https://github.com/bytecodealliance/wasmtime?branch=release-37.0.0#cda17438e06e49a037a24800a9ec0034d708b5b7" dependencies = [ "proc-macro2", "quote", @@ -6704,16 +6664,16 @@ dependencies = [ [[package]] name = "wasmtime-internal-winch" -version = "36.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e9a56b31bc1c5b6a62cb400e996947944a3a0545dc8e11790964074269876137" +version = "37.0.0" +source = "git+https://github.com/bytecodealliance/wasmtime?branch=release-37.0.0#cda17438e06e49a037a24800a9ec0034d708b5b7" dependencies = [ "anyhow", "cranelift-codegen", "gimli 0.32.0", + "log", "object 0.37.3", "target-lexicon", - "wasmparser 0.236.1", + "wasmparser 0.239.0", "wasmtime-environ", "wasmtime-internal-cranelift", "winch-codegen", @@ -6721,9 +6681,8 @@ dependencies = [ [[package]] name = "wasmtime-internal-wit-bindgen" -version = "36.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8c9816c753aaa5591c45f3ccfb9f2ecf9ea9bbffabc1ad628818803bd12e34ba" +version = "37.0.0" +source = "git+https://github.com/bytecodealliance/wasmtime?branch=release-37.0.0#cda17438e06e49a037a24800a9ec0034d708b5b7" dependencies = [ "anyhow", "bitflags 2.9.0", @@ -6734,9 +6693,8 @@ dependencies = [ [[package]] name = "wasmtime-wasi" -version = "36.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c43f4163d631ecb72245b34aae03f5a0b07e58c2004692b4258caf8bf7aacca5" +version = "37.0.0" +source = "git+https://github.com/bytecodealliance/wasmtime?branch=release-37.0.0#cda17438e06e49a037a24800a9ec0034d708b5b7" dependencies = [ "anyhow", "async-trait", @@ -6765,9 +6723,8 @@ dependencies = [ [[package]] name = "wasmtime-wasi-http" -version = "36.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9a9730c0a3f24c25a8fa40fecbd4a1a3e77dff5bb730d98e16861c9dfcc2ca33" +version = "37.0.0" +source = "git+https://github.com/bytecodealliance/wasmtime?branch=release-37.0.0#cda17438e06e49a037a24800a9ec0034d708b5b7" dependencies = [ "anyhow", "async-trait", @@ -6789,9 +6746,8 @@ dependencies = [ [[package]] name = "wasmtime-wasi-io" -version = "36.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a6a1700b7b7a2b9b704ed9501745798e3791f575ee6973d7d821e2386a94adbf" +version = "37.0.0" +source = "git+https://github.com/bytecodealliance/wasmtime?branch=release-37.0.0#cda17438e06e49a037a24800a9ec0034d708b5b7" dependencies = [ "anyhow", "async-trait", @@ -6811,24 +6767,24 @@ dependencies = [ [[package]] name = "wast" -version = "236.0.1" +version = "239.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d3bec4b4db9c6808d394632fd4b0cd4654c32c540bd3237f55ee6a40fff6e51f" +checksum = "9139176fe8a2590e0fb174cdcaf373b224cb93c3dde08e4297c1361d2ba1ea5d" dependencies = [ "bumpalo", "leb128fmt", "memchr", "unicode-width", - "wasm-encoder 0.236.1", + "wasm-encoder 0.239.0", ] [[package]] name = "wat" -version = "1.236.1" +version = "1.239.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "64475e2f77d6071ce90624098fc236285ddafa8c3ea1fb386f2c4154b6c2bbdb" +checksum = "3e1c941927d34709f255558166f8901a2005f8ab4a9650432e9281b7cc6f3b75" dependencies = [ - "wast 236.0.1", + "wast 239.0.0", ] [[package]] @@ -6873,9 +6829,8 @@ dependencies = [ [[package]] name = "wiggle" -version = "36.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0047009d1851c65dfeb197ff53a1d1bf94358d56604ac5e9419397ba381bfa17" +version = "37.0.0" +source = "git+https://github.com/bytecodealliance/wasmtime?branch=release-37.0.0#cda17438e06e49a037a24800a9ec0034d708b5b7" dependencies = [ "anyhow", "async-trait", @@ -6888,9 +6843,8 @@ dependencies = [ [[package]] name = "wiggle-generate" -version = "36.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "af67f0f2a0e2e7841e9a561aff21cec8f6125b5b8d2c43adecc974e36e9cbbd9" +version = "37.0.0" +source = "git+https://github.com/bytecodealliance/wasmtime?branch=release-37.0.0#cda17438e06e49a037a24800a9ec0034d708b5b7" dependencies = [ "anyhow", "heck 0.5.0", @@ -6902,9 +6856,8 @@ dependencies = [ [[package]] name = "wiggle-macro" -version = "36.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c6f1ed189ba5962988a017f86bc73b03cc69e1b8d3040922beab307855ce594d" +version = "37.0.0" +source = "git+https://github.com/bytecodealliance/wasmtime?branch=release-37.0.0#cda17438e06e49a037a24800a9ec0034d708b5b7" dependencies = [ "proc-macro2", "quote", @@ -6945,9 +6898,8 @@ checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" [[package]] name = "winch-codegen" -version = "36.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "88ac81262abfb835f3f46f64715863fa2737c2928fab58db74ec98710e3e261a" +version = "37.0.0" +source = "git+https://github.com/bytecodealliance/wasmtime?branch=release-37.0.0#cda17438e06e49a037a24800a9ec0034d708b5b7" dependencies = [ "anyhow", "cranelift-assembler-x64", @@ -6957,7 +6909,7 @@ dependencies = [ "smallvec", "target-lexicon", "thiserror 2.0.12", - "wasmparser 0.236.1", + "wasmparser 0.239.0", "wasmtime-environ", "wasmtime-internal-cranelift", "wasmtime-internal-math", @@ -7270,9 +7222,9 @@ dependencies = [ [[package]] name = "wit-component" -version = "0.236.1" +version = "0.239.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3622959ed7ed6341c38e5aa35af243632534b0a36226852faa802939ce11e00f" +checksum = "88a866b19dba2c94d706ec58c92a4c62ab63e482b4c935d2a085ac94caecb136" dependencies = [ "anyhow", "bitflags 2.9.0", @@ -7281,17 +7233,17 @@ dependencies = [ "serde", "serde_derive", "serde_json", - "wasm-encoder 0.236.1", - "wasm-metadata 0.236.1", - "wasmparser 0.236.1", + "wasm-encoder 0.239.0", + "wasm-metadata 0.239.0", + "wasmparser 0.239.0", "wit-parser", ] [[package]] name = "wit-parser" -version = "0.236.1" +version = "0.239.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "16e4833a20cd6e85d6abfea0e63a399472d6f88c6262957c17f546879a80ba15" +checksum = "55c92c939d667b7bf0c6bf2d1f67196529758f99a2a45a3355cc56964fd5315d" dependencies = [ "anyhow", "id-arena", @@ -7302,7 +7254,7 @@ dependencies = [ "serde_derive", "serde_json", "unicode-xid", - "wasmparser 0.236.1", + "wasmparser 0.239.0", ] [[package]] diff --git a/examples/spin-timer/Cargo.toml b/examples/spin-timer/Cargo.toml index a9aaa6873..754a6ec55 100644 --- a/examples/spin-timer/Cargo.toml +++ b/examples/spin-timer/Cargo.toml @@ -13,6 +13,6 @@ spin-runtime-factors = { path = "../../crates/runtime-factors" } spin-trigger = { path = "../../crates/trigger" } tokio = { version = "1", features = ["full"] } tokio-scoped = "0.2.0" -wasmtime = "36.0.2" +wasmtime = { git = "https://github.com/bytecodealliance/wasmtime", branch = "release-37.0.0" } [workspace]