diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml new file mode 100644 index 00000000..3fbc60a9 --- /dev/null +++ b/.github/workflows/rust.yml @@ -0,0 +1,56 @@ +name: rust + +on: + merge_group: + push: + branches: + - main + + pull_request: + branches: + - main + +defaults: + run: + shell: bash + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +jobs: + build: + runs-on: ubuntu-latest + strategy: + matrix: + projects: + - folder: component-model/examples/example-host + - folder: component-model/examples/tutorial/adder + type: component + - folder: component-model/examples/tutorial/calculator + type: component + - folder: component-model/examples/tutorial/command + type: component + steps: + - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 + + - name: Install Rust + run: rustup update stable --no-self-update + + - uses: taiki-e/cache-cargo-install-action@5c9abe9a3f79d831011df7c47177debbeb320405 # v2.1.2 + with: + tool: cargo-component + + - uses: Swatinem/rust-cache@9d47c6ad4b02e050fd481d890b2ea34778fd09d6 # v2.7.8 + with: + shared-key: ${{ hashFiles('${{ matrix.projects.folder }}/Cargo.lock') }} + + - name: Cargo bulid the package + working-directory: ${{ matrix.projects.folder }} + if: ${{ matrix.projects.type != 'component' }} + run: cargo build + + - name: Cargo component build + working-directory: ${{ matrix.projects.folder }} + if: ${{ matrix.projects.type == 'component' }} + run: cargo component build diff --git a/component-model/examples/example-host/Cargo.lock b/component-model/examples/example-host/Cargo.lock index 8ddce8a4..a1de19bc 100644 --- a/component-model/examples/example-host/Cargo.lock +++ b/component-model/examples/example-host/Cargo.lock @@ -18,16 +18,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "512761e0bb2578dd7380c6baaa0f4ce03e84f95e960231d1dec8bf4d7d6e2627" [[package]] -name = "ahash" -version = "0.8.11" +name = "allocator-api2" +version = "0.2.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e89da841a80418a9b391ebaea17f5c112ffaaa96f621d2c285b5174da76b9011" -dependencies = [ - "cfg-if", - "once_cell", - "version_check", - "zerocopy", -] +checksum = "683d7910e743518b0e34f1186f92494becacb047c7b6bf616c96772180fef923" [[package]] name = "ambient-authority" @@ -179,7 +173,7 @@ dependencies = [ "futures-lite", "parking", "polling", - "rustix", + "rustix 0.38.41", "slab", "tracing", "windows-sys 0.59.0", @@ -269,9 +263,9 @@ dependencies = [ [[package]] name = "base64" -version = "0.21.7" +version = "0.22.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d297deb1925b89f2ccc13d7635fa0714f12c87adce1c75356b39ca9b7178567" +checksum = "72b3254f16251a8381aa12e40e3c4d2f0199f8c6508fbecb9d91f575e0fbb8c6" [[package]] name = "bitflags" @@ -306,6 +300,9 @@ name = "bumpalo" version = "3.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "79296716171880943b8470b5f8d03aa55eb2e645a4874bdbb28adb49162e012c" +dependencies = [ + "allocator-api2", +] [[package]] name = "byteorder" @@ -321,33 +318,33 @@ checksum = "325918d6fe32f23b19878fe4b34794ae41fc19ddbe53b10571a4874d44ffd39b" [[package]] name = "cap-fs-ext" -version = "3.4.1" +version = "3.4.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e16619ada836f12897a72011fe99b03f0025b87a8dbbea4f3c9f89b458a23bf3" +checksum = "e41cc18551193fe8fa6f15c1e3c799bc5ec9e2cfbfaa8ed46f37013e3e6c173c" dependencies = [ "cap-primitives", "cap-std", "io-lifetimes", - "windows-sys 0.52.0", + "windows-sys 0.59.0", ] [[package]] name = "cap-net-ext" -version = "3.4.1" +version = "3.4.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "710b0eb776410a22c89a98f2f80b2187c2ac3a8206b99f3412332e63c9b09de0" +checksum = "9f83833816c66c986e913b22ac887cec216ea09301802054316fc5301809702c" dependencies = [ "cap-primitives", "cap-std", - "rustix", + "rustix 1.0.7", "smallvec", ] [[package]] name = "cap-primitives" -version = "3.4.1" +version = "3.4.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "82fa6c3f9773feab88d844aa50035a33fb6e7e7426105d2f4bb7aadc42a5f89a" +checksum = "0a1e394ed14f39f8bc26f59d4c0c010dbe7f0a1b9bafff451b1f98b67c8af62a" dependencies = [ "ambient-authority", "fs-set-times", @@ -355,16 +352,17 @@ dependencies = [ "io-lifetimes", "ipnet", "maybe-owned", - "rustix", - "windows-sys 0.52.0", + "rustix 1.0.7", + "rustix-linux-procfs", + "windows-sys 0.59.0", "winx", ] [[package]] name = "cap-rand" -version = "3.4.1" +version = "3.4.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "53774d49369892b70184f8312e50c1b87edccb376691de4485b0ff554b27c36c" +checksum = "0acb89ccf798a28683f00089d0630dfaceec087234eae0d308c05ddeaa941b40" dependencies = [ "ambient-authority", "rand", @@ -372,27 +370,27 @@ dependencies = [ [[package]] name = "cap-std" -version = "3.4.1" +version = "3.4.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f71b70818556b4fe2a10c7c30baac3f5f45e973f49fc2673d7c75c39d0baf5b" +checksum = "07c0355ca583dd58f176c3c12489d684163861ede3c9efa6fd8bba314c984189" dependencies = [ "cap-primitives", "io-extras", "io-lifetimes", - "rustix", + "rustix 1.0.7", ] [[package]] name = "cap-time-ext" -version = "3.4.1" +version = "3.4.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "69dd48afa2363f746c93f961c211f6f099fb594a3446b8097bc5f79db51b6816" +checksum = "491af520b8770085daa0466978c75db90368c71896523f2464214e38359b1a5b" dependencies = [ "ambient-authority", "cap-primitives", "iana-time-zone", "once_cell", - "rustix", + "rustix 1.0.7", "winx", ] @@ -498,20 +496,38 @@ dependencies = [ "libc", ] +[[package]] +name = "cranelift-assembler-x64" +version = "0.121.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "226b7077389885873ffad5d778e8512742580a6e11b0f723072f41f305d3652f" +dependencies = [ + "cranelift-assembler-x64-meta", +] + +[[package]] +name = "cranelift-assembler-x64-meta" +version = "0.121.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e9cfeae5a23c8cf9c43381f49211f3ce6dc1da1d46f1c5d06966e6258cc483fa" +dependencies = [ + "cranelift-srcgen", +] + [[package]] name = "cranelift-bforest" -version = "0.114.0" +version = "0.121.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2ba4f80548f22dc9c43911907b5e322c5555544ee85f785115701e6a28c9abe1" +checksum = "8c88c577c6af92b550cb83455c331cf8e1bc89fe0ccc3e7eb0fa617ed1d63056" dependencies = [ "cranelift-entity", ] [[package]] name = "cranelift-bitset" -version = "0.114.0" +version = "0.121.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "005884e3649c3e5ff2dc79e8a94b138f11569cc08a91244a292714d2a86e9156" +checksum = "370f0aa7f1816bf0f838048d69b72d6cf12ef2fc3b37f6997fe494ffb9feb3ad" dependencies = [ "serde", "serde_derive", @@ -519,11 +535,12 @@ dependencies = [ [[package]] name = "cranelift-codegen" -version = "0.114.0" +version = "0.121.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fe4036255ec33ce9a37495dfbcfc4e1118fd34e693eff9a1e106336b7cd16a9b" +checksum = "7d1a10a8a2958b68ecd261e565eef285249e242a8447ac959978319eabbb4a55" dependencies = [ "bumpalo", + "cranelift-assembler-x64", "cranelift-bforest", "cranelift-bitset", "cranelift-codegen-meta", @@ -532,44 +549,49 @@ dependencies = [ "cranelift-entity", "cranelift-isle", "gimli", - "hashbrown 0.14.5", + "hashbrown", "log", + "pulley-interpreter", "regalloc2", "rustc-hash", "serde", "smallvec", "target-lexicon", + "wasmtime-math", ] [[package]] name = "cranelift-codegen-meta" -version = "0.114.0" +version = "0.121.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f7ca74f4b68319da11d39e894437cb6e20ec7c2e11fbbda823c3bf207beedff7" +checksum = "f319986d5ae1386cfec625c70f8c01e52dc1f910aa6aaee7740bf8842d4e19c7" dependencies = [ + "cranelift-assembler-x64-meta", "cranelift-codegen-shared", + "cranelift-srcgen", + "pulley-interpreter", ] [[package]] name = "cranelift-codegen-shared" -version = "0.114.0" +version = "0.121.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "897e54f433a0269c4187871aa06d452214d5515d228d5bdc22219585e9eef895" +checksum = "ed52f5660397039c3c741c3acf18746445f4e20629b7280d9f2ccfe57e2b1efd" [[package]] name = "cranelift-control" -version = "0.114.0" +version = "0.121.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "29cb4018f5bf59fb53f515fa9d80e6f8c5ce19f198dc538984ebd23ecf8965ec" +checksum = "79bde8d48e1840702574e28c5d7d4499441435af71e6c47450881f84ce2b60a5" dependencies = [ "arbitrary", ] [[package]] name = "cranelift-entity" -version = "0.114.0" +version = "0.121.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "305399fd781a2953ac78c1396f02ff53144f39c33eb7fc7789cf4e8936d13a96" +checksum = "e0335ac187211ac94c254826b6e78d23b8654ae09ebf0830506a827a2647162f" dependencies = [ "cranelift-bitset", "serde", @@ -578,9 +600,9 @@ dependencies = [ [[package]] name = "cranelift-frontend" -version = "0.114.0" +version = "0.121.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9230b460a128d53653456137751d27baf567947a3ab8c0c4d6e31fd08036d81e" +checksum = "f4fce5fcf93c1fece95d0175b15fbaf0808b187430bc06c8ecde80db0ed58c5e" dependencies = [ "cranelift-codegen", "log", @@ -590,21 +612,27 @@ dependencies = [ [[package]] name = "cranelift-isle" -version = "0.114.0" +version = "0.121.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b961e24ae3ec9813a24a15ae64bbd2a42e4de4d79a7f3225a412e3b94e78d1c8" +checksum = "13fc8d838a2bf28438dbaf6ccdbc34531b6a972054f43fd23be7f124121ce6e0" [[package]] name = "cranelift-native" -version = "0.114.0" +version = "0.121.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4d5bd76df6c9151188dfa428c863b33da5b34561b67f43c0cf3f24a794f9fa1f" +checksum = "0975ce66adcf2e0729d06b1d3efea0398d793d1f39c2e0a6f52a347537836693" dependencies = [ "cranelift-codegen", "libc", "target-lexicon", ] +[[package]] +name = "cranelift-srcgen" +version = "0.121.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b4493a9b500bb02837ea2fb7d4b58c1c21c37a470ae33c92659f4e637aad14c9" + [[package]] name = "crc32fast" version = "1.4.2" @@ -678,26 +706,6 @@ dependencies = [ "dirs-sys-next", ] -[[package]] -name = "dirs" -version = "4.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca3aa72a6f96ea37bbc5aa912f6788242832f75369bdfdadcb0e38423f100059" -dependencies = [ - "dirs-sys", -] - -[[package]] -name = "dirs-sys" -version = "0.3.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1b1d1d91c932ef41c0f2663aa8b0ca0342d444d842c06914aa0a7e352d0bada6" -dependencies = [ - "libc", - "redox_users", - "winapi", -] - [[package]] name = "dirs-sys-next" version = "0.1.2" @@ -820,7 +828,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7e5768da2206272c81ef0b5e951a41862938a6070da63bcea197899942d3b947" dependencies = [ "cfg-if", - "rustix", + "rustix 0.38.41", "windows-sys 0.52.0", ] @@ -846,7 +854,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "033b337d725b97690d86893f9de22b67b80dcc4e9ad815f348254c38119db8fb" dependencies = [ "io-lifetimes", - "rustix", + "rustix 0.38.41", "windows-sys 0.52.0", ] @@ -990,16 +998,6 @@ dependencies = [ "wasm-bindgen", ] -[[package]] -name = "hashbrown" -version = "0.14.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e5274423e17b7c9fc20b6e7e208532f9b19825d82dfd615708b70edd83df41f1" -dependencies = [ - "ahash", - "serde", -] - [[package]] name = "hashbrown" version = "0.15.2" @@ -1007,6 +1005,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bf151400ff0baff5465007dd2f3e717f3fe502074ca563069ce3a6629d07b289" dependencies = [ "foldhash", + "serde", ] [[package]] @@ -1197,12 +1196,12 @@ dependencies = [ [[package]] name = "indexmap" -version = "2.6.0" +version = "2.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "707907fe3c25f5424cce2cb7e1cbcafee6bdbe735ca90ef77c29e84591e5b9da" +checksum = "fe4cd85333e22411419a0bcae1297d25e58c9443848b11dc6a86fefe8c78a661" dependencies = [ "equivalent", - "hashbrown 0.15.2", + "hashbrown", "serde", ] @@ -1236,9 +1235,9 @@ checksum = "7943c866cc5cd64cbc25b2e01621d07fa8eb2a1a23160ee81ce38704e97b8ecf" [[package]] name = "itertools" -version = "0.12.1" +version = "0.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba291022dbbd398a455acf126c1e341954079855bc60dfdda641363bd6922569" +checksum = "2b192c782037fadd9cfa75548310488aabdbf3d2da73885b31bd0abd03351285" dependencies = [ "either", ] @@ -1302,11 +1301,17 @@ version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "884e2677b40cc8c339eaefcb701c32ef1fd2493d71118dc0ca4b6a736c93bd67" +[[package]] +name = "leb128fmt" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09edd9e8b54e49e587e4f6295a7d29c3ea94d469cb40ab8ca70b288248a81db2" + [[package]] name = "libc" -version = "0.2.166" +version = "0.2.174" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c2ccc108bbc0b1331bd061864e7cd823c0cab660bbe6970e66e2c0614decde36" +checksum = "1171693293099992e19cddea4e8b849964e9846f4acee11b3948bcc337be8776" [[package]] name = "libm" @@ -1330,6 +1335,12 @@ version = "0.4.14" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "78b3ae25bc7c8c38cec158d1f2757ee79e9b3740fbc7ccf0e59e4b08d793fa89" +[[package]] +name = "linux-raw-sys" +version = "0.9.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cd945864f07fe9f5371a27ad7b52a172b4b499999f1d97574c9fa68373937e12" + [[package]] name = "litemap" version = "0.7.4" @@ -1372,7 +1383,7 @@ version = "0.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b2cffa4ad52c6f791f4f8b15f0c05f9824b2ced1160e88cc393d64fff9a8ac64" dependencies = [ - "rustix", + "rustix 0.38.41", ] [[package]] @@ -1403,7 +1414,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "aedf0a2d09c573ed1d8d85b30c119153926a2b36dce0ab28322c09a117a4683e" dependencies = [ "crc32fast", - "hashbrown 0.15.2", + "hashbrown", "indexmap", "memchr", ] @@ -1420,12 +1431,6 @@ version = "2.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f38d5652c16fde515bb1ecef450ab0f6a219d619a7274976324d5e377f7dceba" -[[package]] -name = "paste" -version = "1.0.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "57c0d7b74b563b49d38dae00a0c37d4d6de9b432382b2892f0574ddcae73fd0a" - [[package]] name = "percent-encoding" version = "2.3.1" @@ -1471,7 +1476,7 @@ dependencies = [ "concurrent-queue", "hermit-abi 0.4.0", "pin-project-lite", - "rustix", + "rustix 0.38.41", "tracing", "windows-sys 0.59.0", ] @@ -1517,13 +1522,25 @@ dependencies = [ [[package]] name = "pulley-interpreter" -version = "27.0.0" +version = "34.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a3b8d81cf799e20564931e9867ca32de545188c6ee4c2e0f6e41d32f0c7dc6fb" +checksum = "fe0e8f39bc99694ce6fc8df7df7ed258d38d255a9268e2ff964f67f4a6588cdb" dependencies = [ "cranelift-bitset", "log", - "sptr", + "pulley-macros", + "wasmtime-math", +] + +[[package]] +name = "pulley-macros" +version = "34.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9276d404009cc49f3b8befeb8ffc1d868c5ea732bd9d72ab3e64231187f908c5" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.89", ] [[package]] @@ -1593,19 +1610,20 @@ checksum = "ba009ff324d1fc1b900bd1fdb31564febe58a8ccc8a6fdbb93b543d33b13ca43" dependencies = [ "getrandom", "libredox", - "thiserror", + "thiserror 1.0.69", ] [[package]] name = "regalloc2" -version = "0.10.2" +version = "0.12.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "12908dbeb234370af84d0579b9f68258a0f67e201412dd9a2814e6f45b2fc0f0" +checksum = "5216b1837de2149f8bc8e6d5f88a9326b63b8c836ed58ce4a0a29ec736a59734" dependencies = [ - "hashbrown 0.14.5", + "allocator-api2", + "bumpalo", + "hashbrown", "log", "rustc-hash", - "slice-group-by", "smallvec", ] @@ -1629,13 +1647,34 @@ checksum = "d7f649912bc1495e167a6edee79151c84b1bad49748cb4f1f1167f459f6224f6" dependencies = [ "bitflags", "errno", - "itoa", "libc", - "linux-raw-sys", - "once_cell", + "linux-raw-sys 0.4.14", "windows-sys 0.52.0", ] +[[package]] +name = "rustix" +version = "1.0.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c71e83d6afe7ff64890ec6b71d6a69bb8a610ab78ce364b3352876bb4c801266" +dependencies = [ + "bitflags", + "errno", + "libc", + "linux-raw-sys 0.9.4", + "windows-sys 0.59.0", +] + +[[package]] +name = "rustix-linux-procfs" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2fc84bf7e9aa16c4f2c758f27412dc9841341e16aa682d9c7ac308fe3ee12056" +dependencies = [ + "once_cell", + "rustix 1.0.7", +] + [[package]] name = "ryu" version = "1.0.18" @@ -1703,15 +1742,6 @@ dependencies = [ "digest", ] -[[package]] -name = "shellexpand" -version = "2.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ccc8076840c4da029af4f87e4e8daeb0fca6b87bbb02e10cb60b791450e11e4" -dependencies = [ - "dirs", -] - [[package]] name = "shlex" version = "1.3.0" @@ -1727,12 +1757,6 @@ dependencies = [ "autocfg", ] -[[package]] -name = "slice-group-by" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "826167069c09b99d56f31e9ae5c99049e932a98c9dc2dac47645b08dbbf76ba7" - [[package]] name = "smallvec" version = "1.13.2" @@ -1752,12 +1776,6 @@ dependencies = [ "windows-sys 0.52.0", ] -[[package]] -name = "sptr" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3b9b39299b249ad65f3b7e96443bad61c02ca5cd3589f46cb6d610a0fd6c0d6a" - [[package]] name = "stable_deref_trait" version = "1.2.0" @@ -1814,16 +1832,16 @@ dependencies = [ "cap-std", "fd-lock", "io-lifetimes", - "rustix", + "rustix 0.38.41", "windows-sys 0.52.0", "winx", ] [[package]] name = "target-lexicon" -version = "0.12.16" +version = "0.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "61c41af27dd6d1e27b1b16b489db798443478cef1f06a660c96db617ba5de3b1" +checksum = "e502f78cdbb8ba4718f566c418c52bc729126ffd16baee5baa718cf25dd5a69a" [[package]] name = "termcolor" @@ -1840,7 +1858,16 @@ version = "1.0.69" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b6aaf5339b578ea85b50e080feb250a3e8ae8cfcdff9a461c9ec2904bc923f52" dependencies = [ - "thiserror-impl", + "thiserror-impl 1.0.69", +] + +[[package]] +name = "thiserror" +version = "2.0.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "567b8a2dae586314f7be2a752ec7474332959c6460e02bde30d702a66d488708" +dependencies = [ + "thiserror-impl 2.0.12", ] [[package]] @@ -1854,6 +1881,17 @@ dependencies = [ "syn 2.0.89", ] +[[package]] +name = "thiserror-impl" +version = "2.0.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f7cf42b4507d8ea322120659672cf1b9dbb93f8f2d4ecfd6e51350ff5b17a1d" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.89", +] + [[package]] name = "tinystr" version = "0.7.6" @@ -1944,6 +1982,17 @@ dependencies = [ "once_cell", ] +[[package]] +name = "trait-variant" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "70977707304198400eb4835a78f6a9f928bf41bba420deb8fdb175cd965d77a7" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.89", +] + [[package]] name = "typenum" version = "1.17.0" @@ -2090,33 +2139,32 @@ checksum = "65fc09f10666a9f147042251e0dda9c18f166ff7de300607007e96bdebc1068d" [[package]] name = "wasm-encoder" -version = "0.219.1" +version = "0.233.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "29cbbd772edcb8e7d524a82ee8cef8dd046fc14033796a754c3ad246d019fa54" +checksum = "9679ae3cf7cfa2ca3a327f7fab97f27f3294d402fd1a76ca8ab514e17973e4d3" dependencies = [ - "leb128", - "wasmparser 0.219.1", + "leb128fmt", + "wasmparser 0.233.0", ] [[package]] name = "wasm-encoder" -version = "0.221.0" +version = "0.235.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "de35b6c3ef1f53ac7a31b5e69bc00f1542ea337e7e7162dc34c68b537ff82690" +checksum = "b3bc393c395cb621367ff02d854179882b9a351b4e0c93d1397e6090b53a5c2a" dependencies = [ - "leb128", - "wasmparser 0.221.0", + "leb128fmt", + "wasmparser 0.235.0", ] [[package]] name = "wasmparser" -version = "0.219.1" +version = "0.233.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c771866898879073c53b565a6c7b49953795159836714ac56a5befb581227c5" +checksum = "b51cb03afce7964bbfce46602d6cb358726f36430b6ba084ac6020d8ce5bc102" dependencies = [ - "ahash", "bitflags", - "hashbrown 0.14.5", + "hashbrown", "indexmap", "semver", "serde", @@ -2124,9 +2172,9 @@ dependencies = [ [[package]] name = "wasmparser" -version = "0.221.0" +version = "0.235.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8659e755615170cfe20da468865c989da78c5da16d8652e69a75acda02406a92" +checksum = "161296c618fa2d63f6ed5fffd1112937e803cb9ec71b32b01a76321555660917" dependencies = [ "bitflags", "indexmap", @@ -2135,20 +2183,20 @@ dependencies = [ [[package]] name = "wasmprinter" -version = "0.219.1" +version = "0.233.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "228cdc1f30c27816da225d239ce4231f28941147d34713dee8f1fff7cb330e54" +checksum = "abf8e5b732895c99b21aa615f1b73352e51bbe2b2cb6c87eae7f990d07c1ac18" dependencies = [ "anyhow", "termcolor", - "wasmparser 0.219.1", + "wasmparser 0.233.0", ] [[package]] name = "wasmtime" -version = "27.0.0" +version = "34.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b79302e3e084713249cc5622e8608e7410afdeeea8c8026d04f491d1fab0b4b" +checksum = "2523d3347356a74e9c312c2c96e709c82d998dcafdca97f6d620e69c032fd043" dependencies = [ "addr2line", "anyhow", @@ -2160,31 +2208,29 @@ dependencies = [ "encoding_rs", "fxprof-processed-profile", "gimli", - "hashbrown 0.14.5", + "hashbrown", "indexmap", "ittapi", "libc", - "libm", "log", "mach2", "memfd", "object", "once_cell", - "paste", "postcard", "psm", "pulley-interpreter", "rayon", - "rustix", + "rustix 1.0.7", "semver", "serde", "serde_derive", "serde_json", "smallvec", - "sptr", "target-lexicon", - "wasm-encoder 0.219.1", - "wasmparser 0.219.1", + "trait-variant", + "wasm-encoder 0.233.0", + "wasmparser 0.233.0", "wasmtime-asm-macros", "wasmtime-cache", "wasmtime-component-macro", @@ -2194,6 +2240,7 @@ dependencies = [ "wasmtime-fiber", "wasmtime-jit-debug", "wasmtime-jit-icache-coherence", + "wasmtime-math", "wasmtime-slab", "wasmtime-versioned-export-macros", "wasmtime-winch", @@ -2203,25 +2250,25 @@ dependencies = [ [[package]] name = "wasmtime-asm-macros" -version = "27.0.0" +version = "34.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fe53a24e7016a5222875d8ca3ad6024b464465985693c42098cd0bb710002c28" +checksum = "7c45ecc343d3ad4629d5882e94f3b0f0fac22a043c07e64373381168ae00c259" dependencies = [ "cfg-if", ] [[package]] name = "wasmtime-cache" -version = "27.0.0" +version = "34.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0677a7e76c24746b68e3657f7cc50c0ff122ee7e97bbda6e710c1b790ebc93cb" +checksum = "3eb1976337108c8b9f80b05e9b909bf603f85c4ea97e31c112876a36d3cdcb98" dependencies = [ "anyhow", "base64", "directories-next", "log", "postcard", - "rustix", + "rustix 1.0.7", "serde", "serde_derive", "sha2", @@ -2232,9 +2279,9 @@ dependencies = [ [[package]] name = "wasmtime-component-macro" -version = "27.0.0" +version = "34.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e118acbd2bc09b32ad8606bc7cef793bf5019c1b107772e64dc6c76b5055d40b" +checksum = "3491c0f2511be561a92ac9b086351abc3a0f48c5f5f7d14f3975e246c13838be" dependencies = [ "anyhow", "proc-macro2", @@ -2247,15 +2294,15 @@ dependencies = [ [[package]] name = "wasmtime-component-util" -version = "27.0.0" +version = "34.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4a6db4f3ee18c699629eabb9c64e77efe5a93a5137f098db7cab295037ba41c2" +checksum = "26bc084e249f74e61c79077d8937c34fb0af223752b9b1725e3d7ed94b006f23" [[package]] name = "wasmtime-cranelift" -version = "27.0.0" +version = "34.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8b87e6c78f562b50aff1afd87ff32a57e241424c846c1c8f3c5fd352d2d62906" +checksum = "0010bd93362c634837e6bb13e213c2d83673b28dc12208b64ddd821fa55f7d33" dependencies = [ "anyhow", "cfg-if", @@ -2268,19 +2315,21 @@ dependencies = [ "itertools", "log", "object", + "pulley-interpreter", "smallvec", "target-lexicon", - "thiserror", - "wasmparser 0.219.1", + "thiserror 2.0.12", + "wasmparser 0.233.0", "wasmtime-environ", + "wasmtime-math", "wasmtime-versioned-export-macros", ] [[package]] name = "wasmtime-environ" -version = "27.0.0" +version = "34.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c25bfeaa16432d59a0706e2463d315ef4c9ebcfaf5605670b99d46373bdf9f27" +checksum = "36a035dc308ff6be3d790dafdc2e41a128415e20ad864580da49470073e21dc1" dependencies = [ "anyhow", "cpp_demangle", @@ -2297,22 +2346,23 @@ dependencies = [ "serde_derive", "smallvec", "target-lexicon", - "wasm-encoder 0.219.1", - "wasmparser 0.219.1", + "wasm-encoder 0.233.0", + "wasmparser 0.233.0", "wasmprinter", "wasmtime-component-util", ] [[package]] name = "wasmtime-fiber" -version = "27.0.0" +version = "34.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "759ab0caa3821a6211743fe1eed448ab9df439e3af6c60dea15486c055611806" +checksum = "fdc3c1e4e70cdd3a4572dff79062caa48988f7f1ccf6850d98a4e4c41bf3cfc8" dependencies = [ "anyhow", "cc", "cfg-if", - "rustix", + "libc", + "rustix 1.0.7", "wasmtime-asm-macros", "wasmtime-versioned-export-macros", "windows-sys 0.59.0", @@ -2320,20 +2370,21 @@ dependencies = [ [[package]] name = "wasmtime-jit-debug" -version = "27.0.0" +version = "34.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ab2a056056e9ac6916c2b8e4743408560300c1355e078c344211f13210d449b3" +checksum = "a5d83fa2dea686f76b5437b66045aae6351d359ee11cc4124f9842de63837b81" dependencies = [ + "cc", "object", - "rustix", + "rustix 1.0.7", "wasmtime-versioned-export-macros", ] [[package]] name = "wasmtime-jit-icache-coherence" -version = "27.0.0" +version = "34.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "91b218a92866f74f35162f5d03a4e0f62cd0e1cc624285b1014275e5d4575fad" +checksum = "44c71d64e8ebe132cd45e9d299a4d0daf261d66bd05cf50a204a1bf8cf96ff1f" dependencies = [ "anyhow", "cfg-if", @@ -2341,17 +2392,26 @@ dependencies = [ "windows-sys 0.59.0", ] +[[package]] +name = "wasmtime-math" +version = "34.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "222bfa4769c6931c985711eb49a92748ea0acc4ca85fcd24e945a2f1bacda0c1" +dependencies = [ + "libm", +] + [[package]] name = "wasmtime-slab" -version = "27.0.0" +version = "34.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4d5f8acf677ee6b3b8ba400dd9753ea4769e56a95c4b30b045ac6d2d54b2f8ea" +checksum = "5ac42c7fb0639f7c3e0c1ed0c984050245c55410f3fae334dd5b102e0edfab14" [[package]] name = "wasmtime-versioned-export-macros" -version = "27.0.0" +version = "34.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "df09be00c38f49172ca9936998938476e3f2df782673a39ae2ef9fb0838341b6" +checksum = "4e052e1d9c30b8f31aff64380caaaff492a9890a412658bcc8866fe626b8e91f" dependencies = [ "proc-macro2", "quote", @@ -2360,9 +2420,9 @@ dependencies = [ [[package]] name = "wasmtime-wasi" -version = "27.0.0" +version = "34.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ad5cf227161565057fc994edf14180341817372a218f1597db48a43946e5f875" +checksum = "e8392e2256e2b56167a69c4d5ea5505fc3cd164f088ce7009824ee0abd1671dc" dependencies = [ "anyhow", "async-trait", @@ -2377,29 +2437,43 @@ dependencies = [ "futures", "io-extras", "io-lifetimes", - "rustix", + "rustix 1.0.7", "system-interface", - "thiserror", + "thiserror 2.0.12", "tokio", "tracing", "url", "wasmtime", + "wasmtime-wasi-io", "wiggle", "windows-sys 0.59.0", ] +[[package]] +name = "wasmtime-wasi-io" +version = "34.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "92a8348338594ee5b46c2decdb921a54fabaaed4cb448f6effb97c49d09e44e7" +dependencies = [ + "anyhow", + "async-trait", + "bytes", + "futures", + "wasmtime", +] + [[package]] name = "wasmtime-winch" -version = "27.0.0" +version = "34.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "89d6b5297bea14d8387c3974b2b011de628cc9b188f135cec752b74fd368964b" +checksum = "f2d71e002033124221f6633a462c26067280519fdd7527ba2751f585db779cc6" dependencies = [ "anyhow", "cranelift-codegen", "gimli", "object", "target-lexicon", - "wasmparser 0.219.1", + "wasmparser 0.233.0", "wasmtime-cranelift", "wasmtime-environ", "winch-codegen", @@ -2407,9 +2481,9 @@ dependencies = [ [[package]] name = "wasmtime-wit-bindgen" -version = "27.0.0" +version = "34.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bf3963c9c29df91564d8bd181eb00d0dbaeafa1b2a01e15952bb7391166b704e" +checksum = "f967f5efaaac7694e6bd0d67542a5a036830860e4adf95684260181e85a5d299" dependencies = [ "anyhow", "heck", @@ -2428,24 +2502,24 @@ dependencies = [ [[package]] name = "wast" -version = "221.0.0" +version = "235.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d8eb1933d493dd07484a255c3f52236123333f5befaa3be36182a50d393ec54" +checksum = "1eda4293f626c99021bb3a6fbe4fbbe90c0e31a5ace89b5f620af8925de72e13" dependencies = [ "bumpalo", - "leb128", + "leb128fmt", "memchr", "unicode-width", - "wasm-encoder 0.221.0", + "wasm-encoder 0.235.0", ] [[package]] name = "wat" -version = "1.221.0" +version = "1.235.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c813fd4e5b2b97242830b56e7b7dc5479bc17aaa8730109be35e61909af83993" +checksum = "e777e0327115793cb96ab220b98f85327ec3d11f34ec9e8d723264522ef206aa" dependencies = [ - "wast 221.0.0", + "wast 235.0.0", ] [[package]] @@ -2460,14 +2534,14 @@ dependencies = [ [[package]] name = "wiggle" -version = "27.0.0" +version = "34.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "80e0f6ef83a263c0fa11957c363aeaa76dc84832484d0e119f22810d4d0e09a7" +checksum = "ab89466227933ce3d44f2b60eedd2cc46ba3dfd350cf1e938b6422bea18aa422" dependencies = [ "anyhow", "async-trait", "bitflags", - "thiserror", + "thiserror 2.0.12", "tracing", "wasmtime", "wiggle-macro", @@ -2475,24 +2549,23 @@ dependencies = [ [[package]] name = "wiggle-generate" -version = "27.0.0" +version = "34.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dd266b290a0fdace3af6a05c6ebbcc54de303a774448ecf5a98cd0bc12d89c52" +checksum = "f650b2d5981c3359778c49eada0796fcc98e9135bc6f7bb894cab2e2bc4fd04d" dependencies = [ "anyhow", "heck", "proc-macro2", "quote", - "shellexpand", "syn 2.0.89", "witx", ] [[package]] name = "wiggle-macro" -version = "27.0.0" +version = "34.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b8eb1a5783540696c59cefbfc9e52570c2d5e62bd47bdf0bdcef29231879db2" +checksum = "e4e5f692091b53dbb0835f74cfc03cbd8f384fd3fb493bde6bdc96426e105e84" dependencies = [ "proc-macro2", "quote", @@ -2533,19 +2606,22 @@ checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" [[package]] name = "winch-codegen" -version = "27.0.0" +version = "34.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8b42b678c8651ec4900d7600037d235429fc985c31cbc33515885ec0d2a9e158" +checksum = "7d2bf456780101aff8950642fdf984f182816d7f555d5375699200242be78762" dependencies = [ "anyhow", + "cranelift-assembler-x64", "cranelift-codegen", "gimli", "regalloc2", "smallvec", "target-lexicon", - "wasmparser 0.219.1", + "thiserror 2.0.12", + "wasmparser 0.233.0", "wasmtime-cranelift", "wasmtime-environ", + "wasmtime-math", ] [[package]] @@ -2660,9 +2736,9 @@ dependencies = [ [[package]] name = "wit-parser" -version = "0.219.1" +version = "0.233.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4a86f669283257e8e424b9a4fc3518e3ade0b95deb9fbc0f93a1876be3eda598" +checksum = "f22f1cd55247a2e616870b619766e9522df36b7abafbb29bbeb34b7a9da7e9f0" dependencies = [ "anyhow", "id-arena", @@ -2673,7 +2749,7 @@ dependencies = [ "serde_derive", "serde_json", "unicode-xid", - "wasmparser 0.219.1", + "wasmparser 0.233.0", ] [[package]] @@ -2684,7 +2760,7 @@ checksum = "e366f27a5cabcddb2706a78296a40b8fcc451e1a6aba2fc1d94b4a01bdaaef4b" dependencies = [ "anyhow", "log", - "thiserror", + "thiserror 1.0.69", "wast 35.0.2", ] diff --git a/component-model/examples/example-host/Cargo.toml b/component-model/examples/example-host/Cargo.toml index b364a905..18fcc418 100644 --- a/component-model/examples/example-host/Cargo.toml +++ b/component-model/examples/example-host/Cargo.toml @@ -10,5 +10,5 @@ Example Rust-based WebAssembly host that executes WebAssembly components anyhow = "1.0.72" async-std = { version = "1.13", features = ["attributes"] } clap = { version = "4", features = ["derive"] } -wasmtime = "27.0" -wasmtime-wasi = "27.0" +wasmtime = "34.0" +wasmtime-wasi = "34.0" diff --git a/component-model/examples/example-host/src/async_add.rs b/component-model/examples/example-host/src/async_add.rs index 48ec9cea..4019c99d 100644 --- a/component-model/examples/example-host/src/async_add.rs +++ b/component-model/examples/example-host/src/async_add.rs @@ -44,7 +44,7 @@ pub async fn add(path: PathBuf, x: u32, y: u32) -> wasmtime::Result { // Add wasi exports to linker to support I/O (as in `wasi:io`) interfaces // see: https://github.com/WebAssembly/wasi-io - wasmtime_wasi::add_to_linker_async(&mut linker)?; + wasmtime_wasi::p2::add_to_linker_async(&mut linker)?; // Instantiate the component as an instance of the `adder` world, // with the generated bindings diff --git a/component-model/examples/example-host/src/state.rs b/component-model/examples/example-host/src/state.rs index 74819bc3..65c2cdd5 100644 --- a/component-model/examples/example-host/src/state.rs +++ b/component-model/examples/example-host/src/state.rs @@ -1,5 +1,5 @@ use wasmtime::component::ResourceTable; -use wasmtime_wasi::{WasiCtx, WasiCtxBuilder, WasiView}; +use wasmtime_wasi::p2::{IoView, WasiCtx, WasiCtxBuilder, WasiView}; pub struct States { table: ResourceTable, @@ -15,11 +15,13 @@ impl States { } impl WasiView for States { - fn table(&mut self) -> &mut ResourceTable { - &mut self.table - } - fn ctx(&mut self) -> &mut WasiCtx { &mut self.ctx } } + +impl IoView for States { + fn table(&mut self) -> &mut ResourceTable { + &mut self.table + } +} diff --git a/component-model/examples/example-host/src/sync_add.rs b/component-model/examples/example-host/src/sync_add.rs index fa940f13..4de75ec2 100644 --- a/component-model/examples/example-host/src/sync_add.rs +++ b/component-model/examples/example-host/src/sync_add.rs @@ -42,7 +42,7 @@ pub fn add(path: PathBuf, x: u32, y: u32) -> wasmtime::Result { // Add wasi exports to linker to support I/O (as in `wasi:io`) interfaces // see: https://github.com/WebAssembly/wasi-io - wasmtime_wasi::add_to_linker_sync(&mut linker).expect("Could not add wasi to linker"); + wasmtime_wasi::p2::add_to_linker_sync(&mut linker).expect("Could not add wasi to linker"); // Instantiate the component as an instance of the `adder` world, // with the generated bindings