From 80c0b9f3e082c2a7dc37cb53bd3e6b8f6fa976d5 Mon Sep 17 00:00:00 2001 From: Ryan Levick Date: Wed, 14 Jun 2023 12:44:28 +0200 Subject: [PATCH 1/9] Upgrade to wasmtime 10.0 Signed-off-by: Ryan Levick --- Cargo.lock | 507 +++++++----------- Cargo.toml | 17 +- crates/core/Cargo.toml | 7 +- crates/core/src/io.rs | 4 +- crates/core/src/lib.rs | 39 +- crates/core/src/store.rs | 153 ++++-- crates/core/tests/core-wasi-test/Cargo.toml | 2 +- .../tests/core-wasi-test/wit/multiplier.wit | 4 +- crates/core/tests/integration_test.rs | 4 +- crates/templates/Cargo.toml | 2 +- crates/trigger-http/src/wagi.rs | 4 +- crates/trigger/src/lib.rs | 12 +- crates/world/src/lib.rs | 2 + wit/preview2/config.wit | 2 +- wit/preview2/http-types.wit | 2 +- wit/preview2/http.wit | 4 +- wit/preview2/inbound-http.wit | 4 +- wit/preview2/inbound-redis.wit | 4 +- wit/preview2/key-value.wit | 2 +- wit/preview2/mysql.wit | 4 +- wit/preview2/postgres.wit | 4 +- wit/preview2/rdbms-types.wit | 2 +- wit/preview2/reactor.wit | 22 +- wit/preview2/redis-types.wit | 2 +- wit/preview2/redis.wit | 4 +- wit/preview2/sqlite.wit | 2 +- 26 files changed, 396 insertions(+), 419 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 261f6e52b7..8915139c8a 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -68,9 +68,9 @@ checksum = "250f629c0161ad8107cf89319e990051fae62832fd343083bea452d93e2205fd" [[package]] name = "ambient-authority" -version = "0.0.1" +version = "0.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec8ad6edb4840b78c5c3d88de606b22252d552b55f3a4699fbb10fc070ec3049" +checksum = "e9d4ee0d472d1cd2e28c97dfa124b3d8d992e10eb0a035f33f5d12e3a177ba3b" [[package]] name = "android_system_properties" @@ -526,38 +526,38 @@ checksum = "89b2fd2a0dcf38d7971e2194b6b6eebab45ae01067456a7fd93d5547a61b70be" [[package]] name = "cap-fs-ext" -version = "1.0.7" +version = "1.0.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "07d9cd7dc1d714d59974a6a68bed489c914b7b2620d1d4334d88d5ec9f29ebbd" +checksum = "58bc48200a1a0fa6fba138b1802ad7def18ec1cdd92f7b2a04e21f1bd887f7b9" dependencies = [ "cap-primitives", "cap-std", "io-lifetimes", - "windows-sys 0.45.0", + "windows-sys 0.48.0", ] [[package]] name = "cap-primitives" -version = "1.0.7" +version = "1.0.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e41334d53bab60f94878253f8a950c231596c8bbb99b4f71b13223dd48e18c6" +checksum = "a4b6df5b295dca8d56f35560be8c391d59f0420f72e546997154e24e765e6451" dependencies = [ "ambient-authority", - "fs-set-times 0.18.1", + "fs-set-times", "io-extras", "io-lifetimes", "ipnet", "maybe-owned", - "rustix 0.36.9", - "windows-sys 0.45.0", + "rustix 0.37.20", + "windows-sys 0.48.0", "winx", ] [[package]] name = "cap-rand" -version = "1.0.7" +version = "1.0.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6b5ddc7e3565e7cc4bf20d0c386b328f9e0f1b83fe0bcc0e055a1f08245e2aca" +checksum = "4d25555efacb0b5244cf1d35833d55d21abc916fff0eaad254b8e2453ea9b8ab" dependencies = [ "ambient-authority", "rand 0.8.5", @@ -565,15 +565,14 @@ dependencies = [ [[package]] name = "cap-std" -version = "1.0.7" +version = "1.0.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e9dd840c16dee1df417f3985d173a2bb6ef55d48ea3d4deddcef46f31c9e7028" +checksum = "3373a62accd150b4fcba056d4c5f3b552127f0ec86d3c8c102d60b978174a012" dependencies = [ "cap-primitives", "io-extras", "io-lifetimes", - "ipnet", - "rustix 0.36.9", + "rustix 0.37.20", ] [[package]] @@ -681,8 +680,8 @@ checksum = "eef2b3ded6a26dfaec672a742c93c8cf6b689220324da509ec5caa20de55dc83" dependencies = [ "atty", "bitflags 1.3.2", - "clap_derive 3.2.24", - "clap_lex 0.2.4", + "clap_derive", + "clap_lex", "indexmap", "once_cell", "strsim", @@ -690,21 +689,6 @@ dependencies = [ "textwrap 0.16.0", ] -[[package]] -name = "clap" -version = "4.1.13" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c911b090850d79fc64fe9ea01e28e465f65e821e08813ced95bced72f7a8a9b" -dependencies = [ - "bitflags 1.3.2", - "clap_derive 4.1.12", - "clap_lex 0.3.3", - "is-terminal", - "once_cell", - "strsim", - "termcolor", -] - [[package]] name = "clap_derive" version = "3.2.24" @@ -718,18 +702,6 @@ dependencies = [ "syn 1.0.109", ] -[[package]] -name = "clap_derive" -version = "4.1.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9a932373bab67b984c790ddf2c9ca295d8e3af3b7ef92de5a5bacdccdee4b09b" -dependencies = [ - "heck 0.4.1", - "proc-macro2", - "quote", - "syn 2.0.8", -] - [[package]] name = "clap_lex" version = "0.2.4" @@ -739,15 +711,6 @@ dependencies = [ "os_str_bytes", ] -[[package]] -name = "clap_lex" -version = "0.3.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "033f6b7a4acb1f358c742aaca805c939ee73b4c6209ae4318ec7aca81c42e646" -dependencies = [ - "os_str_bytes", -] - [[package]] name = "clearscreen" version = "2.0.1" @@ -887,18 +850,16 @@ dependencies = [ [[package]] name = "cranelift-bforest" -version = "0.96.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "182b82f78049f54d3aee5a19870d356ef754226665a695ce2fcdd5d55379718e" +version = "0.97.0" +source = "git+https://github.com/bytecodealliance/wasmtime?branch=release-10.0.0#854fe1ad50968d67e961eed4a573c4dfa8ab7178" dependencies = [ "cranelift-entity", ] [[package]] name = "cranelift-codegen" -version = "0.96.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e7c027bf04ecae5b048d3554deb888061bc26f426afff47bf06d6ac933dce0a6" +version = "0.97.0" +source = "git+https://github.com/bytecodealliance/wasmtime?branch=release-10.0.0#854fe1ad50968d67e961eed4a573c4dfa8ab7178" dependencies = [ "bumpalo", "cranelift-bforest", @@ -917,42 +878,37 @@ dependencies = [ [[package]] name = "cranelift-codegen-meta" -version = "0.96.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "649f70038235e4c81dba5680d7e5ae83e1081f567232425ab98b55b03afd9904" +version = "0.97.0" +source = "git+https://github.com/bytecodealliance/wasmtime?branch=release-10.0.0#854fe1ad50968d67e961eed4a573c4dfa8ab7178" dependencies = [ "cranelift-codegen-shared", ] [[package]] name = "cranelift-codegen-shared" -version = "0.96.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a1d1c5ee2611c6a0bdc8d42d5d3dc5ce8bf53a8040561e26e88b9b21f966417" +version = "0.97.0" +source = "git+https://github.com/bytecodealliance/wasmtime?branch=release-10.0.0#854fe1ad50968d67e961eed4a573c4dfa8ab7178" [[package]] name = "cranelift-control" -version = "0.96.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da66a68b1f48da863d1d53209b8ddb1a6236411d2d72a280ffa8c2f734f7219e" +version = "0.97.0" +source = "git+https://github.com/bytecodealliance/wasmtime?branch=release-10.0.0#854fe1ad50968d67e961eed4a573c4dfa8ab7178" dependencies = [ "arbitrary", ] [[package]] name = "cranelift-entity" -version = "0.96.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9bd897422dbb66621fa558f4d9209875530c53e3c8f4b13b2849fbb667c431a6" +version = "0.97.0" +source = "git+https://github.com/bytecodealliance/wasmtime?branch=release-10.0.0#854fe1ad50968d67e961eed4a573c4dfa8ab7178" dependencies = [ "serde", ] [[package]] name = "cranelift-frontend" -version = "0.96.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05db883114c98cfcd6959f72278d2fec42e01ea6a6982cfe4f20e88eebe86653" +version = "0.97.0" +source = "git+https://github.com/bytecodealliance/wasmtime?branch=release-10.0.0#854fe1ad50968d67e961eed4a573c4dfa8ab7178" dependencies = [ "cranelift-codegen", "log", @@ -962,15 +918,13 @@ dependencies = [ [[package]] name = "cranelift-isle" -version = "0.96.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "84559de86e2564152c87e299c8b2559f9107e9c6d274b24ebeb04fb0a5f4abf8" +version = "0.97.0" +source = "git+https://github.com/bytecodealliance/wasmtime?branch=release-10.0.0#854fe1ad50968d67e961eed4a573c4dfa8ab7178" [[package]] name = "cranelift-native" -version = "0.96.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3f40b57f187f0fe1ffaf281df4adba2b4bc623a0f6651954da9f3c184be72761" +version = "0.97.0" +source = "git+https://github.com/bytecodealliance/wasmtime?branch=release-10.0.0#854fe1ad50968d67e961eed4a573c4dfa8ab7178" dependencies = [ "cranelift-codegen", "libc", @@ -979,9 +933,8 @@ dependencies = [ [[package]] name = "cranelift-wasm" -version = "0.96.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f3eab6084cc789b9dd0b1316241efeb2968199fee709f4bb4fe0fb0923bb468b" +version = "0.97.0" +source = "git+https://github.com/bytecodealliance/wasmtime?branch=release-10.0.0#854fe1ad50968d67e961eed4a573c4dfa8ab7178" dependencies = [ "cranelift-codegen", "cranelift-entity", @@ -989,7 +942,7 @@ dependencies = [ "itertools", "log", "smallvec", - "wasmparser 0.103.0", + "wasmparser 0.107.0", "wasmtime-types", ] @@ -1652,9 +1605,9 @@ dependencies = [ [[package]] name = "file-per-thread-logger" -version = "0.1.6" +version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "84f2e425d9790201ba4af4630191feac6dcc98765b118d4d18e91d23c2353866" +checksum = "8a3cc21c33af89af0930c8cae4ade5e6fdc17b5d2c97b3d2e2edb67a1cf683f3" dependencies = [ "env_logger 0.10.0", "log", @@ -1777,17 +1730,6 @@ dependencies = [ "syn 1.0.109", ] -[[package]] -name = "fs-set-times" -version = "0.18.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "857cf27edcb26c2a36d84b2954019573d335bb289876113aceacacdca47a4fd4" -dependencies = [ - "io-lifetimes", - "rustix 0.36.9", - "windows-sys 0.45.0", -] - [[package]] name = "fs-set-times" version = "0.19.1" @@ -2356,24 +2298,6 @@ dependencies = [ "digest 0.10.6", ] -[[package]] -name = "host" -version = "0.0.0" -source = "git+https://github.com/fermyon/spin-componentize?rev=8a596f722556d17cc1dc9b3ae8a7e7a77d3e90ae#8a596f722556d17cc1dc9b3ae8a7e7a77d3e90ae" -dependencies = [ - "anyhow", - "async-trait", - "cap-rand", - "cap-std", - "clap 4.1.13", - "thiserror", - "tokio", - "tracing", - "wasi-cap-std-sync 0.0.0", - "wasi-common 0.0.0", - "wasmtime", -] - [[package]] name = "hrana-client-proto" version = "0.1.2" @@ -4270,9 +4194,9 @@ dependencies = [ [[package]] name = "regalloc2" -version = "0.8.1" +version = "0.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d4a52e724646c6c0800fc456ec43b4165d2f91fba88ceaca06d9e0b400023478" +checksum = "12513beb38dd35aab3ac5f5b89fd0330159a0dc21d5309d75073011bbc8032b0" dependencies = [ "hashbrown 0.13.2", "log", @@ -4535,10 +4459,8 @@ dependencies = [ "bitflags 1.3.2", "errno 0.2.8", "io-lifetimes", - "itoa", "libc", "linux-raw-sys 0.1.4", - "once_cell", "windows-sys 0.45.0", ] @@ -4551,8 +4473,10 @@ dependencies = [ "bitflags 1.3.2", "errno 0.3.1", "io-lifetimes", + "itoa", "libc", "linux-raw-sys 0.3.6", + "once_cell", "windows-sys 0.48.0", ] @@ -5172,12 +5096,13 @@ dependencies = [ [[package]] name = "spin-componentize" version = "0.1.0" -source = "git+https://github.com/fermyon/spin-componentize?rev=8a596f722556d17cc1dc9b3ae8a7e7a77d3e90ae#8a596f722556d17cc1dc9b3ae8a7e7a77d3e90ae" dependencies = [ "anyhow", - "wasm-encoder 0.26.0", - "wasmparser 0.104.0", - "wit-component", + "wasm-encoder 0.29.0", + "wasmparser 0.107.0", + "wit-component 0.11.0", + "wit-component 0.8.2", + "wit-parser 0.8.0", ] [[package]] @@ -5206,7 +5131,6 @@ dependencies = [ "async-trait", "cap-std", "crossbeam-channel", - "host", "io-extras", "rustix 0.37.20", "spin-componentize", @@ -5214,9 +5138,7 @@ dependencies = [ "tempfile", "tokio", "tracing", - "wasi-cap-std-sync 0.0.0", - "wasi-common 0.0.0", - "wasi-common 9.0.4", + "wasi-common", "wasmtime", "wasmtime-wasi", ] @@ -5602,7 +5524,7 @@ dependencies = [ "tokio", "tokio-rustls", "tracing", - "wasi-common 9.0.4", + "wasi-common", "wasmtime", "wasmtime-wasi", ] @@ -5614,6 +5536,12 @@ dependencies = [ "wasmtime", ] +[[package]] +name = "sptr" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3b9b39299b249ad65f3b7e96443bad61c02ca5cd3589f46cb6d610a0fd6c0d6a" + [[package]] name = "sqlparser" version = "0.34.0" @@ -6421,8 +6349,8 @@ checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" [[package]] name = "wasi-cap-std-sync" -version = "0.0.0" -source = "git+https://github.com/fermyon/spin-componentize?rev=8a596f722556d17cc1dc9b3ae8a7e7a77d3e90ae#8a596f722556d17cc1dc9b3ae8a7e7a77d3e90ae" +version = "10.0.0" +source = "git+https://github.com/bytecodealliance/wasmtime?branch=release-10.0.0#854fe1ad50968d67e961eed4a573c4dfa8ab7178" dependencies = [ "anyhow", "async-trait", @@ -6430,32 +6358,7 @@ dependencies = [ "cap-rand", "cap-std", "cap-time-ext", - "fs-set-times 0.18.1", - "io-extras", - "io-lifetimes", - "ipnet", - "is-terminal", - "once_cell", - "rustix 0.36.9", - "system-interface", - "tracing", - "wasi-common 0.0.0", - "windows-sys 0.45.0", -] - -[[package]] -name = "wasi-cap-std-sync" -version = "9.0.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5d29c5da3b5cfc9212a7fa824224875cb67fb89d2a8392db655e4c59b8ab2ae7" -dependencies = [ - "anyhow", - "async-trait", - "cap-fs-ext", - "cap-rand", - "cap-std", - "cap-time-ext", - "fs-set-times 0.19.1", + "fs-set-times", "io-extras", "io-lifetimes", "is-terminal", @@ -6463,35 +6366,14 @@ dependencies = [ "rustix 0.37.20", "system-interface", "tracing", - "wasi-common 9.0.4", + "wasi-common", "windows-sys 0.48.0", ] [[package]] name = "wasi-common" -version = "0.0.0" -source = "git+https://github.com/fermyon/spin-componentize?rev=8a596f722556d17cc1dc9b3ae8a7e7a77d3e90ae#8a596f722556d17cc1dc9b3ae8a7e7a77d3e90ae" -dependencies = [ - "anyhow", - "async-trait", - "bitflags 1.3.2", - "cap-fs-ext", - "cap-rand", - "cap-std", - "io-extras", - "ipnet", - "rustix 0.36.9", - "system-interface", - "thiserror", - "tracing", - "windows-sys 0.45.0", -] - -[[package]] -name = "wasi-common" -version = "9.0.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f8bd905dcec1448664bf63d42d291cbae0feeea3ad41631817b8819e096d76bd" +version = "10.0.0" +source = "git+https://github.com/bytecodealliance/wasmtime?branch=release-10.0.0#854fe1ad50968d67e961eed4a573c4dfa8ab7178" dependencies = [ "anyhow", "bitflags 1.3.2", @@ -6509,9 +6391,8 @@ dependencies = [ [[package]] name = "wasi-tokio" -version = "9.0.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c27f8d49f64ffce4f6c566f87241f0855816a8954ffd2dd038d8c945457c50a2" +version = "10.0.0" +source = "git+https://github.com/bytecodealliance/wasmtime?branch=release-10.0.0#854fe1ad50968d67e961eed4a573c4dfa8ab7178" dependencies = [ "anyhow", "cap-std", @@ -6519,8 +6400,8 @@ dependencies = [ "io-lifetimes", "rustix 0.37.20", "tokio", - "wasi-cap-std-sync 9.0.4", - "wasi-common 9.0.4", + "wasi-cap-std-sync", + "wasi-common", "wiggle", ] @@ -6590,15 +6471,6 @@ version = "0.2.84" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0046fef7e28c3804e5e38bfa31ea2a0f73905319b677e57ebe37e49358989b5d" -[[package]] -name = "wasm-encoder" -version = "0.25.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4eff853c4f09eec94d76af527eddad4e9de13b11d6286a1ef7134bc30135a2b7" -dependencies = [ - "leb128", -] - [[package]] name = "wasm-encoder" version = "0.26.0" @@ -6630,6 +6502,19 @@ dependencies = [ "wasmparser 0.104.0", ] +[[package]] +name = "wasm-metadata" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "36e5156581ff4a302405c44ca7c85347563ca431d15f1a773f12c9c7b9a6cdc9" +dependencies = [ + "anyhow", + "indexmap", + "serde", + "wasm-encoder 0.29.0", + "wasmparser 0.107.0", +] + [[package]] name = "wasm-streams" version = "0.2.3" @@ -6643,16 +6528,6 @@ dependencies = [ "web-sys", ] -[[package]] -name = "wasmparser" -version = "0.103.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2c437373cac5ea84f1113d648d51f71751ffbe3d90c00ae67618cf20d0b5ee7b" -dependencies = [ - "indexmap", - "url", -] - [[package]] name = "wasmparser" version = "0.104.0" @@ -6685,9 +6560,8 @@ dependencies = [ [[package]] name = "wasmtime" -version = "9.0.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "634357e8668774b24c80b210552f3f194e2342a065d6d83845ba22c5817d0770" +version = "10.0.0" +source = "git+https://github.com/bytecodealliance/wasmtime?branch=release-10.0.0#854fe1ad50968d67e961eed4a573c4dfa8ab7178" dependencies = [ "anyhow", "async-trait", @@ -6707,7 +6581,7 @@ dependencies = [ "serde", "serde_json", "target-lexicon", - "wasmparser 0.103.0", + "wasmparser 0.107.0", "wasmtime-cache", "wasmtime-component-macro", "wasmtime-component-util", @@ -6723,18 +6597,16 @@ dependencies = [ [[package]] name = "wasmtime-asm-macros" -version = "9.0.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d33c73c24ce79b0483a3b091a9acf88871f4490b88998e8974b22236264d304c" +version = "10.0.0" +source = "git+https://github.com/bytecodealliance/wasmtime?branch=release-10.0.0#854fe1ad50968d67e961eed4a573c4dfa8ab7178" dependencies = [ "cfg-if", ] [[package]] name = "wasmtime-cache" -version = "9.0.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6107809b2d9f5b2fd3ddbaddb3bb92ff8048b62f4030debf1408119ffd38c6cb" +version = "10.0.0" +source = "git+https://github.com/bytecodealliance/wasmtime?branch=release-10.0.0#854fe1ad50968d67e961eed4a573c4dfa8ab7178" dependencies = [ "anyhow", "base64 0.21.0", @@ -6752,9 +6624,8 @@ dependencies = [ [[package]] name = "wasmtime-component-macro" -version = "9.0.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e5ba489850d9c91c6c5b9e1696ee89e7a69d9796236a005f7e9131b6746e13b6" +version = "10.0.0" +source = "git+https://github.com/bytecodealliance/wasmtime?branch=release-10.0.0#854fe1ad50968d67e961eed4a573c4dfa8ab7178" dependencies = [ "anyhow", "proc-macro2", @@ -6762,20 +6633,18 @@ dependencies = [ "syn 1.0.109", "wasmtime-component-util", "wasmtime-wit-bindgen", - "wit-parser 0.7.1", + "wit-parser 0.8.0", ] [[package]] name = "wasmtime-component-util" -version = "9.0.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7fa88f9e77d80f828c9d684741a9da649366c6d1cceb814755dd9cab7112d1d1" +version = "10.0.0" +source = "git+https://github.com/bytecodealliance/wasmtime?branch=release-10.0.0#854fe1ad50968d67e961eed4a573c4dfa8ab7178" [[package]] name = "wasmtime-cranelift" -version = "9.0.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5800616a28ed6bd5e8b99ea45646c956d798ae030494ac0689bc3e45d3b689c1" +version = "10.0.0" +source = "git+https://github.com/bytecodealliance/wasmtime?branch=release-10.0.0#854fe1ad50968d67e961eed4a573c4dfa8ab7178" dependencies = [ "anyhow", "cranelift-codegen", @@ -6789,16 +6658,15 @@ dependencies = [ "object", "target-lexicon", "thiserror", - "wasmparser 0.103.0", + "wasmparser 0.107.0", "wasmtime-cranelift-shared", "wasmtime-environ", ] [[package]] name = "wasmtime-cranelift-shared" -version = "9.0.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "27e4030b959ac5c5d6ee500078977e813f8768fa2b92fc12be01856cd0c76c55" +version = "10.0.0" +source = "git+https://github.com/bytecodealliance/wasmtime?branch=release-10.0.0#854fe1ad50968d67e961eed4a573c4dfa8ab7178" dependencies = [ "anyhow", "cranelift-codegen", @@ -6812,9 +6680,8 @@ dependencies = [ [[package]] name = "wasmtime-environ" -version = "9.0.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ec815d01a8d38aceb7ed4678f9ba551ae6b8a568a63810ac3ad9293b0fd01c8" +version = "10.0.0" +source = "git+https://github.com/bytecodealliance/wasmtime?branch=release-10.0.0#854fe1ad50968d67e961eed4a573c4dfa8ab7178" dependencies = [ "anyhow", "cranelift-entity", @@ -6825,8 +6692,8 @@ dependencies = [ "serde", "target-lexicon", "thiserror", - "wasm-encoder 0.25.0", - "wasmparser 0.103.0", + "wasm-encoder 0.29.0", + "wasmparser 0.107.0", "wasmprinter", "wasmtime-component-util", "wasmtime-types", @@ -6834,9 +6701,8 @@ dependencies = [ [[package]] name = "wasmtime-fiber" -version = "9.0.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "23c5127908fdf720614891ec741c13dd70c844e102caa393e2faca1ee68e9bfb" +version = "10.0.0" +source = "git+https://github.com/bytecodealliance/wasmtime?branch=release-10.0.0#854fe1ad50968d67e961eed4a573c4dfa8ab7178" dependencies = [ "cc", "cfg-if", @@ -6847,9 +6713,8 @@ dependencies = [ [[package]] name = "wasmtime-jit" -version = "9.0.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2712eafe829778b426cad0e1769fef944898923dd29f0039e34e0d53ba72b234" +version = "10.0.0" +source = "git+https://github.com/bytecodealliance/wasmtime?branch=release-10.0.0#854fe1ad50968d67e961eed4a573c4dfa8ab7178" dependencies = [ "addr2line", "anyhow", @@ -6861,6 +6726,7 @@ dependencies = [ "log", "object", "rustc-demangle", + "rustix 0.37.20", "serde", "target-lexicon", "wasmtime-environ", @@ -6872,9 +6738,8 @@ dependencies = [ [[package]] name = "wasmtime-jit-debug" -version = "9.0.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "65fb78eacf4a6e47260d8ef8cc81ea8ddb91397b2e848b3fb01567adebfe89b5" +version = "10.0.0" +source = "git+https://github.com/bytecodealliance/wasmtime?branch=release-10.0.0#854fe1ad50968d67e961eed4a573c4dfa8ab7178" dependencies = [ "object", "once_cell", @@ -6883,9 +6748,8 @@ dependencies = [ [[package]] name = "wasmtime-jit-icache-coherence" -version = "9.0.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d1364900b05f7d6008516121e8e62767ddb3e176bdf4c84dfa85da1734aeab79" +version = "10.0.0" +source = "git+https://github.com/bytecodealliance/wasmtime?branch=release-10.0.0#854fe1ad50968d67e961eed4a573c4dfa8ab7178" dependencies = [ "cfg-if", "libc", @@ -6894,9 +6758,8 @@ dependencies = [ [[package]] name = "wasmtime-runtime" -version = "9.0.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4a16ffe4de9ac9669175c0ea5c6c51ffc596dfb49320aaa6f6c57eff58cef069" +version = "10.0.0" +source = "git+https://github.com/bytecodealliance/wasmtime?branch=release-10.0.0#854fe1ad50968d67e961eed4a573c4dfa8ab7178" dependencies = [ "anyhow", "cc", @@ -6911,6 +6774,7 @@ dependencies = [ "paste", "rand 0.8.5", "rustix 0.37.20", + "sptr", "wasmtime-asm-macros", "wasmtime-environ", "wasmtime-fiber", @@ -6920,58 +6784,66 @@ dependencies = [ [[package]] name = "wasmtime-types" -version = "9.0.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "19961c9a3b04d5e766875a5c467f6f5d693f508b3e81f8dc4a1444aa94f041c9" +version = "10.0.0" +source = "git+https://github.com/bytecodealliance/wasmtime?branch=release-10.0.0#854fe1ad50968d67e961eed4a573c4dfa8ab7178" dependencies = [ "cranelift-entity", "serde", "thiserror", - "wasmparser 0.103.0", + "wasmparser 0.107.0", ] [[package]] name = "wasmtime-wasi" -version = "9.0.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "21080ff62878f1d7c53d9571053dbe96552c0f982f9f29eac65ea89974fabfd7" +version = "10.0.0" +source = "git+https://github.com/bytecodealliance/wasmtime?branch=release-10.0.0#854fe1ad50968d67e961eed4a573c4dfa8ab7178" dependencies = [ "anyhow", + "async-trait", + "bitflags 1.3.2", + "cap-fs-ext", + "cap-rand", + "cap-std", + "cap-time-ext", + "fs-set-times", + "io-extras", "libc", - "wasi-cap-std-sync 9.0.4", - "wasi-common 9.0.4", + "rustix 0.37.20", + "system-interface", + "thiserror", + "tracing", + "wasi-cap-std-sync", + "wasi-common", "wasi-tokio", "wasmtime", "wiggle", + "windows-sys 0.48.0", ] [[package]] name = "wasmtime-winch" -version = "9.0.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "931600bd05200b3f19d9373c182b6a5657938400e51c42572f3477dbc8897344" +version = "10.0.0" +source = "git+https://github.com/bytecodealliance/wasmtime?branch=release-10.0.0#854fe1ad50968d67e961eed4a573c4dfa8ab7178" dependencies = [ "anyhow", "cranelift-codegen", "gimli", "object", "target-lexicon", - "wasmparser 0.103.0", + "wasmparser 0.107.0", "wasmtime-cranelift-shared", "wasmtime-environ", "winch-codegen", - "winch-environ", ] [[package]] name = "wasmtime-wit-bindgen" -version = "9.0.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "421f0d16cc5c612b35ae53a0be3d3124c72296f18e5be3468263c745d56d37ab" +version = "10.0.0" +source = "git+https://github.com/bytecodealliance/wasmtime?branch=release-10.0.0#854fe1ad50968d67e961eed4a573c4dfa8ab7178" dependencies = [ "anyhow", "heck 0.4.1", - "wit-parser 0.7.1", + "wit-parser 0.8.0", ] [[package]] @@ -7091,9 +6963,8 @@ dependencies = [ [[package]] name = "wiggle" -version = "9.0.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b34e40b7b17a920d03449ca78b0319984379eed01a9a11c1def9c3d3832d85a" +version = "10.0.0" +source = "git+https://github.com/bytecodealliance/wasmtime?branch=release-10.0.0#854fe1ad50968d67e961eed4a573c4dfa8ab7178" dependencies = [ "anyhow", "async-trait", @@ -7106,9 +6977,8 @@ dependencies = [ [[package]] name = "wiggle-generate" -version = "9.0.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9eefda132eaa84fe5f15d23a55a912f8417385aee65d0141d78a3b65e46201ed" +version = "10.0.0" +source = "git+https://github.com/bytecodealliance/wasmtime?branch=release-10.0.0#854fe1ad50968d67e961eed4a573c4dfa8ab7178" dependencies = [ "anyhow", "heck 0.4.1", @@ -7121,9 +6991,8 @@ dependencies = [ [[package]] name = "wiggle-macro" -version = "9.0.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ca1a344a0ba781e2a94b27be5bb78f23e43d52336bd663b810d49d7189ad334" +version = "10.0.0" +source = "git+https://github.com/bytecodealliance/wasmtime?branch=release-10.0.0#854fe1ad50968d67e961eed4a573c4dfa8ab7178" dependencies = [ "proc-macro2", "quote", @@ -7164,9 +7033,8 @@ checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" [[package]] name = "winch-codegen" -version = "0.7.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b50a93c2d1b20b921c227019af592ee9a8baf4a09199a6ee97b5f46b740799ab" +version = "0.8.0" +source = "git+https://github.com/bytecodealliance/wasmtime?branch=release-10.0.0#854fe1ad50968d67e961eed4a573c4dfa8ab7178" dependencies = [ "anyhow", "cranelift-codegen", @@ -7174,18 +7042,8 @@ dependencies = [ "regalloc2", "smallvec", "target-lexicon", - "wasmparser 0.103.0", -] - -[[package]] -name = "winch-environ" -version = "0.7.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ea5c7578daccdf34857f45658f61b9eb79c38ac1c7f410e51bd35fe5d4d9431" -dependencies = [ - "wasmparser 0.103.0", + "wasmparser 0.107.0", "wasmtime-environ", - "winch-codegen", ] [[package]] @@ -7382,37 +7240,37 @@ dependencies = [ [[package]] name = "wit-bindgen-gen-core" version = "0.2.0" -source = "git+https://github.com/fermyon/wit-bindgen-backport?rev=634687fde664ed0016179d9427562ac57c2af639#634687fde664ed0016179d9427562ac57c2af639" +source = "git+https://github.com/bytecodealliance/wit-bindgen?rev=cb871cfa1ee460b51eb1d144b175b9aab9c50aba#cb871cfa1ee460b51eb1d144b175b9aab9c50aba" dependencies = [ "anyhow", - "wit-parser 0.2.0 (git+https://github.com/fermyon/wit-bindgen-backport?rev=634687fde664ed0016179d9427562ac57c2af639)", + "wit-parser 0.2.0 (git+https://github.com/bytecodealliance/wit-bindgen?rev=cb871cfa1ee460b51eb1d144b175b9aab9c50aba)", ] [[package]] name = "wit-bindgen-gen-core" version = "0.2.0" -source = "git+https://github.com/bytecodealliance/wit-bindgen?rev=cb871cfa1ee460b51eb1d144b175b9aab9c50aba#cb871cfa1ee460b51eb1d144b175b9aab9c50aba" +source = "git+https://github.com/fermyon/wit-bindgen-backport?rev=d91e1c50be5c94a0737a39743a5467ee880b84c4#d91e1c50be5c94a0737a39743a5467ee880b84c4" dependencies = [ "anyhow", - "wit-parser 0.2.0 (git+https://github.com/bytecodealliance/wit-bindgen?rev=cb871cfa1ee460b51eb1d144b175b9aab9c50aba)", + "wit-parser 0.2.0 (git+https://github.com/fermyon/wit-bindgen-backport?rev=d91e1c50be5c94a0737a39743a5467ee880b84c4)", ] [[package]] name = "wit-bindgen-gen-rust" version = "0.2.0" -source = "git+https://github.com/fermyon/wit-bindgen-backport?rev=634687fde664ed0016179d9427562ac57c2af639#634687fde664ed0016179d9427562ac57c2af639" +source = "git+https://github.com/bytecodealliance/wit-bindgen?rev=cb871cfa1ee460b51eb1d144b175b9aab9c50aba#cb871cfa1ee460b51eb1d144b175b9aab9c50aba" dependencies = [ "heck 0.3.3", - "wit-bindgen-gen-core 0.2.0 (git+https://github.com/fermyon/wit-bindgen-backport?rev=634687fde664ed0016179d9427562ac57c2af639)", + "wit-bindgen-gen-core 0.2.0 (git+https://github.com/bytecodealliance/wit-bindgen?rev=cb871cfa1ee460b51eb1d144b175b9aab9c50aba)", ] [[package]] name = "wit-bindgen-gen-rust" version = "0.2.0" -source = "git+https://github.com/bytecodealliance/wit-bindgen?rev=cb871cfa1ee460b51eb1d144b175b9aab9c50aba#cb871cfa1ee460b51eb1d144b175b9aab9c50aba" +source = "git+https://github.com/fermyon/wit-bindgen-backport?rev=d91e1c50be5c94a0737a39743a5467ee880b84c4#d91e1c50be5c94a0737a39743a5467ee880b84c4" dependencies = [ "heck 0.3.3", - "wit-bindgen-gen-core 0.2.0 (git+https://github.com/bytecodealliance/wit-bindgen?rev=cb871cfa1ee460b51eb1d144b175b9aab9c50aba)", + "wit-bindgen-gen-core 0.2.0 (git+https://github.com/fermyon/wit-bindgen-backport?rev=d91e1c50be5c94a0737a39743a5467ee880b84c4)", ] [[package]] @@ -7428,11 +7286,11 @@ dependencies = [ [[package]] name = "wit-bindgen-gen-wasmtime" version = "0.2.0" -source = "git+https://github.com/fermyon/wit-bindgen-backport?rev=634687fde664ed0016179d9427562ac57c2af639#634687fde664ed0016179d9427562ac57c2af639" +source = "git+https://github.com/fermyon/wit-bindgen-backport?rev=d91e1c50be5c94a0737a39743a5467ee880b84c4#d91e1c50be5c94a0737a39743a5467ee880b84c4" dependencies = [ "heck 0.3.3", - "wit-bindgen-gen-core 0.2.0 (git+https://github.com/fermyon/wit-bindgen-backport?rev=634687fde664ed0016179d9427562ac57c2af639)", - "wit-bindgen-gen-rust 0.2.0 (git+https://github.com/fermyon/wit-bindgen-backport?rev=634687fde664ed0016179d9427562ac57c2af639)", + "wit-bindgen-gen-core 0.2.0 (git+https://github.com/fermyon/wit-bindgen-backport?rev=d91e1c50be5c94a0737a39743a5467ee880b84c4)", + "wit-bindgen-gen-rust 0.2.0 (git+https://github.com/fermyon/wit-bindgen-backport?rev=d91e1c50be5c94a0737a39743a5467ee880b84c4)", ] [[package]] @@ -7459,7 +7317,7 @@ dependencies = [ [[package]] name = "wit-bindgen-wasmtime" version = "0.2.0" -source = "git+https://github.com/fermyon/wit-bindgen-backport?rev=634687fde664ed0016179d9427562ac57c2af639#634687fde664ed0016179d9427562ac57c2af639" +source = "git+https://github.com/fermyon/wit-bindgen-backport?rev=d91e1c50be5c94a0737a39743a5467ee880b84c4#d91e1c50be5c94a0737a39743a5467ee880b84c4" dependencies = [ "anyhow", "async-trait", @@ -7472,11 +7330,11 @@ dependencies = [ [[package]] name = "wit-bindgen-wasmtime-impl" version = "0.2.0" -source = "git+https://github.com/fermyon/wit-bindgen-backport?rev=634687fde664ed0016179d9427562ac57c2af639#634687fde664ed0016179d9427562ac57c2af639" +source = "git+https://github.com/fermyon/wit-bindgen-backport?rev=d91e1c50be5c94a0737a39743a5467ee880b84c4#d91e1c50be5c94a0737a39743a5467ee880b84c4" dependencies = [ "proc-macro2", "syn 1.0.109", - "wit-bindgen-gen-core 0.2.0 (git+https://github.com/fermyon/wit-bindgen-backport?rev=634687fde664ed0016179d9427562ac57c2af639)", + "wit-bindgen-gen-core 0.2.0 (git+https://github.com/fermyon/wit-bindgen-backport?rev=d91e1c50be5c94a0737a39743a5467ee880b84c4)", "wit-bindgen-gen-wasmtime", ] @@ -7492,15 +7350,31 @@ dependencies = [ "log", "url", "wasm-encoder 0.26.0", - "wasm-metadata", + "wasm-metadata 0.5.0", "wasmparser 0.104.0", "wit-parser 0.7.1", ] +[[package]] +name = "wit-component" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7cbd4c7f8f400327c482c88571f373844b7889e61460650d650fc5881bb3575c" +dependencies = [ + "anyhow", + "bitflags 1.3.2", + "indexmap", + "log", + "wasm-encoder 0.29.0", + "wasm-metadata 0.8.0", + "wasmparser 0.107.0", + "wit-parser 0.8.0", +] + [[package]] name = "wit-parser" version = "0.2.0" -source = "git+https://github.com/fermyon/wit-bindgen-backport?rev=634687fde664ed0016179d9427562ac57c2af639#634687fde664ed0016179d9427562ac57c2af639" +source = "git+https://github.com/bytecodealliance/wit-bindgen?rev=cb871cfa1ee460b51eb1d144b175b9aab9c50aba#cb871cfa1ee460b51eb1d144b175b9aab9c50aba" dependencies = [ "anyhow", "id-arena", @@ -7512,7 +7386,7 @@ dependencies = [ [[package]] name = "wit-parser" version = "0.2.0" -source = "git+https://github.com/bytecodealliance/wit-bindgen?rev=cb871cfa1ee460b51eb1d144b175b9aab9c50aba#cb871cfa1ee460b51eb1d144b175b9aab9c50aba" +source = "git+https://github.com/fermyon/wit-bindgen-backport?rev=d91e1c50be5c94a0737a39743a5467ee880b84c4#d91e1c50be5c94a0737a39743a5467ee880b84c4" dependencies = [ "anyhow", "id-arena", @@ -7536,11 +7410,26 @@ dependencies = [ "url", ] +[[package]] +name = "wit-parser" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6daec9f093dbaea0e94043eeb92ece327bbbe70c86b1f41aca9bbfefd7f050f0" +dependencies = [ + "anyhow", + "id-arena", + "indexmap", + "log", + "pulldown-cmark", + "semver 1.0.16", + "unicode-xid", + "url", +] + [[package]] name = "witx" version = "0.9.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e366f27a5cabcddb2706a78296a40b8fcc451e1a6aba2fc1d94b4a01bdaaef4b" +source = "git+https://github.com/bytecodealliance/wasmtime?branch=release-10.0.0#854fe1ad50968d67e961eed4a573c4dfa8ab7178" dependencies = [ "anyhow", "log", diff --git a/Cargo.toml b/Cargo.toml index ad40cf4a77..cc846c1987 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -109,13 +109,16 @@ members = [ [workspace.dependencies] tracing = { version = "0.1", features = ["log"] } -wasmtime-wasi = { version = "9.0.4", features = ["tokio"] } -wasi-common-preview1 = { package = "wasi-common", version = "9.0.4" } -wasmtime = { version = "9.0.4", features = ["component-model"] } -spin-componentize = { git = "https://github.com/fermyon/spin-componentize", rev = "8a596f722556d17cc1dc9b3ae8a7e7a77d3e90ae" } -wasi-host = { package = "host", git = "https://github.com/fermyon/spin-componentize", rev = "8a596f722556d17cc1dc9b3ae8a7e7a77d3e90ae" } -wasi-common = { git = "https://github.com/fermyon/spin-componentize", rev = "8a596f722556d17cc1dc9b3ae8a7e7a77d3e90ae" } -wasi-cap-std-sync = { git = "https://github.com/fermyon/spin-componentize", rev = "8a596f722556d17cc1dc9b3ae8a7e7a77d3e90ae" } +wasmtime-wasi = { git = "https://github.com/bytecodealliance/wasmtime", branch = "release-10.0.0", features = ["tokio"] } +wasi-common-preview1 = { package = "wasi-common", git = "https://github.com/bytecodealliance/wasmtime", branch = "release-10.0.0" } +wasmtime = { git = "https://github.com/bytecodealliance/wasmtime", branch = "release-10.0.0", features = ["component-model"] } +# spin-componentize = { git = "https://github.com/fermyon/spin-componentize", rev = "8a596f722556d17cc1dc9b3ae8a7e7a77d3e90ae" } +# wasi-host = { package = "host", git = "https://github.com/fermyon/spin-componentize", rev = "8a596f722556d17cc1dc9b3ae8a7e7a77d3e90ae" } +# wasi-common = { git = "https://github.com/fermyon/spin-componentize", rev = "8a596f722556d17cc1dc9b3ae8a7e7a77d3e90ae" } +# wasi-cap-std-sync = { git = "https://github.com/fermyon/spin-componentize", rev = "8a596f722556d17cc1dc9b3ae8a7e7a77d3e90ae" } +spin-componentize = { path = "../spin-componentize" } +wasi-common = { path = "../spin-componentize/adapter/wasi-common" } +wasi-cap-std-sync = { path = "../spin-componentize/adapter/wasi-common/cap-std-sync" } [workspace.dependencies.bindle] git = "https://github.com/fermyon/bindle" diff --git a/crates/core/Cargo.toml b/crates/core/Cargo.toml index ace637735f..39192f229d 100644 --- a/crates/core/Cargo.toml +++ b/crates/core/Cargo.toml @@ -9,14 +9,11 @@ anyhow = "1.0" async-trait = "0.1" crossbeam-channel = "0.5" tracing = { workspace = true } -wasi-host = { workspace = true } -wasi-common = { workspace = true } -wasi-common-preview1 = { workspace = true } -wasi-cap-std-sync = { workspace = true } wasmtime = { workspace = true } wasmtime-wasi = { workspace = true } +wasi-common-preview1 = { workspace = true } system-interface = { version = "0.25.1", features = ["cap_std_impls"] } -cap-std = "1.0.5" +cap-std = "1.0.13" [target.'cfg(unix)'.dependencies] rustix = "0.37.19" diff --git a/crates/core/src/io.rs b/crates/core/src/io.rs index 66729ce68a..d37ee93797 100644 --- a/crates/core/src/io.rs +++ b/crates/core/src/io.rs @@ -1,6 +1,6 @@ use std::sync::{Arc, RwLock}; -use wasi_common::pipe::WritePipe; +use wasmtime_wasi::preview2::pipe::WritePipe; /// An in-memory stdio output buffer. #[derive(Default)] @@ -19,7 +19,7 @@ impl OutputBuffer { #[cfg(test)] mod tests { - use wasi_common::OutputStream; + use wasmtime_wasi::preview2::OutputStream; use super::*; diff --git a/crates/core/src/lib.rs b/crates/core/src/lib.rs index 8c9dbfe602..6f50c894df 100644 --- a/crates/core/src/lib.rs +++ b/crates/core/src/lib.rs @@ -19,12 +19,13 @@ use anyhow::Result; pub use async_trait::async_trait; use crossbeam_channel::Sender; use tracing::instrument; -pub use wasi_common::I32Exit; pub use wasmtime::{ self, component::{Component, Instance}, Instance as ModuleInstance, Module, Trap, }; +use wasmtime_wasi::preview2::Table; +pub use wasmtime_wasi::I32Exit; use self::host_component::{HostComponents, HostComponentsBuilder}; @@ -32,7 +33,7 @@ pub use host_component::{ AnyHostComponentDataHandle, HostComponent, HostComponentDataHandle, HostComponentsData, }; pub use io::OutputBuffer; -pub use store::{Store, StoreBuilder, Wasi}; +pub use store::{Store, StoreBuilder, Wasi, WasiVersion}; /// The default [`EngineBuilder::epoch_tick_interval`]. pub const DEFAULT_EPOCH_TICK_INTERVAL: Duration = Duration::from_millis(10); @@ -69,6 +70,7 @@ pub struct Data { wasi: Wasi, host_components_data: HostComponentsData, store_limits: limits::StoreLimitsAsync, + table: Table, } impl Data { @@ -90,6 +92,30 @@ impl AsMut for Data { } } +impl wasmtime_wasi::preview2::WasiView for Data { + fn table(&self) -> &wasmtime_wasi::preview2::Table { + &self.table + } + + fn table_mut(&mut self) -> &mut wasmtime_wasi::preview2::Table { + &mut self.table + } + + fn ctx(&self) -> &wasmtime_wasi::preview2::WasiCtx { + match &self.wasi { + Wasi::Preview1(_) => panic!("using WASI Preview 1 functions with Preview 2 store"), + Wasi::Preview2(ctx) => ctx, + } + } + + fn ctx_mut(&mut self) -> &mut wasmtime_wasi::preview2::WasiCtx { + match &mut self.wasi { + Wasi::Preview1(_) => panic!("using WASI Preview 1 functions with Preview 2 store"), + Wasi::Preview2(ctx) => ctx, + } + } +} + /// An alias for [`wasmtime::Linker`] specialized to [`Data`]. pub type ModuleLinker = wasmtime::Linker>; @@ -113,10 +139,7 @@ impl EngineBuilder { let engine = wasmtime::Engine::new(&config.inner)?; let mut linker: Linker = Linker::new(&engine); - wasi_host::command::add_to_linker(&mut linker, |data| match &mut data.wasi { - Wasi::Preview1(_) => panic!("using WASI Preview 1 functions with Preview 2 store"), - Wasi::Preview2(ctx) => ctx, - })?; + wasmtime_wasi::preview2::wasi::command::add_to_linker(&mut linker)?; let mut module_linker = ModuleLinker::new(&engine); wasmtime_wasi::tokio::add_to_linker(&mut module_linker, |data| match &mut data.wasi { @@ -241,12 +264,12 @@ impl Engine { } /// Creates a new [`StoreBuilder`]. - pub fn store_builder(&self, wasi: Wasi) -> StoreBuilder { + pub fn store_builder(&self, wasi_version: WasiVersion) -> StoreBuilder { StoreBuilder::new( self.inner.clone(), self.epoch_tick_interval, &self.host_components, - wasi, + wasi_version, ) } diff --git a/crates/core/src/store.rs b/crates/core/src/store.rs index 3147ed7558..fd32a42281 100644 --- a/crates/core/src/store.rs +++ b/crates/core/src/store.rs @@ -5,10 +5,11 @@ use std::{ time::{Duration, Instant}, }; use system_interface::io::ReadReady; -use wasi_cap_std_sync as wasmtime_wasi_preview2; -use wasi_common as wasi_preview2; use wasi_common_preview1 as wasi_preview1; use wasmtime_wasi as wasmtime_wasi_preview1; +use wasmtime_wasi::preview2 as wasi_preview2; +use wasmtime_wasi::preview2 as wasmtime_wasi_preview2; +use wasmtime_wasi_preview1::preview2::Table; use crate::{ host_component::{HostComponents, HostComponentsData}, @@ -42,16 +43,11 @@ pub enum Wasi { Preview2(wasi_preview2::WasiCtx), } -impl Wasi { - /// Create a new `Wasi::Preview1` context - pub fn new_preview1() -> Self { - Self::Preview1(wasmtime_wasi_preview1::WasiCtxBuilder::new().build()) - } - - /// Create a new `Wasi::Preview2` context - pub fn new_preview2() -> Self { - Self::Preview2(wasmtime_wasi_preview2::WasiCtxBuilder::new().build()) - } +/// The version of Wasi being used +#[allow(missing_docs)] +pub enum WasiVersion { + Preview1, + Preview2, } /// A `Store` holds the runtime state of a Spin instance. @@ -125,7 +121,7 @@ impl wasmtime::AsContextMut for Store { pub struct StoreBuilder { engine: wasmtime::Engine, epoch_tick_interval: Duration, - wasi: std::result::Result, + wasi: std::result::Result, host_components_data: HostComponentsData, store_limits: StoreLimitsAsync, } @@ -136,12 +132,12 @@ impl StoreBuilder { engine: wasmtime::Engine, epoch_tick_interval: Duration, host_components: &HostComponents, - wasi: Wasi, + wasi: WasiVersion, ) -> Self { Self { engine, epoch_tick_interval, - wasi: Ok(wasi), + wasi: Ok(wasi.into()), host_components_data: host_components.new_data(), store_limits: StoreLimitsAsync::default(), } @@ -158,27 +154,36 @@ impl StoreBuilder { /// Inherit stdin from the host process. pub fn inherit_stdin(&mut self) { self.with_wasi(|wasi| match wasi { - Wasi::Preview1(ctx) => ctx.set_stdin(Box::new(wasmtime_wasi_preview1::stdio::stdin())), - Wasi::Preview2(ctx) => ctx.set_stdin(Box::new(wasmtime_wasi_preview2::stdio::stdin())), + WasiCtxBuilder::Preview1(ctx) => { + ctx.set_stdin(Box::new(wasmtime_wasi_preview1::stdio::stdin())) + } + WasiCtxBuilder::Preview2(ctx) => { + *ctx = std::mem::take(ctx).set_stdin(wasmtime_wasi_preview2::stdio::stdin()) + } }); } /// Sets the WASI `stdin` descriptor to the given [`Read`]er. pub fn stdin_pipe(&mut self, r: impl Read + ReadReady + Send + Sync + 'static) { self.with_wasi(|wasi| match wasi { - Wasi::Preview1(ctx) => ctx.set_stdin(Box::new(wasi_preview1::pipe::ReadPipe::new(r))), - Wasi::Preview2(ctx) => ctx.set_stdin(Box::new(wasi_preview2::pipe::ReadPipe::new(r))), + WasiCtxBuilder::Preview1(ctx) => { + ctx.set_stdin(Box::new(wasi_preview1::pipe::ReadPipe::new(r))) + } + WasiCtxBuilder::Preview2(ctx) => { + *ctx = std::mem::take(ctx).set_stdin(wasi_preview2::pipe::ReadPipe::new(r)) + } }) } /// Inherit stdin from the host process. pub fn inherit_stdout(&mut self) { self.with_wasi(|wasi| match wasi { - Wasi::Preview1(ctx) => { + WasiCtxBuilder::Preview1(ctx) => { ctx.set_stdout(Box::new(wasmtime_wasi_preview1::stdio::stdout())) } - Wasi::Preview2(ctx) => { - ctx.set_stdout(Box::new(wasmtime_wasi_preview2::stdio::stdout())) + WasiCtxBuilder::Preview2(ctx) => { + *ctx = std::mem::take(ctx) + .set_stdout(wasmtime_wasi_preview1::preview2::stdio::stdout()) } }); } @@ -186,11 +191,11 @@ impl StoreBuilder { /// Sets the WASI `stdout` descriptor to the given [`Write`]er. pub fn stdout(&mut self, w: Box) -> Result<()> { self.try_with_wasi(|wasi| match wasi { - Wasi::Preview1(ctx) => { + WasiCtxBuilder::Preview1(ctx) => { ctx.set_stdout(w); Ok(()) } - Wasi::Preview2(_) => Err(anyhow!( + WasiCtxBuilder::Preview2(_) => Err(anyhow!( "`Store::stdout` only supported with WASI Preview 1" )), }) @@ -199,8 +204,12 @@ impl StoreBuilder { /// Sets the WASI `stdout` descriptor to the given [`Write`]er. pub fn stdout_pipe(&mut self, w: impl Write + Send + Sync + 'static) { self.with_wasi(|wasi| match wasi { - Wasi::Preview1(ctx) => ctx.set_stdout(Box::new(wasi_preview1::pipe::WritePipe::new(w))), - Wasi::Preview2(ctx) => ctx.set_stdout(Box::new(wasi_preview2::pipe::WritePipe::new(w))), + WasiCtxBuilder::Preview1(ctx) => { + ctx.set_stdout(Box::new(wasi_preview1::pipe::WritePipe::new(w))) + } + WasiCtxBuilder::Preview2(ctx) => { + *ctx = std::mem::take(ctx).set_stdout(wasi_preview2::pipe::WritePipe::new(w)) + } }) } @@ -210,11 +219,11 @@ impl StoreBuilder { let buffer = OutputBuffer::default(); // This only needs to work with Preview 2 since WAGI does its own thing with Preview 1: self.try_with_wasi(|wasi| match wasi { - Wasi::Preview1(_) => Err(anyhow!( + WasiCtxBuilder::Preview1(_) => Err(anyhow!( "`Store::stdout_buffered` only supported with WASI Preview 2" )), - Wasi::Preview2(ctx) => { - ctx.set_stdout(Box::new(buffer.writer())); + WasiCtxBuilder::Preview2(ctx) => { + *ctx = std::mem::take(ctx).set_stdout(buffer.writer()); Ok(()) } })?; @@ -224,11 +233,11 @@ impl StoreBuilder { /// Inherit stdin from the host process. pub fn inherit_stderr(&mut self) { self.with_wasi(|wasi| match wasi { - Wasi::Preview1(ctx) => { + WasiCtxBuilder::Preview1(ctx) => { ctx.set_stderr(Box::new(wasmtime_wasi_preview1::stdio::stderr())) } - Wasi::Preview2(ctx) => { - ctx.set_stderr(Box::new(wasmtime_wasi_preview2::stdio::stderr())) + WasiCtxBuilder::Preview2(ctx) => { + *ctx = std::mem::take(ctx).set_stderr(wasmtime_wasi_preview2::stdio::stderr()) } }); } @@ -236,8 +245,12 @@ impl StoreBuilder { /// Sets the WASI `stderr` descriptor to the given [`Write`]er. pub fn stderr_pipe(&mut self, w: impl Write + Send + Sync + 'static) { self.with_wasi(|wasi| match wasi { - Wasi::Preview1(ctx) => ctx.set_stderr(Box::new(wasi_preview1::pipe::WritePipe::new(w))), - Wasi::Preview2(ctx) => ctx.set_stderr(Box::new(wasi_preview2::pipe::WritePipe::new(w))), + WasiCtxBuilder::Preview1(ctx) => { + ctx.set_stderr(Box::new(wasi_preview1::pipe::WritePipe::new(w))) + } + WasiCtxBuilder::Preview2(ctx) => { + *ctx = std::mem::take(ctx).set_stderr(wasi_preview2::pipe::WritePipe::new(w)) + } }) } @@ -246,8 +259,8 @@ impl StoreBuilder { self.try_with_wasi(|wasi| { for arg in args { match wasi { - Wasi::Preview1(ctx) => ctx.push_arg(arg)?, - Wasi::Preview2(ctx) => ctx.push_arg(arg), + WasiCtxBuilder::Preview1(ctx) => ctx.push_arg(arg)?, + WasiCtxBuilder::Preview2(ctx) => *ctx = std::mem::take(ctx).push_arg(arg), } } Ok(()) @@ -262,8 +275,10 @@ impl StoreBuilder { self.try_with_wasi(|wasi| { for (k, v) in vars { match wasi { - Wasi::Preview1(ctx) => ctx.push_env(k.as_ref(), v.as_ref())?, - Wasi::Preview2(ctx) => ctx.push_env(k.as_ref(), v.as_ref()), + WasiCtxBuilder::Preview1(ctx) => ctx.push_env(k.as_ref(), v.as_ref())?, + WasiCtxBuilder::Preview2(ctx) => { + *ctx = std::mem::take(ctx).push_env(k, v); + } } } @@ -305,7 +320,7 @@ impl StoreBuilder { self.try_with_wasi(|wasi| { match wasi { - Wasi::Preview1(ctx) => { + WasiCtxBuilder::Preview1(ctx) => { let mut dir = Box::new(wasmtime_wasi_preview1::dir::Dir::from_cap_std(cap_std_dir)) as _; if !writable { @@ -313,13 +328,20 @@ impl StoreBuilder { } ctx.push_preopened_dir(dir, path)?; } - Wasi::Preview2(ctx) => { - let mut dir = - Box::new(wasmtime_wasi_preview2::dir::Dir::from_cap_std(cap_std_dir)) as _; - if !writable { - dir = Box::new(wasi_preview2::dir::ReadOnlyDir(dir)); - } - ctx.push_preopened_dir(dir, path)?; + WasiCtxBuilder::Preview2(ctx) => { + let dir_perms = if writable { + wasi_preview2::DirPerms::all() + } else { + wasi_preview2::DirPerms::READ + }; + let file_perms = wasi_preview2::FilePerms::all(); + + *ctx = std::mem::take(ctx).push_preopened_dir( + cap_std_dir, + dir_perms, + file_perms, + path, + ); } } Ok(()) @@ -335,7 +357,7 @@ impl StoreBuilder { /// /// If `T: Default`, it may be preferable to use [`Store::build`]. pub fn build_with_data(self, inner_data: T) -> Result> { - let wasi = self.wasi.map_err(anyhow::Error::msg)?; + let wasi = self.wasi.map_err(anyhow::Error::msg)?.try_into()?; let mut inner = wasmtime::Store::new( &self.engine, @@ -344,6 +366,7 @@ impl StoreBuilder { wasi, host_components_data: self.host_components_data, store_limits: self.store_limits, + table: Table::new(), }, ); @@ -366,14 +389,14 @@ impl StoreBuilder { self.build_with_data(T::default()) } - fn with_wasi(&mut self, f: impl FnOnce(&mut Wasi)) { + fn with_wasi(&mut self, f: impl FnOnce(&mut WasiCtxBuilder)) { let _ = self.try_with_wasi(|wasi| { f(wasi); Ok(()) }); } - fn try_with_wasi(&mut self, f: impl FnOnce(&mut Wasi) -> Result<()>) -> Result<()> { + fn try_with_wasi(&mut self, f: impl FnOnce(&mut WasiCtxBuilder) -> Result<()>) -> Result<()> { let wasi = self .wasi .as_mut() @@ -388,3 +411,35 @@ impl StoreBuilder { } } } + +/// A builder of a `WasiCtx` for all versions of Wasi +enum WasiCtxBuilder { + Preview1(wasi_preview1::WasiCtx), + Preview2(wasi_preview2::WasiCtxBuilder), +} + +impl From for WasiCtxBuilder { + fn from(value: WasiVersion) -> Self { + match value { + WasiVersion::Preview1 => { + Self::Preview1(wasmtime_wasi_preview1::WasiCtxBuilder::new().build()) + } + WasiVersion::Preview2 => Self::Preview2(wasi_preview2::WasiCtxBuilder::new()), + } + } +} + +impl TryFrom for Wasi { + type Error = anyhow::Error; + + fn try_from(value: WasiCtxBuilder) -> std::result::Result { + match value { + WasiCtxBuilder::Preview1(ctx) => Ok(Self::Preview1(ctx)), + WasiCtxBuilder::Preview2(b) => { + // We don't support resources yet so for now we can just use an empty table + let mut table = wasmtime_wasi_preview2::Table::new(); + b.build(&mut table).map(Wasi::Preview2) + } + } + } +} diff --git a/crates/core/tests/core-wasi-test/Cargo.toml b/crates/core/tests/core-wasi-test/Cargo.toml index 9de6561859..49204d2759 100644 --- a/crates/core/tests/core-wasi-test/Cargo.toml +++ b/crates/core/tests/core-wasi-test/Cargo.toml @@ -7,6 +7,6 @@ edition = "2021" debug = true [dependencies] -wit-bindgen = "0.6.0" +wit-bindgen = "0.7.0" [workspace] diff --git a/crates/core/tests/core-wasi-test/wit/multiplier.wit b/crates/core/tests/core-wasi-test/wit/multiplier.wit index a79b5bf243..0f3bf4c689 100644 --- a/crates/core/tests/core-wasi-test/wit/multiplier.wit +++ b/crates/core/tests/core-wasi-test/wit/multiplier.wit @@ -1,4 +1,6 @@ -default world multiplier { +package test:test + +world multiplier { import imports: interface { multiply: func(n: s32) -> s32 } diff --git a/crates/core/tests/integration_test.rs b/crates/core/tests/integration_test.rs index 953d7ed927..c781f120f7 100644 --- a/crates/core/tests/integration_test.rs +++ b/crates/core/tests/integration_test.rs @@ -5,7 +5,7 @@ use std::{ }; use spin_core::{ - Component, Config, Engine, HostComponent, I32Exit, Store, StoreBuilder, Trap, Wasi, + Component, Config, Engine, HostComponent, I32Exit, Store, StoreBuilder, Trap, WasiVersion, }; use tempfile::TempDir; use tokio::fs; @@ -187,7 +187,7 @@ async fn run_core_wasi_test_engine<'a>( update_store_builder: impl FnOnce(&mut StoreBuilder), update_store: impl FnOnce(&mut Store<()>), ) -> anyhow::Result { - let mut store_builder: StoreBuilder = engine.store_builder(Wasi::new_preview2()); + let mut store_builder: StoreBuilder = engine.store_builder(WasiVersion::Preview2); let mut stdout_buf = store_builder.stdout_buffered()?; store_builder.stderr_pipe(TestWriter); store_builder.args(args)?; diff --git a/crates/templates/Cargo.toml b/crates/templates/Cargo.toml index d6f7cac57e..7bd74c0965 100644 --- a/crates/templates/Cargo.toml +++ b/crates/templates/Cargo.toml @@ -37,5 +37,5 @@ wasmtime-wasi = { workspace = true } [dependencies.wit-bindgen-wasmtime] git = "https://github.com/fermyon/wit-bindgen-backport" -rev = "634687fde664ed0016179d9427562ac57c2af639" +rev = "d91e1c50be5c94a0737a39743a5467ee880b84c4" features = ["async"] diff --git a/crates/trigger-http/src/wagi.rs b/crates/trigger-http/src/wagi.rs index dae2a0db90..435c361876 100644 --- a/crates/trigger-http/src/wagi.rs +++ b/crates/trigger-http/src/wagi.rs @@ -6,7 +6,7 @@ use hyper::{ body::{self}, Body, Request, Response, }; -use spin_core::Wasi; +use spin_core::WasiVersion; use spin_http::{config::WagiTriggerConfig, routes::RoutePattern, wagi}; use spin_trigger::{EitherInstance, TriggerAppEngine}; use wasi_common_preview1::{pipe::WritePipe, I32Exit}; @@ -84,7 +84,7 @@ impl HttpExecutor for WagiHttpExecutor { let stdout = WritePipe::new_in_memory(); - let mut store_builder = engine.store_builder(component, Wasi::new_preview1())?; + let mut store_builder = engine.store_builder(component, WasiVersion::Preview1)?; // Set up Wagi environment store_builder.args(argv.split(' '))?; store_builder.env(headers)?; diff --git a/crates/trigger/src/lib.rs b/crates/trigger/src/lib.rs index 0b76eeae24..da9a42e562 100644 --- a/crates/trigger/src/lib.rs +++ b/crates/trigger/src/lib.rs @@ -14,7 +14,7 @@ use serde::de::DeserializeOwned; use spin_app::{App, AppComponent, AppLoader, AppTrigger, Loader, OwnedApp}; use spin_core::{ Config, Engine, EngineBuilder, Instance, InstancePre, ModuleInstance, ModuleInstancePre, Store, - StoreBuilder, Wasi, + StoreBuilder, WasiVersion, }; pub use crate::runtime_config::RuntimeConfig; @@ -236,8 +236,12 @@ impl TriggerAppEngine { } /// Returns a new StoreBuilder for the given component ID. - pub fn store_builder(&self, component_id: &str, wasi: Wasi) -> Result { - let mut builder = self.engine.store_builder(wasi); + pub fn store_builder( + &self, + component_id: &str, + wasi_version: WasiVersion, + ) -> Result { + let mut builder = self.engine.store_builder(wasi_version); let component = self.get_component(component_id)?; self.hooks .iter() @@ -250,7 +254,7 @@ impl TriggerAppEngine { &self, component_id: &str, ) -> Result<(EitherInstance, Store)> { - let store_builder = self.store_builder(component_id, Wasi::new_preview2())?; + let store_builder = self.store_builder(component_id, WasiVersion::Preview2)?; self.prepare_instance_with_store(component_id, store_builder) .await } diff --git a/crates/world/src/lib.rs b/crates/world/src/lib.rs index c045e9ec43..2181cbbc1e 100644 --- a/crates/world/src/lib.rs +++ b/crates/world/src/lib.rs @@ -5,3 +5,5 @@ wasmtime::component::bindgen!({ world: "reactor", async: true }); + +pub use fermyon::spin::*; diff --git a/wit/preview2/config.wit b/wit/preview2/config.wit index acdd206f77..2513e9e2a2 100644 --- a/wit/preview2/config.wit +++ b/wit/preview2/config.wit @@ -1,4 +1,4 @@ -default interface config { +interface config { // Get a configuration value for the current component. // The config key must match one defined in in the component manifest. get-config: func(key: string) -> result diff --git a/wit/preview2/http-types.wit b/wit/preview2/http-types.wit index bd69b4791e..5d156046bd 100644 --- a/wit/preview2/http-types.wit +++ b/wit/preview2/http-types.wit @@ -1,4 +1,4 @@ -default interface http-types { +interface http-types { type http-status = u16 type body = list diff --git a/wit/preview2/http.wit b/wit/preview2/http.wit index 4e906d5c48..faac938aca 100644 --- a/wit/preview2/http.wit +++ b/wit/preview2/http.wit @@ -1,5 +1,5 @@ -default interface http { - use pkg.http-types.{request, response, http-error} +interface http { + use http-types.{request, response, http-error} send-request: func(req: request) -> result } diff --git a/wit/preview2/inbound-http.wit b/wit/preview2/inbound-http.wit index f20df00255..0fef7f58dd 100644 --- a/wit/preview2/inbound-http.wit +++ b/wit/preview2/inbound-http.wit @@ -1,5 +1,5 @@ -default interface inbound-http { - use pkg.http-types.{request, response} +interface inbound-http { + use http-types.{request, response} handle-request: func(req: request) -> response } diff --git a/wit/preview2/inbound-redis.wit b/wit/preview2/inbound-redis.wit index b71cb799e2..2a027c5467 100644 --- a/wit/preview2/inbound-redis.wit +++ b/wit/preview2/inbound-redis.wit @@ -1,5 +1,5 @@ -default interface inbound-redis { - use pkg.redis-types.{payload, error} +interface inbound-redis { + use redis-types.{payload, error} // The entrypoint for a Redis handler. handle-message: func(message: payload) -> result<_, error> diff --git a/wit/preview2/key-value.wit b/wit/preview2/key-value.wit index 91ae81228e..29218f5871 100644 --- a/wit/preview2/key-value.wit +++ b/wit/preview2/key-value.wit @@ -1,4 +1,4 @@ -default interface key-value { +interface key-value { // A handle to an open key-value store type store = u32 diff --git a/wit/preview2/mysql.wit b/wit/preview2/mysql.wit index 348739cdf0..a08d86f5ef 100644 --- a/wit/preview2/mysql.wit +++ b/wit/preview2/mysql.wit @@ -1,5 +1,5 @@ -default interface mysql { - use pkg.rdbms-types.{parameter-value, row-set} +interface mysql { + use rdbms-types.{parameter-value, row-set} // General purpose error. variant mysql-error { diff --git a/wit/preview2/postgres.wit b/wit/preview2/postgres.wit index 9fd7a35465..d9c8afef68 100644 --- a/wit/preview2/postgres.wit +++ b/wit/preview2/postgres.wit @@ -1,5 +1,5 @@ -default interface postgres { - use pkg.rdbms-types.{parameter-value, row-set} +interface postgres { + use rdbms-types.{parameter-value, row-set} // General purpose error. variant pg-error { diff --git a/wit/preview2/rdbms-types.wit b/wit/preview2/rdbms-types.wit index b2bd41f1d6..ffadd9a3e2 100644 --- a/wit/preview2/rdbms-types.wit +++ b/wit/preview2/rdbms-types.wit @@ -1,4 +1,4 @@ -default interface rdbms-types { +interface rdbms-types { enum db-data-type { boolean, int8, diff --git a/wit/preview2/reactor.wit b/wit/preview2/reactor.wit index 042c1da4b8..c06a4bdf80 100644 --- a/wit/preview2/reactor.wit +++ b/wit/preview2/reactor.wit @@ -1,11 +1,13 @@ -default world reactor { - import config: pkg.config - import postgres: pkg.postgres - import mysql: pkg.mysql - import sqlite: pkg.sqlite - import redis: pkg.redis - import key-value: pkg.key-value - import http: pkg.http - export inbound-http: pkg.inbound-http - export inbound-redis: pkg.inbound-redis +package fermyon:spin + +world reactor { + import config + import postgres + import mysql + import sqlite + import redis + import key-value + import http + export inbound-http + export inbound-redis } diff --git a/wit/preview2/redis-types.wit b/wit/preview2/redis-types.wit index ab762dc08d..e08d593dd5 100644 --- a/wit/preview2/redis-types.wit +++ b/wit/preview2/redis-types.wit @@ -1,4 +1,4 @@ -default interface redis-types { +interface redis-types { // General purpose error. enum error { success, diff --git a/wit/preview2/redis.wit b/wit/preview2/redis.wit index b4413c331a..6d1d1da3e1 100644 --- a/wit/preview2/redis.wit +++ b/wit/preview2/redis.wit @@ -1,5 +1,5 @@ -default interface redis { - use pkg.redis-types.{payload, redis-parameter, redis-result, error} +interface redis { + use redis-types.{payload, redis-parameter, redis-result, error} // Publish a Redis message to the specificed channel and return an error, if any. publish: func(address: string, channel: string, payload: payload) -> result<_, error> diff --git a/wit/preview2/sqlite.wit b/wit/preview2/sqlite.wit index a539b905e8..8d802edf81 100644 --- a/wit/preview2/sqlite.wit +++ b/wit/preview2/sqlite.wit @@ -1,4 +1,4 @@ -default interface sqlite { +interface sqlite { // A handle to an open sqlite instance type connection = u32 From 8b45b3a0f395a3302b7f5e7bdf66777fa9ab2410 Mon Sep 17 00:00:00 2001 From: Ryan Levick Date: Wed, 14 Jun 2023 17:26:55 +0200 Subject: [PATCH 2/9] Help debugging Signed-off-by: Ryan Levick --- Cargo.lock | 103 +++++++++++--------------------- Cargo.toml | 6 +- crates/core/src/store.rs | 3 +- crates/trigger-http/src/spin.rs | 2 +- 4 files changed, 39 insertions(+), 75 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 8915139c8a..a12b2f87ca 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -850,16 +850,14 @@ dependencies = [ [[package]] name = "cranelift-bforest" -version = "0.97.0" -source = "git+https://github.com/bytecodealliance/wasmtime?branch=release-10.0.0#854fe1ad50968d67e961eed4a573c4dfa8ab7178" +version = "0.98.0" dependencies = [ "cranelift-entity", ] [[package]] name = "cranelift-codegen" -version = "0.97.0" -source = "git+https://github.com/bytecodealliance/wasmtime?branch=release-10.0.0#854fe1ad50968d67e961eed4a573c4dfa8ab7178" +version = "0.98.0" dependencies = [ "bumpalo", "cranelift-bforest", @@ -878,37 +876,32 @@ dependencies = [ [[package]] name = "cranelift-codegen-meta" -version = "0.97.0" -source = "git+https://github.com/bytecodealliance/wasmtime?branch=release-10.0.0#854fe1ad50968d67e961eed4a573c4dfa8ab7178" +version = "0.98.0" dependencies = [ "cranelift-codegen-shared", ] [[package]] name = "cranelift-codegen-shared" -version = "0.97.0" -source = "git+https://github.com/bytecodealliance/wasmtime?branch=release-10.0.0#854fe1ad50968d67e961eed4a573c4dfa8ab7178" +version = "0.98.0" [[package]] name = "cranelift-control" -version = "0.97.0" -source = "git+https://github.com/bytecodealliance/wasmtime?branch=release-10.0.0#854fe1ad50968d67e961eed4a573c4dfa8ab7178" +version = "0.98.0" dependencies = [ "arbitrary", ] [[package]] name = "cranelift-entity" -version = "0.97.0" -source = "git+https://github.com/bytecodealliance/wasmtime?branch=release-10.0.0#854fe1ad50968d67e961eed4a573c4dfa8ab7178" +version = "0.98.0" dependencies = [ "serde", ] [[package]] name = "cranelift-frontend" -version = "0.97.0" -source = "git+https://github.com/bytecodealliance/wasmtime?branch=release-10.0.0#854fe1ad50968d67e961eed4a573c4dfa8ab7178" +version = "0.98.0" dependencies = [ "cranelift-codegen", "log", @@ -918,13 +911,11 @@ dependencies = [ [[package]] name = "cranelift-isle" -version = "0.97.0" -source = "git+https://github.com/bytecodealliance/wasmtime?branch=release-10.0.0#854fe1ad50968d67e961eed4a573c4dfa8ab7178" +version = "0.98.0" [[package]] name = "cranelift-native" -version = "0.97.0" -source = "git+https://github.com/bytecodealliance/wasmtime?branch=release-10.0.0#854fe1ad50968d67e961eed4a573c4dfa8ab7178" +version = "0.98.0" dependencies = [ "cranelift-codegen", "libc", @@ -933,8 +924,7 @@ dependencies = [ [[package]] name = "cranelift-wasm" -version = "0.97.0" -source = "git+https://github.com/bytecodealliance/wasmtime?branch=release-10.0.0#854fe1ad50968d67e961eed4a573c4dfa8ab7178" +version = "0.98.0" dependencies = [ "cranelift-codegen", "cranelift-entity", @@ -6349,8 +6339,7 @@ checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" [[package]] name = "wasi-cap-std-sync" -version = "10.0.0" -source = "git+https://github.com/bytecodealliance/wasmtime?branch=release-10.0.0#854fe1ad50968d67e961eed4a573c4dfa8ab7178" +version = "11.0.0" dependencies = [ "anyhow", "async-trait", @@ -6372,8 +6361,7 @@ dependencies = [ [[package]] name = "wasi-common" -version = "10.0.0" -source = "git+https://github.com/bytecodealliance/wasmtime?branch=release-10.0.0#854fe1ad50968d67e961eed4a573c4dfa8ab7178" +version = "11.0.0" dependencies = [ "anyhow", "bitflags 1.3.2", @@ -6391,8 +6379,7 @@ dependencies = [ [[package]] name = "wasi-tokio" -version = "10.0.0" -source = "git+https://github.com/bytecodealliance/wasmtime?branch=release-10.0.0#854fe1ad50968d67e961eed4a573c4dfa8ab7178" +version = "11.0.0" dependencies = [ "anyhow", "cap-std", @@ -6560,8 +6547,7 @@ dependencies = [ [[package]] name = "wasmtime" -version = "10.0.0" -source = "git+https://github.com/bytecodealliance/wasmtime?branch=release-10.0.0#854fe1ad50968d67e961eed4a573c4dfa8ab7178" +version = "11.0.0" dependencies = [ "anyhow", "async-trait", @@ -6597,16 +6583,14 @@ dependencies = [ [[package]] name = "wasmtime-asm-macros" -version = "10.0.0" -source = "git+https://github.com/bytecodealliance/wasmtime?branch=release-10.0.0#854fe1ad50968d67e961eed4a573c4dfa8ab7178" +version = "11.0.0" dependencies = [ "cfg-if", ] [[package]] name = "wasmtime-cache" -version = "10.0.0" -source = "git+https://github.com/bytecodealliance/wasmtime?branch=release-10.0.0#854fe1ad50968d67e961eed4a573c4dfa8ab7178" +version = "11.0.0" dependencies = [ "anyhow", "base64 0.21.0", @@ -6624,8 +6608,7 @@ dependencies = [ [[package]] name = "wasmtime-component-macro" -version = "10.0.0" -source = "git+https://github.com/bytecodealliance/wasmtime?branch=release-10.0.0#854fe1ad50968d67e961eed4a573c4dfa8ab7178" +version = "11.0.0" dependencies = [ "anyhow", "proc-macro2", @@ -6638,13 +6621,11 @@ dependencies = [ [[package]] name = "wasmtime-component-util" -version = "10.0.0" -source = "git+https://github.com/bytecodealliance/wasmtime?branch=release-10.0.0#854fe1ad50968d67e961eed4a573c4dfa8ab7178" +version = "11.0.0" [[package]] name = "wasmtime-cranelift" -version = "10.0.0" -source = "git+https://github.com/bytecodealliance/wasmtime?branch=release-10.0.0#854fe1ad50968d67e961eed4a573c4dfa8ab7178" +version = "11.0.0" dependencies = [ "anyhow", "cranelift-codegen", @@ -6665,8 +6646,7 @@ dependencies = [ [[package]] name = "wasmtime-cranelift-shared" -version = "10.0.0" -source = "git+https://github.com/bytecodealliance/wasmtime?branch=release-10.0.0#854fe1ad50968d67e961eed4a573c4dfa8ab7178" +version = "11.0.0" dependencies = [ "anyhow", "cranelift-codegen", @@ -6680,8 +6660,7 @@ dependencies = [ [[package]] name = "wasmtime-environ" -version = "10.0.0" -source = "git+https://github.com/bytecodealliance/wasmtime?branch=release-10.0.0#854fe1ad50968d67e961eed4a573c4dfa8ab7178" +version = "11.0.0" dependencies = [ "anyhow", "cranelift-entity", @@ -6701,8 +6680,7 @@ dependencies = [ [[package]] name = "wasmtime-fiber" -version = "10.0.0" -source = "git+https://github.com/bytecodealliance/wasmtime?branch=release-10.0.0#854fe1ad50968d67e961eed4a573c4dfa8ab7178" +version = "11.0.0" dependencies = [ "cc", "cfg-if", @@ -6713,8 +6691,7 @@ dependencies = [ [[package]] name = "wasmtime-jit" -version = "10.0.0" -source = "git+https://github.com/bytecodealliance/wasmtime?branch=release-10.0.0#854fe1ad50968d67e961eed4a573c4dfa8ab7178" +version = "11.0.0" dependencies = [ "addr2line", "anyhow", @@ -6738,8 +6715,7 @@ dependencies = [ [[package]] name = "wasmtime-jit-debug" -version = "10.0.0" -source = "git+https://github.com/bytecodealliance/wasmtime?branch=release-10.0.0#854fe1ad50968d67e961eed4a573c4dfa8ab7178" +version = "11.0.0" dependencies = [ "object", "once_cell", @@ -6748,8 +6724,7 @@ dependencies = [ [[package]] name = "wasmtime-jit-icache-coherence" -version = "10.0.0" -source = "git+https://github.com/bytecodealliance/wasmtime?branch=release-10.0.0#854fe1ad50968d67e961eed4a573c4dfa8ab7178" +version = "11.0.0" dependencies = [ "cfg-if", "libc", @@ -6758,8 +6733,7 @@ dependencies = [ [[package]] name = "wasmtime-runtime" -version = "10.0.0" -source = "git+https://github.com/bytecodealliance/wasmtime?branch=release-10.0.0#854fe1ad50968d67e961eed4a573c4dfa8ab7178" +version = "11.0.0" dependencies = [ "anyhow", "cc", @@ -6784,8 +6758,7 @@ dependencies = [ [[package]] name = "wasmtime-types" -version = "10.0.0" -source = "git+https://github.com/bytecodealliance/wasmtime?branch=release-10.0.0#854fe1ad50968d67e961eed4a573c4dfa8ab7178" +version = "11.0.0" dependencies = [ "cranelift-entity", "serde", @@ -6795,8 +6768,7 @@ dependencies = [ [[package]] name = "wasmtime-wasi" -version = "10.0.0" -source = "git+https://github.com/bytecodealliance/wasmtime?branch=release-10.0.0#854fe1ad50968d67e961eed4a573c4dfa8ab7178" +version = "11.0.0" dependencies = [ "anyhow", "async-trait", @@ -6822,8 +6794,7 @@ dependencies = [ [[package]] name = "wasmtime-winch" -version = "10.0.0" -source = "git+https://github.com/bytecodealliance/wasmtime?branch=release-10.0.0#854fe1ad50968d67e961eed4a573c4dfa8ab7178" +version = "11.0.0" dependencies = [ "anyhow", "cranelift-codegen", @@ -6838,8 +6809,7 @@ dependencies = [ [[package]] name = "wasmtime-wit-bindgen" -version = "10.0.0" -source = "git+https://github.com/bytecodealliance/wasmtime?branch=release-10.0.0#854fe1ad50968d67e961eed4a573c4dfa8ab7178" +version = "11.0.0" dependencies = [ "anyhow", "heck 0.4.1", @@ -6963,8 +6933,7 @@ dependencies = [ [[package]] name = "wiggle" -version = "10.0.0" -source = "git+https://github.com/bytecodealliance/wasmtime?branch=release-10.0.0#854fe1ad50968d67e961eed4a573c4dfa8ab7178" +version = "11.0.0" dependencies = [ "anyhow", "async-trait", @@ -6977,8 +6946,7 @@ dependencies = [ [[package]] name = "wiggle-generate" -version = "10.0.0" -source = "git+https://github.com/bytecodealliance/wasmtime?branch=release-10.0.0#854fe1ad50968d67e961eed4a573c4dfa8ab7178" +version = "11.0.0" dependencies = [ "anyhow", "heck 0.4.1", @@ -6991,8 +6959,7 @@ dependencies = [ [[package]] name = "wiggle-macro" -version = "10.0.0" -source = "git+https://github.com/bytecodealliance/wasmtime?branch=release-10.0.0#854fe1ad50968d67e961eed4a573c4dfa8ab7178" +version = "11.0.0" dependencies = [ "proc-macro2", "quote", @@ -7033,8 +7000,7 @@ checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" [[package]] name = "winch-codegen" -version = "0.8.0" -source = "git+https://github.com/bytecodealliance/wasmtime?branch=release-10.0.0#854fe1ad50968d67e961eed4a573c4dfa8ab7178" +version = "0.9.0" dependencies = [ "anyhow", "cranelift-codegen", @@ -7429,7 +7395,6 @@ dependencies = [ [[package]] name = "witx" version = "0.9.1" -source = "git+https://github.com/bytecodealliance/wasmtime?branch=release-10.0.0#854fe1ad50968d67e961eed4a573c4dfa8ab7178" dependencies = [ "anyhow", "log", diff --git a/Cargo.toml b/Cargo.toml index cc846c1987..d32cffd46a 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -109,9 +109,9 @@ members = [ [workspace.dependencies] tracing = { version = "0.1", features = ["log"] } -wasmtime-wasi = { git = "https://github.com/bytecodealliance/wasmtime", branch = "release-10.0.0", features = ["tokio"] } -wasi-common-preview1 = { package = "wasi-common", git = "https://github.com/bytecodealliance/wasmtime", branch = "release-10.0.0" } -wasmtime = { git = "https://github.com/bytecodealliance/wasmtime", branch = "release-10.0.0", features = ["component-model"] } +wasmtime-wasi = { path = "../spin-componentize/wasmtime/crates/wasi", features = ["tokio"] } +wasi-common-preview1 = {path = "../spin-componentize/wasmtime/crates/wasi-common", package = "wasi-common" } +wasmtime = {path = "../spin-componentize/wasmtime/crates/wasmtime", features = ["component-model"] } # spin-componentize = { git = "https://github.com/fermyon/spin-componentize", rev = "8a596f722556d17cc1dc9b3ae8a7e7a77d3e90ae" } # wasi-host = { package = "host", git = "https://github.com/fermyon/spin-componentize", rev = "8a596f722556d17cc1dc9b3ae8a7e7a77d3e90ae" } # wasi-common = { git = "https://github.com/fermyon/spin-componentize", rev = "8a596f722556d17cc1dc9b3ae8a7e7a77d3e90ae" } diff --git a/crates/core/src/store.rs b/crates/core/src/store.rs index fd32a42281..f6b1706c21 100644 --- a/crates/core/src/store.rs +++ b/crates/core/src/store.rs @@ -182,8 +182,7 @@ impl StoreBuilder { ctx.set_stdout(Box::new(wasmtime_wasi_preview1::stdio::stdout())) } WasiCtxBuilder::Preview2(ctx) => { - *ctx = std::mem::take(ctx) - .set_stdout(wasmtime_wasi_preview1::preview2::stdio::stdout()) + *ctx = std::mem::take(ctx).set_stdout(wasmtime_wasi_preview2::stdio::stdout()) } }); } diff --git a/crates/trigger-http/src/spin.rs b/crates/trigger-http/src/spin.rs index 54d9fb5720..20945cdc57 100644 --- a/crates/trigger-http/src/spin.rs +++ b/crates/trigger-http/src/spin.rs @@ -61,7 +61,7 @@ impl SpinHttpExecutor { let func = instance .exports(&mut store) - .instance("inbound-http") + .instance("wasi:preview/inbound-http") .ok_or_else(|| anyhow!("no inbound-http instance found"))? .typed_func::<(http_types::Request,), (http_types::Response,)>("handle-request")?; From 814575c413f8ac7873e92654097d1084a2dfb336 Mon Sep 17 00:00:00 2001 From: Joel Dice Date: Thu, 15 Jun 2023 10:26:02 +0200 Subject: [PATCH 3/9] Thread resources table through Signed-off-by: Ryan Levick --- crates/core/src/store.rs | 21 ++++++++------------- 1 file changed, 8 insertions(+), 13 deletions(-) diff --git a/crates/core/src/store.rs b/crates/core/src/store.rs index f6b1706c21..bba42beadc 100644 --- a/crates/core/src/store.rs +++ b/crates/core/src/store.rs @@ -356,7 +356,8 @@ impl StoreBuilder { /// /// If `T: Default`, it may be preferable to use [`Store::build`]. pub fn build_with_data(self, inner_data: T) -> Result> { - let wasi = self.wasi.map_err(anyhow::Error::msg)?.try_into()?; + let mut table = Table::new(); + let wasi = self.wasi.map_err(anyhow::Error::msg)?.build(&mut table)?; let mut inner = wasmtime::Store::new( &self.engine, @@ -365,7 +366,7 @@ impl StoreBuilder { wasi, host_components_data: self.host_components_data, store_limits: self.store_limits, - table: Table::new(), + table, }, ); @@ -428,17 +429,11 @@ impl From for WasiCtxBuilder { } } -impl TryFrom for Wasi { - type Error = anyhow::Error; - - fn try_from(value: WasiCtxBuilder) -> std::result::Result { - match value { - WasiCtxBuilder::Preview1(ctx) => Ok(Self::Preview1(ctx)), - WasiCtxBuilder::Preview2(b) => { - // We don't support resources yet so for now we can just use an empty table - let mut table = wasmtime_wasi_preview2::Table::new(); - b.build(&mut table).map(Wasi::Preview2) - } +impl WasiCtxBuilder { + fn build(self, table: &mut Table) -> anyhow::Result { + match self { + WasiCtxBuilder::Preview1(ctx) => Ok(Wasi::Preview1(ctx)), + WasiCtxBuilder::Preview2(b) => b.build(table).map(Wasi::Preview2), } } } From 416f73b91bbe570295434e8a45c87722f2d33e27 Mon Sep 17 00:00:00 2001 From: Ryan Levick Date: Thu, 15 Jun 2023 12:15:20 +0200 Subject: [PATCH 4/9] Move to git dependencies Signed-off-by: Ryan Levick --- Cargo.lock | 104 ++++++++++++++++++++++++------------ Cargo.toml | 14 ++--- crates/templates/Cargo.toml | 1 + 3 files changed, 75 insertions(+), 44 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index a12b2f87ca..f2e33b71f1 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -850,14 +850,16 @@ dependencies = [ [[package]] name = "cranelift-bforest" -version = "0.98.0" +version = "0.97.0" +source = "git+https://github.com/bytecodealliance/wasmtime?branch=release-10.0.0#854fe1ad50968d67e961eed4a573c4dfa8ab7178" dependencies = [ "cranelift-entity", ] [[package]] name = "cranelift-codegen" -version = "0.98.0" +version = "0.97.0" +source = "git+https://github.com/bytecodealliance/wasmtime?branch=release-10.0.0#854fe1ad50968d67e961eed4a573c4dfa8ab7178" dependencies = [ "bumpalo", "cranelift-bforest", @@ -876,32 +878,37 @@ dependencies = [ [[package]] name = "cranelift-codegen-meta" -version = "0.98.0" +version = "0.97.0" +source = "git+https://github.com/bytecodealliance/wasmtime?branch=release-10.0.0#854fe1ad50968d67e961eed4a573c4dfa8ab7178" dependencies = [ "cranelift-codegen-shared", ] [[package]] name = "cranelift-codegen-shared" -version = "0.98.0" +version = "0.97.0" +source = "git+https://github.com/bytecodealliance/wasmtime?branch=release-10.0.0#854fe1ad50968d67e961eed4a573c4dfa8ab7178" [[package]] name = "cranelift-control" -version = "0.98.0" +version = "0.97.0" +source = "git+https://github.com/bytecodealliance/wasmtime?branch=release-10.0.0#854fe1ad50968d67e961eed4a573c4dfa8ab7178" dependencies = [ "arbitrary", ] [[package]] name = "cranelift-entity" -version = "0.98.0" +version = "0.97.0" +source = "git+https://github.com/bytecodealliance/wasmtime?branch=release-10.0.0#854fe1ad50968d67e961eed4a573c4dfa8ab7178" dependencies = [ "serde", ] [[package]] name = "cranelift-frontend" -version = "0.98.0" +version = "0.97.0" +source = "git+https://github.com/bytecodealliance/wasmtime?branch=release-10.0.0#854fe1ad50968d67e961eed4a573c4dfa8ab7178" dependencies = [ "cranelift-codegen", "log", @@ -911,11 +918,13 @@ dependencies = [ [[package]] name = "cranelift-isle" -version = "0.98.0" +version = "0.97.0" +source = "git+https://github.com/bytecodealliance/wasmtime?branch=release-10.0.0#854fe1ad50968d67e961eed4a573c4dfa8ab7178" [[package]] name = "cranelift-native" -version = "0.98.0" +version = "0.97.0" +source = "git+https://github.com/bytecodealliance/wasmtime?branch=release-10.0.0#854fe1ad50968d67e961eed4a573c4dfa8ab7178" dependencies = [ "cranelift-codegen", "libc", @@ -924,7 +933,8 @@ dependencies = [ [[package]] name = "cranelift-wasm" -version = "0.98.0" +version = "0.97.0" +source = "git+https://github.com/bytecodealliance/wasmtime?branch=release-10.0.0#854fe1ad50968d67e961eed4a573c4dfa8ab7178" dependencies = [ "cranelift-codegen", "cranelift-entity", @@ -5086,6 +5096,7 @@ dependencies = [ [[package]] name = "spin-componentize" version = "0.1.0" +source = "git+https://github.com/fermyon/spin-componentize?rev=706962466c685e59e592e77af4a3f4ec106b814d#706962466c685e59e592e77af4a3f4ec106b814d" dependencies = [ "anyhow", "wasm-encoder 0.29.0", @@ -6339,7 +6350,8 @@ checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" [[package]] name = "wasi-cap-std-sync" -version = "11.0.0" +version = "10.0.0" +source = "git+https://github.com/bytecodealliance/wasmtime?branch=release-10.0.0#854fe1ad50968d67e961eed4a573c4dfa8ab7178" dependencies = [ "anyhow", "async-trait", @@ -6361,7 +6373,8 @@ dependencies = [ [[package]] name = "wasi-common" -version = "11.0.0" +version = "10.0.0" +source = "git+https://github.com/bytecodealliance/wasmtime?branch=release-10.0.0#854fe1ad50968d67e961eed4a573c4dfa8ab7178" dependencies = [ "anyhow", "bitflags 1.3.2", @@ -6379,7 +6392,8 @@ dependencies = [ [[package]] name = "wasi-tokio" -version = "11.0.0" +version = "10.0.0" +source = "git+https://github.com/bytecodealliance/wasmtime?branch=release-10.0.0#854fe1ad50968d67e961eed4a573c4dfa8ab7178" dependencies = [ "anyhow", "cap-std", @@ -6547,7 +6561,8 @@ dependencies = [ [[package]] name = "wasmtime" -version = "11.0.0" +version = "10.0.0" +source = "git+https://github.com/bytecodealliance/wasmtime?branch=release-10.0.0#854fe1ad50968d67e961eed4a573c4dfa8ab7178" dependencies = [ "anyhow", "async-trait", @@ -6583,14 +6598,16 @@ dependencies = [ [[package]] name = "wasmtime-asm-macros" -version = "11.0.0" +version = "10.0.0" +source = "git+https://github.com/bytecodealliance/wasmtime?branch=release-10.0.0#854fe1ad50968d67e961eed4a573c4dfa8ab7178" dependencies = [ "cfg-if", ] [[package]] name = "wasmtime-cache" -version = "11.0.0" +version = "10.0.0" +source = "git+https://github.com/bytecodealliance/wasmtime?branch=release-10.0.0#854fe1ad50968d67e961eed4a573c4dfa8ab7178" dependencies = [ "anyhow", "base64 0.21.0", @@ -6608,7 +6625,8 @@ dependencies = [ [[package]] name = "wasmtime-component-macro" -version = "11.0.0" +version = "10.0.0" +source = "git+https://github.com/bytecodealliance/wasmtime?branch=release-10.0.0#854fe1ad50968d67e961eed4a573c4dfa8ab7178" dependencies = [ "anyhow", "proc-macro2", @@ -6621,11 +6639,13 @@ dependencies = [ [[package]] name = "wasmtime-component-util" -version = "11.0.0" +version = "10.0.0" +source = "git+https://github.com/bytecodealliance/wasmtime?branch=release-10.0.0#854fe1ad50968d67e961eed4a573c4dfa8ab7178" [[package]] name = "wasmtime-cranelift" -version = "11.0.0" +version = "10.0.0" +source = "git+https://github.com/bytecodealliance/wasmtime?branch=release-10.0.0#854fe1ad50968d67e961eed4a573c4dfa8ab7178" dependencies = [ "anyhow", "cranelift-codegen", @@ -6646,7 +6666,8 @@ dependencies = [ [[package]] name = "wasmtime-cranelift-shared" -version = "11.0.0" +version = "10.0.0" +source = "git+https://github.com/bytecodealliance/wasmtime?branch=release-10.0.0#854fe1ad50968d67e961eed4a573c4dfa8ab7178" dependencies = [ "anyhow", "cranelift-codegen", @@ -6660,7 +6681,8 @@ dependencies = [ [[package]] name = "wasmtime-environ" -version = "11.0.0" +version = "10.0.0" +source = "git+https://github.com/bytecodealliance/wasmtime?branch=release-10.0.0#854fe1ad50968d67e961eed4a573c4dfa8ab7178" dependencies = [ "anyhow", "cranelift-entity", @@ -6680,7 +6702,8 @@ dependencies = [ [[package]] name = "wasmtime-fiber" -version = "11.0.0" +version = "10.0.0" +source = "git+https://github.com/bytecodealliance/wasmtime?branch=release-10.0.0#854fe1ad50968d67e961eed4a573c4dfa8ab7178" dependencies = [ "cc", "cfg-if", @@ -6691,7 +6714,8 @@ dependencies = [ [[package]] name = "wasmtime-jit" -version = "11.0.0" +version = "10.0.0" +source = "git+https://github.com/bytecodealliance/wasmtime?branch=release-10.0.0#854fe1ad50968d67e961eed4a573c4dfa8ab7178" dependencies = [ "addr2line", "anyhow", @@ -6715,7 +6739,8 @@ dependencies = [ [[package]] name = "wasmtime-jit-debug" -version = "11.0.0" +version = "10.0.0" +source = "git+https://github.com/bytecodealliance/wasmtime?branch=release-10.0.0#854fe1ad50968d67e961eed4a573c4dfa8ab7178" dependencies = [ "object", "once_cell", @@ -6724,7 +6749,8 @@ dependencies = [ [[package]] name = "wasmtime-jit-icache-coherence" -version = "11.0.0" +version = "10.0.0" +source = "git+https://github.com/bytecodealliance/wasmtime?branch=release-10.0.0#854fe1ad50968d67e961eed4a573c4dfa8ab7178" dependencies = [ "cfg-if", "libc", @@ -6733,7 +6759,8 @@ dependencies = [ [[package]] name = "wasmtime-runtime" -version = "11.0.0" +version = "10.0.0" +source = "git+https://github.com/bytecodealliance/wasmtime?branch=release-10.0.0#854fe1ad50968d67e961eed4a573c4dfa8ab7178" dependencies = [ "anyhow", "cc", @@ -6758,7 +6785,8 @@ dependencies = [ [[package]] name = "wasmtime-types" -version = "11.0.0" +version = "10.0.0" +source = "git+https://github.com/bytecodealliance/wasmtime?branch=release-10.0.0#854fe1ad50968d67e961eed4a573c4dfa8ab7178" dependencies = [ "cranelift-entity", "serde", @@ -6768,7 +6796,8 @@ dependencies = [ [[package]] name = "wasmtime-wasi" -version = "11.0.0" +version = "10.0.0" +source = "git+https://github.com/bytecodealliance/wasmtime?branch=release-10.0.0#854fe1ad50968d67e961eed4a573c4dfa8ab7178" dependencies = [ "anyhow", "async-trait", @@ -6794,7 +6823,8 @@ dependencies = [ [[package]] name = "wasmtime-winch" -version = "11.0.0" +version = "10.0.0" +source = "git+https://github.com/bytecodealliance/wasmtime?branch=release-10.0.0#854fe1ad50968d67e961eed4a573c4dfa8ab7178" dependencies = [ "anyhow", "cranelift-codegen", @@ -6809,7 +6839,8 @@ dependencies = [ [[package]] name = "wasmtime-wit-bindgen" -version = "11.0.0" +version = "10.0.0" +source = "git+https://github.com/bytecodealliance/wasmtime?branch=release-10.0.0#854fe1ad50968d67e961eed4a573c4dfa8ab7178" dependencies = [ "anyhow", "heck 0.4.1", @@ -6933,7 +6964,8 @@ dependencies = [ [[package]] name = "wiggle" -version = "11.0.0" +version = "10.0.0" +source = "git+https://github.com/bytecodealliance/wasmtime?branch=release-10.0.0#854fe1ad50968d67e961eed4a573c4dfa8ab7178" dependencies = [ "anyhow", "async-trait", @@ -6946,7 +6978,8 @@ dependencies = [ [[package]] name = "wiggle-generate" -version = "11.0.0" +version = "10.0.0" +source = "git+https://github.com/bytecodealliance/wasmtime?branch=release-10.0.0#854fe1ad50968d67e961eed4a573c4dfa8ab7178" dependencies = [ "anyhow", "heck 0.4.1", @@ -6959,7 +6992,8 @@ dependencies = [ [[package]] name = "wiggle-macro" -version = "11.0.0" +version = "10.0.0" +source = "git+https://github.com/bytecodealliance/wasmtime?branch=release-10.0.0#854fe1ad50968d67e961eed4a573c4dfa8ab7178" dependencies = [ "proc-macro2", "quote", @@ -7000,7 +7034,8 @@ checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" [[package]] name = "winch-codegen" -version = "0.9.0" +version = "0.8.0" +source = "git+https://github.com/bytecodealliance/wasmtime?branch=release-10.0.0#854fe1ad50968d67e961eed4a573c4dfa8ab7178" dependencies = [ "anyhow", "cranelift-codegen", @@ -7395,6 +7430,7 @@ dependencies = [ [[package]] name = "witx" version = "0.9.1" +source = "git+https://github.com/bytecodealliance/wasmtime?branch=release-10.0.0#854fe1ad50968d67e961eed4a573c4dfa8ab7178" dependencies = [ "anyhow", "log", diff --git a/Cargo.toml b/Cargo.toml index d32cffd46a..51cdd312ac 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -109,16 +109,10 @@ members = [ [workspace.dependencies] tracing = { version = "0.1", features = ["log"] } -wasmtime-wasi = { path = "../spin-componentize/wasmtime/crates/wasi", features = ["tokio"] } -wasi-common-preview1 = {path = "../spin-componentize/wasmtime/crates/wasi-common", package = "wasi-common" } -wasmtime = {path = "../spin-componentize/wasmtime/crates/wasmtime", features = ["component-model"] } -# spin-componentize = { git = "https://github.com/fermyon/spin-componentize", rev = "8a596f722556d17cc1dc9b3ae8a7e7a77d3e90ae" } -# wasi-host = { package = "host", git = "https://github.com/fermyon/spin-componentize", rev = "8a596f722556d17cc1dc9b3ae8a7e7a77d3e90ae" } -# wasi-common = { git = "https://github.com/fermyon/spin-componentize", rev = "8a596f722556d17cc1dc9b3ae8a7e7a77d3e90ae" } -# wasi-cap-std-sync = { git = "https://github.com/fermyon/spin-componentize", rev = "8a596f722556d17cc1dc9b3ae8a7e7a77d3e90ae" } -spin-componentize = { path = "../spin-componentize" } -wasi-common = { path = "../spin-componentize/adapter/wasi-common" } -wasi-cap-std-sync = { path = "../spin-componentize/adapter/wasi-common/cap-std-sync" } +wasmtime-wasi = { git = "https://github.com/bytecodealliance/wasmtime", branch = "release-10.0.0", features = ["tokio"] } +wasi-common-preview1 = { package = "wasi-common", git = "https://github.com/bytecodealliance/wasmtime", branch = "release-10.0.0" } +wasmtime = { git = "https://github.com/bytecodealliance/wasmtime", branch = "release-10.0.0", features = ["component-model"] } +spin-componentize = { git = "https://github.com/fermyon/spin-componentize", rev = "706962466c685e59e592e77af4a3f4ec106b814d" } [workspace.dependencies.bindle] git = "https://github.com/fermyon/bindle" diff --git a/crates/templates/Cargo.toml b/crates/templates/Cargo.toml index 7bd74c0965..8a78f9430b 100644 --- a/crates/templates/Cargo.toml +++ b/crates/templates/Cargo.toml @@ -37,5 +37,6 @@ wasmtime-wasi = { workspace = true } [dependencies.wit-bindgen-wasmtime] git = "https://github.com/fermyon/wit-bindgen-backport" +# TODO: update to merge commit when merged rev = "d91e1c50be5c94a0737a39743a5467ee880b84c4" features = ["async"] From fdc1499cf22bedbbac6cbc9cd5a301555f6aaa87 Mon Sep 17 00:00:00 2001 From: Ryan Levick Date: Thu, 15 Jun 2023 17:24:31 +0200 Subject: [PATCH 5/9] Update spin-componentize Signed-off-by: Ryan Levick --- Cargo.lock | 2 +- Cargo.toml | 2 +- crates/core/src/store.rs | 1 + crates/redis/src/spin.rs | 2 +- crates/trigger-http/src/spin.rs | 2 +- 5 files changed, 5 insertions(+), 4 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index f2e33b71f1..d52dab6d7f 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -5096,7 +5096,7 @@ dependencies = [ [[package]] name = "spin-componentize" version = "0.1.0" -source = "git+https://github.com/fermyon/spin-componentize?rev=706962466c685e59e592e77af4a3f4ec106b814d#706962466c685e59e592e77af4a3f4ec106b814d" +source = "git+https://github.com/fermyon/spin-componentize?rev=94b7f8a5dc02a263b55be7e5076b9b47a0229bbe#94b7f8a5dc02a263b55be7e5076b9b47a0229bbe" dependencies = [ "anyhow", "wasm-encoder 0.29.0", diff --git a/Cargo.toml b/Cargo.toml index 51cdd312ac..ca6ad25d9c 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -112,7 +112,7 @@ tracing = { version = "0.1", features = ["log"] } wasmtime-wasi = { git = "https://github.com/bytecodealliance/wasmtime", branch = "release-10.0.0", features = ["tokio"] } wasi-common-preview1 = { package = "wasi-common", git = "https://github.com/bytecodealliance/wasmtime", branch = "release-10.0.0" } wasmtime = { git = "https://github.com/bytecodealliance/wasmtime", branch = "release-10.0.0", features = ["component-model"] } -spin-componentize = { git = "https://github.com/fermyon/spin-componentize", rev = "706962466c685e59e592e77af4a3f4ec106b814d" } +spin-componentize = { git = "https://github.com/fermyon/spin-componentize", rev = "3d9937bb7d107bd0684d29d4f4c53f9607f9ad44" } [workspace.dependencies.bindle] git = "https://github.com/fermyon/bindle" diff --git a/crates/core/src/store.rs b/crates/core/src/store.rs index bba42beadc..d64cb37fac 100644 --- a/crates/core/src/store.rs +++ b/crates/core/src/store.rs @@ -413,6 +413,7 @@ impl StoreBuilder { } /// A builder of a `WasiCtx` for all versions of Wasi +#[allow(clippy::large_enum_variant)] enum WasiCtxBuilder { Preview1(wasi_preview1::WasiCtx), Preview2(wasi_preview2::WasiCtxBuilder), diff --git a/crates/redis/src/spin.rs b/crates/redis/src/spin.rs index 8e8db82575..5d0bb8ddc7 100644 --- a/crates/redis/src/spin.rs +++ b/crates/redis/src/spin.rs @@ -47,7 +47,7 @@ impl SpinRedisExecutor { ) -> Result<()> { let func = instance .exports(&mut store) - .instance("inbound-redis") + .instance("fermyon:spin/inbound-redis") .ok_or_else(|| anyhow!("no inbound-redis instance found"))? .typed_func::<(Payload,), (Result<(), Error>,)>("handle-message")?; diff --git a/crates/trigger-http/src/spin.rs b/crates/trigger-http/src/spin.rs index 20945cdc57..4fa2e20922 100644 --- a/crates/trigger-http/src/spin.rs +++ b/crates/trigger-http/src/spin.rs @@ -61,7 +61,7 @@ impl SpinHttpExecutor { let func = instance .exports(&mut store) - .instance("wasi:preview/inbound-http") + .instance("fermyon:spin/inbound-http") .ok_or_else(|| anyhow!("no inbound-http instance found"))? .typed_func::<(http_types::Request,), (http_types::Response,)>("handle-request")?; From 2cd503fe7d1c31e3401e78f20466047b100dcd4f Mon Sep 17 00:00:00 2001 From: Ryan Levick Date: Mon, 19 Jun 2023 11:13:47 +0200 Subject: [PATCH 6/9] Fix broken expected trap tests Signed-off-by: Ryan Levick --- Cargo.lock | 2 +- crates/core/src/lib.rs | 11 ++++++----- crates/core/tests/integration_test.rs | 12 +++++++++--- 3 files changed, 16 insertions(+), 9 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index d52dab6d7f..58688791e8 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -5096,7 +5096,7 @@ dependencies = [ [[package]] name = "spin-componentize" version = "0.1.0" -source = "git+https://github.com/fermyon/spin-componentize?rev=94b7f8a5dc02a263b55be7e5076b9b47a0229bbe#94b7f8a5dc02a263b55be7e5076b9b47a0229bbe" +source = "git+https://github.com/fermyon/spin-componentize?rev=3d9937bb7d107bd0684d29d4f4c53f9607f9ad44#3d9937bb7d107bd0684d29d4f4c53f9607f9ad44" dependencies = [ "anyhow", "wasm-encoder 0.29.0", diff --git a/crates/core/src/lib.rs b/crates/core/src/lib.rs index 6f50c894df..210eec4888 100644 --- a/crates/core/src/lib.rs +++ b/crates/core/src/lib.rs @@ -16,18 +16,19 @@ mod store; use std::{sync::Arc, time::Duration}; use anyhow::Result; -pub use async_trait::async_trait; use crossbeam_channel::Sender; use tracing::instrument; +use wasmtime_wasi::preview2::Table; + +use self::host_component::{HostComponents, HostComponentsBuilder}; + +pub use async_trait::async_trait; pub use wasmtime::{ self, component::{Component, Instance}, Instance as ModuleInstance, Module, Trap, }; -use wasmtime_wasi::preview2::Table; -pub use wasmtime_wasi::I32Exit; - -use self::host_component::{HostComponents, HostComponentsBuilder}; +pub use wasmtime_wasi::preview2::I32Exit; pub use host_component::{ AnyHostComponentDataHandle, HostComponent, HostComponentDataHandle, HostComponentsData, diff --git a/crates/core/tests/integration_test.rs b/crates/core/tests/integration_test.rs index c781f120f7..eae33ef43b 100644 --- a/crates/core/tests/integration_test.rs +++ b/crates/core/tests/integration_test.rs @@ -49,7 +49,10 @@ async fn test_read_only_preopened_dir_write_fails() { }) .await .unwrap_err(); - let trap = err.downcast::().expect("trap"); + let trap = err + .root_cause() // The error returned is a backtrace. We need the root cause. + .downcast_ref::() + .expect("trap error was not an I32Exit"); assert_eq!(trap.0, 1); } @@ -90,7 +93,10 @@ async fn test_max_memory_size_violated() { }) .await .unwrap_err(); - let trap = err.downcast::().expect("trap"); + let trap = err + .root_cause() // The error returned is a backtrace. We need the root cause. + .downcast_ref::() + .expect("trap error was not an I32Exit"); assert_eq!(trap.0, 1); } @@ -201,7 +207,7 @@ async fn run_core_wasi_test_engine<'a>( let component = Component::new(engine.as_ref(), &component)?; let instance_pre = engine.instantiate_pre(&component)?; let instance = instance_pre.instantiate_async(&mut store).await?; - let func = instance.get_typed_func::<(), (Result<(), ()>,)>(&mut store, "main")?; + let func = instance.get_typed_func::<(), (Result<(), ()>,)>(&mut store, "run")?; update_store(&mut store); From 19b1455e9d357c8306336477b3d31f449575e720 Mon Sep 17 00:00:00 2001 From: Ryan Levick Date: Tue, 20 Jun 2023 18:05:56 +0200 Subject: [PATCH 7/9] Move to release versions of wasmtime 10 Signed-off-by: Ryan Levick --- Cargo.lock | 139 ++++++++++++++++++++++-------------- Cargo.toml | 8 +-- crates/templates/Cargo.toml | 2 +- 3 files changed, 92 insertions(+), 57 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 58688791e8..cc9a7c4678 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -851,7 +851,8 @@ dependencies = [ [[package]] name = "cranelift-bforest" version = "0.97.0" -source = "git+https://github.com/bytecodealliance/wasmtime?branch=release-10.0.0#854fe1ad50968d67e961eed4a573c4dfa8ab7178" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e5dbee3d5a789503694c0e850f72fed0a1ee38afffe948865381a9163a1dae5c" dependencies = [ "cranelift-entity", ] @@ -859,7 +860,8 @@ dependencies = [ [[package]] name = "cranelift-codegen" version = "0.97.0" -source = "git+https://github.com/bytecodealliance/wasmtime?branch=release-10.0.0#854fe1ad50968d67e961eed4a573c4dfa8ab7178" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "12aa555c34996adf66fef25db7310ae3ca6398dc58c57e8ba02a5cd68dbd445b" dependencies = [ "bumpalo", "cranelift-bforest", @@ -879,7 +881,8 @@ dependencies = [ [[package]] name = "cranelift-codegen-meta" version = "0.97.0" -source = "git+https://github.com/bytecodealliance/wasmtime?branch=release-10.0.0#854fe1ad50968d67e961eed4a573c4dfa8ab7178" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "071f869d92ad97e1f8ed4fe61f645bc9b75044d53ea614664295b6ca3a0443ec" dependencies = [ "cranelift-codegen-shared", ] @@ -887,12 +890,14 @@ dependencies = [ [[package]] name = "cranelift-codegen-shared" version = "0.97.0" -source = "git+https://github.com/bytecodealliance/wasmtime?branch=release-10.0.0#854fe1ad50968d67e961eed4a573c4dfa8ab7178" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9afba6234a61fc7202e044bf784986e214b9150d609f539fe2b045af13038e0b" [[package]] name = "cranelift-control" version = "0.97.0" -source = "git+https://github.com/bytecodealliance/wasmtime?branch=release-10.0.0#854fe1ad50968d67e961eed4a573c4dfa8ab7178" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1123c8dce2e2abd6e8c524b2afb047964ffa84cbc55d4b032315c8783b53ec1d" dependencies = [ "arbitrary", ] @@ -900,7 +905,8 @@ dependencies = [ [[package]] name = "cranelift-entity" version = "0.97.0" -source = "git+https://github.com/bytecodealliance/wasmtime?branch=release-10.0.0#854fe1ad50968d67e961eed4a573c4dfa8ab7178" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0a89f494b76990da8a2101c8f6cadad97b043833ff7a22c3ada18d295a0fcf49" dependencies = [ "serde", ] @@ -908,7 +914,8 @@ dependencies = [ [[package]] name = "cranelift-frontend" version = "0.97.0" -source = "git+https://github.com/bytecodealliance/wasmtime?branch=release-10.0.0#854fe1ad50968d67e961eed4a573c4dfa8ab7178" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0c2c38bcc7b9764edf206102df7a2f95a389776fbb5a2c6b398da5b58e6b72ee" dependencies = [ "cranelift-codegen", "log", @@ -919,12 +926,14 @@ dependencies = [ [[package]] name = "cranelift-isle" version = "0.97.0" -source = "git+https://github.com/bytecodealliance/wasmtime?branch=release-10.0.0#854fe1ad50968d67e961eed4a573c4dfa8ab7178" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b50429229ca95b6c716f848dc4374b04cf0bfaf39eceecd832b3ed0edab7931b" [[package]] name = "cranelift-native" version = "0.97.0" -source = "git+https://github.com/bytecodealliance/wasmtime?branch=release-10.0.0#854fe1ad50968d67e961eed4a573c4dfa8ab7178" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "024d062d42630b19fb187bb7ea8a6e6f84220494bcd5537f9adfde48893b7d40" dependencies = [ "cranelift-codegen", "libc", @@ -934,7 +943,8 @@ dependencies = [ [[package]] name = "cranelift-wasm" version = "0.97.0" -source = "git+https://github.com/bytecodealliance/wasmtime?branch=release-10.0.0#854fe1ad50968d67e961eed4a573c4dfa8ab7178" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "080b611b7a1578bad711ca417ff26c55b742da309e37919cfca5e1c415da6864" dependencies = [ "cranelift-codegen", "cranelift-entity", @@ -5096,7 +5106,7 @@ dependencies = [ [[package]] name = "spin-componentize" version = "0.1.0" -source = "git+https://github.com/fermyon/spin-componentize?rev=3d9937bb7d107bd0684d29d4f4c53f9607f9ad44#3d9937bb7d107bd0684d29d4f4c53f9607f9ad44" +source = "git+https://github.com/fermyon/spin-componentize?rev=545afb39ca5f9ead37cbe56bcb5bf7f4678fe209#545afb39ca5f9ead37cbe56bcb5bf7f4678fe209" dependencies = [ "anyhow", "wasm-encoder 0.29.0", @@ -6351,7 +6361,8 @@ checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" [[package]] name = "wasi-cap-std-sync" version = "10.0.0" -source = "git+https://github.com/bytecodealliance/wasmtime?branch=release-10.0.0#854fe1ad50968d67e961eed4a573c4dfa8ab7178" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d36ac062e4596c6d08cfb1551e4b9e1841e647aa0b3e07bd260c8669e9c64a17" dependencies = [ "anyhow", "async-trait", @@ -6374,7 +6385,8 @@ dependencies = [ [[package]] name = "wasi-common" version = "10.0.0" -source = "git+https://github.com/bytecodealliance/wasmtime?branch=release-10.0.0#854fe1ad50968d67e961eed4a573c4dfa8ab7178" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7a24fe619974e7b17b3ecf8bb3c4c5b19126528ff41a28bf33934474a1567269" dependencies = [ "anyhow", "bitflags 1.3.2", @@ -6393,7 +6405,8 @@ dependencies = [ [[package]] name = "wasi-tokio" version = "10.0.0" -source = "git+https://github.com/bytecodealliance/wasmtime?branch=release-10.0.0#854fe1ad50968d67e961eed4a573c4dfa8ab7178" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4405af132cf6581235f5941865b4067e0e908d468e71c42dcce21ae1a7c6f5ee" dependencies = [ "anyhow", "cap-std", @@ -6562,7 +6575,8 @@ dependencies = [ [[package]] name = "wasmtime" version = "10.0.0" -source = "git+https://github.com/bytecodealliance/wasmtime?branch=release-10.0.0#854fe1ad50968d67e961eed4a573c4dfa8ab7178" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9bade460fa8739cd1ae051cf0b6268eeb23ed27ea5eec6f4ab369742cd1504da" dependencies = [ "anyhow", "async-trait", @@ -6599,7 +6613,8 @@ dependencies = [ [[package]] name = "wasmtime-asm-macros" version = "10.0.0" -source = "git+https://github.com/bytecodealliance/wasmtime?branch=release-10.0.0#854fe1ad50968d67e961eed4a573c4dfa8ab7178" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f899f1a46389189c3fa9838ca45ea6c3b77df50b48eeda4c1c3aca33f40872e3" dependencies = [ "cfg-if", ] @@ -6607,7 +6622,8 @@ dependencies = [ [[package]] name = "wasmtime-cache" version = "10.0.0" -source = "git+https://github.com/bytecodealliance/wasmtime?branch=release-10.0.0#854fe1ad50968d67e961eed4a573c4dfa8ab7178" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c5f87db2b83e4620d93a209c185c6fad49cff940247e9714383033cd23471b88" dependencies = [ "anyhow", "base64 0.21.0", @@ -6626,7 +6642,8 @@ dependencies = [ [[package]] name = "wasmtime-component-macro" version = "10.0.0" -source = "git+https://github.com/bytecodealliance/wasmtime?branch=release-10.0.0#854fe1ad50968d67e961eed4a573c4dfa8ab7178" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "067bcd4bdc41887a7fffeb7b2c973e4b20cb956969861a09ca7e0dd58e2473bd" dependencies = [ "anyhow", "proc-macro2", @@ -6640,12 +6657,14 @@ dependencies = [ [[package]] name = "wasmtime-component-util" version = "10.0.0" -source = "git+https://github.com/bytecodealliance/wasmtime?branch=release-10.0.0#854fe1ad50968d67e961eed4a573c4dfa8ab7178" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "32c0805f77c9178070a67b203c7c9a69673e991a82ca63e02b5890aecb135286" [[package]] name = "wasmtime-cranelift" version = "10.0.0" -source = "git+https://github.com/bytecodealliance/wasmtime?branch=release-10.0.0#854fe1ad50968d67e961eed4a573c4dfa8ab7178" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "11a553c6d6d41eee928fc6f2a9eb4104fa8af074a16536b6da0310568e2174a3" dependencies = [ "anyhow", "cranelift-codegen", @@ -6667,7 +6686,8 @@ dependencies = [ [[package]] name = "wasmtime-cranelift-shared" version = "10.0.0" -source = "git+https://github.com/bytecodealliance/wasmtime?branch=release-10.0.0#854fe1ad50968d67e961eed4a573c4dfa8ab7178" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5497c31cc06dcca342337d141d9e5511bc6e21bd4f05f539c08fa36812c7b7fa" dependencies = [ "anyhow", "cranelift-codegen", @@ -6682,7 +6702,8 @@ dependencies = [ [[package]] name = "wasmtime-environ" version = "10.0.0" -source = "git+https://github.com/bytecodealliance/wasmtime?branch=release-10.0.0#854fe1ad50968d67e961eed4a573c4dfa8ab7178" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "306dc41f40c03e6b709a4b31aadd12903a0ce77d4365369d171739cc377dc036" dependencies = [ "anyhow", "cranelift-entity", @@ -6703,7 +6724,8 @@ dependencies = [ [[package]] name = "wasmtime-fiber" version = "10.0.0" -source = "git+https://github.com/bytecodealliance/wasmtime?branch=release-10.0.0#854fe1ad50968d67e961eed4a573c4dfa8ab7178" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "01caff74520c214bef2047d34cf5d5c65c3483e5170e5139cbc7ff29e8213d75" dependencies = [ "cc", "cfg-if", @@ -6715,7 +6737,8 @@ dependencies = [ [[package]] name = "wasmtime-jit" version = "10.0.0" -source = "git+https://github.com/bytecodealliance/wasmtime?branch=release-10.0.0#854fe1ad50968d67e961eed4a573c4dfa8ab7178" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9b5de1a7d77f073204c6071009c6b2ef6f674e38a832f6c8bc7f56e77e4a3bf3" dependencies = [ "addr2line", "anyhow", @@ -6740,7 +6763,8 @@ dependencies = [ [[package]] name = "wasmtime-jit-debug" version = "10.0.0" -source = "git+https://github.com/bytecodealliance/wasmtime?branch=release-10.0.0#854fe1ad50968d67e961eed4a573c4dfa8ab7178" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a98a08580b1435e3758af9797e0576befe2a3e2019532ea86c94a5b563a2279b" dependencies = [ "object", "once_cell", @@ -6750,7 +6774,8 @@ dependencies = [ [[package]] name = "wasmtime-jit-icache-coherence" version = "10.0.0" -source = "git+https://github.com/bytecodealliance/wasmtime?branch=release-10.0.0#854fe1ad50968d67e961eed4a573c4dfa8ab7178" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "41ce2d1403b99a4f9d6277fc54a7234ab7bf5205d58b4f540625aaf306e95581" dependencies = [ "cfg-if", "libc", @@ -6760,7 +6785,8 @@ dependencies = [ [[package]] name = "wasmtime-runtime" version = "10.0.0" -source = "git+https://github.com/bytecodealliance/wasmtime?branch=release-10.0.0#854fe1ad50968d67e961eed4a573c4dfa8ab7178" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f4295ade57c7ea2ae2ffed4a254c14cdcf2ed9e9b00b30ad61aeb285697164d1" dependencies = [ "anyhow", "cc", @@ -6786,7 +6812,8 @@ dependencies = [ [[package]] name = "wasmtime-types" version = "10.0.0" -source = "git+https://github.com/bytecodealliance/wasmtime?branch=release-10.0.0#854fe1ad50968d67e961eed4a573c4dfa8ab7178" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1848a854370f825e6846d284cf08e048a4be1806922bf1aa1f4dd1951e3bea82" dependencies = [ "cranelift-entity", "serde", @@ -6797,7 +6824,8 @@ dependencies = [ [[package]] name = "wasmtime-wasi" version = "10.0.0" -source = "git+https://github.com/bytecodealliance/wasmtime?branch=release-10.0.0#854fe1ad50968d67e961eed4a573c4dfa8ab7178" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5550eeb812b65ab91fcb5f90f16698f2f6c7682f4728a316986b5d48b71d3f62" dependencies = [ "anyhow", "async-trait", @@ -6824,7 +6852,8 @@ dependencies = [ [[package]] name = "wasmtime-winch" version = "10.0.0" -source = "git+https://github.com/bytecodealliance/wasmtime?branch=release-10.0.0#854fe1ad50968d67e961eed4a573c4dfa8ab7178" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c1b6f75bb946f211cd2f1dc3fa81674c84b8000bfcd95770354952699a6ee91" dependencies = [ "anyhow", "cranelift-codegen", @@ -6840,7 +6869,8 @@ dependencies = [ [[package]] name = "wasmtime-wit-bindgen" version = "10.0.0" -source = "git+https://github.com/bytecodealliance/wasmtime?branch=release-10.0.0#854fe1ad50968d67e961eed4a573c4dfa8ab7178" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d425bdb4c50c912089c114ca2aae888f454985f3816595ac2c20c4d8a8b2402e" dependencies = [ "anyhow", "heck 0.4.1", @@ -6965,7 +6995,8 @@ dependencies = [ [[package]] name = "wiggle" version = "10.0.0" -source = "git+https://github.com/bytecodealliance/wasmtime?branch=release-10.0.0#854fe1ad50968d67e961eed4a573c4dfa8ab7178" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9765ec9983813e35ff4ed0ac7eeb565504bff06593e2c600576e8c6e5de597b3" dependencies = [ "anyhow", "async-trait", @@ -6979,7 +7010,8 @@ dependencies = [ [[package]] name = "wiggle-generate" version = "10.0.0" -source = "git+https://github.com/bytecodealliance/wasmtime?branch=release-10.0.0#854fe1ad50968d67e961eed4a573c4dfa8ab7178" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9f774e46d00b0bcf0bf8531e162c3f19706d425f630cc070ebd4d25a07127d2c" dependencies = [ "anyhow", "heck 0.4.1", @@ -6993,7 +7025,8 @@ dependencies = [ [[package]] name = "wiggle-macro" version = "10.0.0" -source = "git+https://github.com/bytecodealliance/wasmtime?branch=release-10.0.0#854fe1ad50968d67e961eed4a573c4dfa8ab7178" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6c00a7ac880c0efe015d43d314cb80fab4b5866b353e6320e3a1d2f1fdbf9295" dependencies = [ "proc-macro2", "quote", @@ -7035,7 +7068,8 @@ checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" [[package]] name = "winch-codegen" version = "0.8.0" -source = "git+https://github.com/bytecodealliance/wasmtime?branch=release-10.0.0#854fe1ad50968d67e961eed4a573c4dfa8ab7178" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f8e17f9b4b2117957b88c9e72789e14372f66221664fac7a2ac3c4cba1ce9c0" dependencies = [ "anyhow", "cranelift-codegen", @@ -7241,37 +7275,37 @@ dependencies = [ [[package]] name = "wit-bindgen-gen-core" version = "0.2.0" -source = "git+https://github.com/bytecodealliance/wit-bindgen?rev=cb871cfa1ee460b51eb1d144b175b9aab9c50aba#cb871cfa1ee460b51eb1d144b175b9aab9c50aba" +source = "git+https://github.com/fermyon/wit-bindgen-backport?rev=b46f69ef2150d65d8a223d49d106457efdb7cdb3#b46f69ef2150d65d8a223d49d106457efdb7cdb3" dependencies = [ "anyhow", - "wit-parser 0.2.0 (git+https://github.com/bytecodealliance/wit-bindgen?rev=cb871cfa1ee460b51eb1d144b175b9aab9c50aba)", + "wit-parser 0.2.0 (git+https://github.com/fermyon/wit-bindgen-backport?rev=b46f69ef2150d65d8a223d49d106457efdb7cdb3)", ] [[package]] name = "wit-bindgen-gen-core" version = "0.2.0" -source = "git+https://github.com/fermyon/wit-bindgen-backport?rev=d91e1c50be5c94a0737a39743a5467ee880b84c4#d91e1c50be5c94a0737a39743a5467ee880b84c4" +source = "git+https://github.com/bytecodealliance/wit-bindgen?rev=cb871cfa1ee460b51eb1d144b175b9aab9c50aba#cb871cfa1ee460b51eb1d144b175b9aab9c50aba" dependencies = [ "anyhow", - "wit-parser 0.2.0 (git+https://github.com/fermyon/wit-bindgen-backport?rev=d91e1c50be5c94a0737a39743a5467ee880b84c4)", + "wit-parser 0.2.0 (git+https://github.com/bytecodealliance/wit-bindgen?rev=cb871cfa1ee460b51eb1d144b175b9aab9c50aba)", ] [[package]] name = "wit-bindgen-gen-rust" version = "0.2.0" -source = "git+https://github.com/bytecodealliance/wit-bindgen?rev=cb871cfa1ee460b51eb1d144b175b9aab9c50aba#cb871cfa1ee460b51eb1d144b175b9aab9c50aba" +source = "git+https://github.com/fermyon/wit-bindgen-backport?rev=b46f69ef2150d65d8a223d49d106457efdb7cdb3#b46f69ef2150d65d8a223d49d106457efdb7cdb3" dependencies = [ "heck 0.3.3", - "wit-bindgen-gen-core 0.2.0 (git+https://github.com/bytecodealliance/wit-bindgen?rev=cb871cfa1ee460b51eb1d144b175b9aab9c50aba)", + "wit-bindgen-gen-core 0.2.0 (git+https://github.com/fermyon/wit-bindgen-backport?rev=b46f69ef2150d65d8a223d49d106457efdb7cdb3)", ] [[package]] name = "wit-bindgen-gen-rust" version = "0.2.0" -source = "git+https://github.com/fermyon/wit-bindgen-backport?rev=d91e1c50be5c94a0737a39743a5467ee880b84c4#d91e1c50be5c94a0737a39743a5467ee880b84c4" +source = "git+https://github.com/bytecodealliance/wit-bindgen?rev=cb871cfa1ee460b51eb1d144b175b9aab9c50aba#cb871cfa1ee460b51eb1d144b175b9aab9c50aba" dependencies = [ "heck 0.3.3", - "wit-bindgen-gen-core 0.2.0 (git+https://github.com/fermyon/wit-bindgen-backport?rev=d91e1c50be5c94a0737a39743a5467ee880b84c4)", + "wit-bindgen-gen-core 0.2.0 (git+https://github.com/bytecodealliance/wit-bindgen?rev=cb871cfa1ee460b51eb1d144b175b9aab9c50aba)", ] [[package]] @@ -7287,11 +7321,11 @@ dependencies = [ [[package]] name = "wit-bindgen-gen-wasmtime" version = "0.2.0" -source = "git+https://github.com/fermyon/wit-bindgen-backport?rev=d91e1c50be5c94a0737a39743a5467ee880b84c4#d91e1c50be5c94a0737a39743a5467ee880b84c4" +source = "git+https://github.com/fermyon/wit-bindgen-backport?rev=b46f69ef2150d65d8a223d49d106457efdb7cdb3#b46f69ef2150d65d8a223d49d106457efdb7cdb3" dependencies = [ "heck 0.3.3", - "wit-bindgen-gen-core 0.2.0 (git+https://github.com/fermyon/wit-bindgen-backport?rev=d91e1c50be5c94a0737a39743a5467ee880b84c4)", - "wit-bindgen-gen-rust 0.2.0 (git+https://github.com/fermyon/wit-bindgen-backport?rev=d91e1c50be5c94a0737a39743a5467ee880b84c4)", + "wit-bindgen-gen-core 0.2.0 (git+https://github.com/fermyon/wit-bindgen-backport?rev=b46f69ef2150d65d8a223d49d106457efdb7cdb3)", + "wit-bindgen-gen-rust 0.2.0 (git+https://github.com/fermyon/wit-bindgen-backport?rev=b46f69ef2150d65d8a223d49d106457efdb7cdb3)", ] [[package]] @@ -7318,7 +7352,7 @@ dependencies = [ [[package]] name = "wit-bindgen-wasmtime" version = "0.2.0" -source = "git+https://github.com/fermyon/wit-bindgen-backport?rev=d91e1c50be5c94a0737a39743a5467ee880b84c4#d91e1c50be5c94a0737a39743a5467ee880b84c4" +source = "git+https://github.com/fermyon/wit-bindgen-backport?rev=b46f69ef2150d65d8a223d49d106457efdb7cdb3#b46f69ef2150d65d8a223d49d106457efdb7cdb3" dependencies = [ "anyhow", "async-trait", @@ -7331,11 +7365,11 @@ dependencies = [ [[package]] name = "wit-bindgen-wasmtime-impl" version = "0.2.0" -source = "git+https://github.com/fermyon/wit-bindgen-backport?rev=d91e1c50be5c94a0737a39743a5467ee880b84c4#d91e1c50be5c94a0737a39743a5467ee880b84c4" +source = "git+https://github.com/fermyon/wit-bindgen-backport?rev=b46f69ef2150d65d8a223d49d106457efdb7cdb3#b46f69ef2150d65d8a223d49d106457efdb7cdb3" dependencies = [ "proc-macro2", "syn 1.0.109", - "wit-bindgen-gen-core 0.2.0 (git+https://github.com/fermyon/wit-bindgen-backport?rev=d91e1c50be5c94a0737a39743a5467ee880b84c4)", + "wit-bindgen-gen-core 0.2.0 (git+https://github.com/fermyon/wit-bindgen-backport?rev=b46f69ef2150d65d8a223d49d106457efdb7cdb3)", "wit-bindgen-gen-wasmtime", ] @@ -7375,7 +7409,7 @@ dependencies = [ [[package]] name = "wit-parser" version = "0.2.0" -source = "git+https://github.com/bytecodealliance/wit-bindgen?rev=cb871cfa1ee460b51eb1d144b175b9aab9c50aba#cb871cfa1ee460b51eb1d144b175b9aab9c50aba" +source = "git+https://github.com/fermyon/wit-bindgen-backport?rev=b46f69ef2150d65d8a223d49d106457efdb7cdb3#b46f69ef2150d65d8a223d49d106457efdb7cdb3" dependencies = [ "anyhow", "id-arena", @@ -7387,7 +7421,7 @@ dependencies = [ [[package]] name = "wit-parser" version = "0.2.0" -source = "git+https://github.com/fermyon/wit-bindgen-backport?rev=d91e1c50be5c94a0737a39743a5467ee880b84c4#d91e1c50be5c94a0737a39743a5467ee880b84c4" +source = "git+https://github.com/bytecodealliance/wit-bindgen?rev=cb871cfa1ee460b51eb1d144b175b9aab9c50aba#cb871cfa1ee460b51eb1d144b175b9aab9c50aba" dependencies = [ "anyhow", "id-arena", @@ -7430,7 +7464,8 @@ dependencies = [ [[package]] name = "witx" version = "0.9.1" -source = "git+https://github.com/bytecodealliance/wasmtime?branch=release-10.0.0#854fe1ad50968d67e961eed4a573c4dfa8ab7178" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e366f27a5cabcddb2706a78296a40b8fcc451e1a6aba2fc1d94b4a01bdaaef4b" dependencies = [ "anyhow", "log", diff --git a/Cargo.toml b/Cargo.toml index ca6ad25d9c..efa3f54d57 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -109,10 +109,10 @@ members = [ [workspace.dependencies] tracing = { version = "0.1", features = ["log"] } -wasmtime-wasi = { git = "https://github.com/bytecodealliance/wasmtime", branch = "release-10.0.0", features = ["tokio"] } -wasi-common-preview1 = { package = "wasi-common", git = "https://github.com/bytecodealliance/wasmtime", branch = "release-10.0.0" } -wasmtime = { git = "https://github.com/bytecodealliance/wasmtime", branch = "release-10.0.0", features = ["component-model"] } -spin-componentize = { git = "https://github.com/fermyon/spin-componentize", rev = "3d9937bb7d107bd0684d29d4f4c53f9607f9ad44" } +wasmtime-wasi = { version = "10.0.0", features = ["tokio"] } +wasi-common-preview1 = { package = "wasi-common", version = "10.0.0" } +wasmtime = { version = "10.0.0", features = ["component-model"] } +spin-componentize = { git = "https://github.com/fermyon/spin-componentize", rev = "545afb39ca5f9ead37cbe56bcb5bf7f4678fe209" } [workspace.dependencies.bindle] git = "https://github.com/fermyon/bindle" diff --git a/crates/templates/Cargo.toml b/crates/templates/Cargo.toml index 8a78f9430b..c1e67819a7 100644 --- a/crates/templates/Cargo.toml +++ b/crates/templates/Cargo.toml @@ -38,5 +38,5 @@ wasmtime-wasi = { workspace = true } [dependencies.wit-bindgen-wasmtime] git = "https://github.com/fermyon/wit-bindgen-backport" # TODO: update to merge commit when merged -rev = "d91e1c50be5c94a0737a39743a5467ee880b84c4" +rev = "b46f69ef2150d65d8a223d49d106457efdb7cdb3" features = ["async"] From 10dac2d90ab2025685062649453e2863f33fed4a Mon Sep 17 00:00:00 2001 From: Ryan Levick Date: Tue, 20 Jun 2023 21:34:41 +0200 Subject: [PATCH 8/9] clean up some imports Signed-off-by: Ryan Levick --- crates/core/src/store.rs | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/crates/core/src/store.rs b/crates/core/src/store.rs index d64cb37fac..1d2fc61f40 100644 --- a/crates/core/src/store.rs +++ b/crates/core/src/store.rs @@ -8,8 +8,6 @@ use system_interface::io::ReadReady; use wasi_common_preview1 as wasi_preview1; use wasmtime_wasi as wasmtime_wasi_preview1; use wasmtime_wasi::preview2 as wasi_preview2; -use wasmtime_wasi::preview2 as wasmtime_wasi_preview2; -use wasmtime_wasi_preview1::preview2::Table; use crate::{ host_component::{HostComponents, HostComponentsData}, @@ -158,7 +156,7 @@ impl StoreBuilder { ctx.set_stdin(Box::new(wasmtime_wasi_preview1::stdio::stdin())) } WasiCtxBuilder::Preview2(ctx) => { - *ctx = std::mem::take(ctx).set_stdin(wasmtime_wasi_preview2::stdio::stdin()) + *ctx = std::mem::take(ctx).set_stdin(wasi_preview2::stdio::stdin()) } }); } @@ -182,7 +180,7 @@ impl StoreBuilder { ctx.set_stdout(Box::new(wasmtime_wasi_preview1::stdio::stdout())) } WasiCtxBuilder::Preview2(ctx) => { - *ctx = std::mem::take(ctx).set_stdout(wasmtime_wasi_preview2::stdio::stdout()) + *ctx = std::mem::take(ctx).set_stdout(wasi_preview2::stdio::stdout()) } }); } @@ -236,7 +234,7 @@ impl StoreBuilder { ctx.set_stderr(Box::new(wasmtime_wasi_preview1::stdio::stderr())) } WasiCtxBuilder::Preview2(ctx) => { - *ctx = std::mem::take(ctx).set_stderr(wasmtime_wasi_preview2::stdio::stderr()) + *ctx = std::mem::take(ctx).set_stderr(wasi_preview2::stdio::stderr()) } }); } @@ -356,7 +354,7 @@ impl StoreBuilder { /// /// If `T: Default`, it may be preferable to use [`Store::build`]. pub fn build_with_data(self, inner_data: T) -> Result> { - let mut table = Table::new(); + let mut table = wasi_preview2::Table::new(); let wasi = self.wasi.map_err(anyhow::Error::msg)?.build(&mut table)?; let mut inner = wasmtime::Store::new( @@ -431,7 +429,7 @@ impl From for WasiCtxBuilder { } impl WasiCtxBuilder { - fn build(self, table: &mut Table) -> anyhow::Result { + fn build(self, table: &mut wasi_preview2::Table) -> anyhow::Result { match self { WasiCtxBuilder::Preview1(ctx) => Ok(Wasi::Preview1(ctx)), WasiCtxBuilder::Preview2(b) => b.build(table).map(Wasi::Preview2), From 24937c78a794302a68976f7c2df6efab2c499c42 Mon Sep 17 00:00:00 2001 From: Ryan Levick Date: Wed, 21 Jun 2023 10:37:49 +0200 Subject: [PATCH 9/9] Update to merged versions of dependencies Signed-off-by: Ryan Levick --- Cargo.lock | 24 ++++++++++++------------ Cargo.toml | 2 +- crates/templates/Cargo.toml | 3 +-- 3 files changed, 14 insertions(+), 15 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index cc9a7c4678..f6f2740bda 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -5106,7 +5106,7 @@ dependencies = [ [[package]] name = "spin-componentize" version = "0.1.0" -source = "git+https://github.com/fermyon/spin-componentize?rev=545afb39ca5f9ead37cbe56bcb5bf7f4678fe209#545afb39ca5f9ead37cbe56bcb5bf7f4678fe209" +source = "git+https://github.com/fermyon/spin-componentize?rev=bdea058594f73edba21e12950b5f71a71244bac9#bdea058594f73edba21e12950b5f71a71244bac9" dependencies = [ "anyhow", "wasm-encoder 0.29.0", @@ -7275,10 +7275,10 @@ dependencies = [ [[package]] name = "wit-bindgen-gen-core" version = "0.2.0" -source = "git+https://github.com/fermyon/wit-bindgen-backport?rev=b46f69ef2150d65d8a223d49d106457efdb7cdb3#b46f69ef2150d65d8a223d49d106457efdb7cdb3" +source = "git+https://github.com/fermyon/wit-bindgen-backport?rev=b89d5079ba5b07b319631a1b191d2139f126c976#b89d5079ba5b07b319631a1b191d2139f126c976" dependencies = [ "anyhow", - "wit-parser 0.2.0 (git+https://github.com/fermyon/wit-bindgen-backport?rev=b46f69ef2150d65d8a223d49d106457efdb7cdb3)", + "wit-parser 0.2.0 (git+https://github.com/fermyon/wit-bindgen-backport?rev=b89d5079ba5b07b319631a1b191d2139f126c976)", ] [[package]] @@ -7293,10 +7293,10 @@ dependencies = [ [[package]] name = "wit-bindgen-gen-rust" version = "0.2.0" -source = "git+https://github.com/fermyon/wit-bindgen-backport?rev=b46f69ef2150d65d8a223d49d106457efdb7cdb3#b46f69ef2150d65d8a223d49d106457efdb7cdb3" +source = "git+https://github.com/fermyon/wit-bindgen-backport?rev=b89d5079ba5b07b319631a1b191d2139f126c976#b89d5079ba5b07b319631a1b191d2139f126c976" dependencies = [ "heck 0.3.3", - "wit-bindgen-gen-core 0.2.0 (git+https://github.com/fermyon/wit-bindgen-backport?rev=b46f69ef2150d65d8a223d49d106457efdb7cdb3)", + "wit-bindgen-gen-core 0.2.0 (git+https://github.com/fermyon/wit-bindgen-backport?rev=b89d5079ba5b07b319631a1b191d2139f126c976)", ] [[package]] @@ -7321,11 +7321,11 @@ dependencies = [ [[package]] name = "wit-bindgen-gen-wasmtime" version = "0.2.0" -source = "git+https://github.com/fermyon/wit-bindgen-backport?rev=b46f69ef2150d65d8a223d49d106457efdb7cdb3#b46f69ef2150d65d8a223d49d106457efdb7cdb3" +source = "git+https://github.com/fermyon/wit-bindgen-backport?rev=b89d5079ba5b07b319631a1b191d2139f126c976#b89d5079ba5b07b319631a1b191d2139f126c976" dependencies = [ "heck 0.3.3", - "wit-bindgen-gen-core 0.2.0 (git+https://github.com/fermyon/wit-bindgen-backport?rev=b46f69ef2150d65d8a223d49d106457efdb7cdb3)", - "wit-bindgen-gen-rust 0.2.0 (git+https://github.com/fermyon/wit-bindgen-backport?rev=b46f69ef2150d65d8a223d49d106457efdb7cdb3)", + "wit-bindgen-gen-core 0.2.0 (git+https://github.com/fermyon/wit-bindgen-backport?rev=b89d5079ba5b07b319631a1b191d2139f126c976)", + "wit-bindgen-gen-rust 0.2.0 (git+https://github.com/fermyon/wit-bindgen-backport?rev=b89d5079ba5b07b319631a1b191d2139f126c976)", ] [[package]] @@ -7352,7 +7352,7 @@ dependencies = [ [[package]] name = "wit-bindgen-wasmtime" version = "0.2.0" -source = "git+https://github.com/fermyon/wit-bindgen-backport?rev=b46f69ef2150d65d8a223d49d106457efdb7cdb3#b46f69ef2150d65d8a223d49d106457efdb7cdb3" +source = "git+https://github.com/fermyon/wit-bindgen-backport?rev=b89d5079ba5b07b319631a1b191d2139f126c976#b89d5079ba5b07b319631a1b191d2139f126c976" dependencies = [ "anyhow", "async-trait", @@ -7365,11 +7365,11 @@ dependencies = [ [[package]] name = "wit-bindgen-wasmtime-impl" version = "0.2.0" -source = "git+https://github.com/fermyon/wit-bindgen-backport?rev=b46f69ef2150d65d8a223d49d106457efdb7cdb3#b46f69ef2150d65d8a223d49d106457efdb7cdb3" +source = "git+https://github.com/fermyon/wit-bindgen-backport?rev=b89d5079ba5b07b319631a1b191d2139f126c976#b89d5079ba5b07b319631a1b191d2139f126c976" dependencies = [ "proc-macro2", "syn 1.0.109", - "wit-bindgen-gen-core 0.2.0 (git+https://github.com/fermyon/wit-bindgen-backport?rev=b46f69ef2150d65d8a223d49d106457efdb7cdb3)", + "wit-bindgen-gen-core 0.2.0 (git+https://github.com/fermyon/wit-bindgen-backport?rev=b89d5079ba5b07b319631a1b191d2139f126c976)", "wit-bindgen-gen-wasmtime", ] @@ -7409,7 +7409,7 @@ dependencies = [ [[package]] name = "wit-parser" version = "0.2.0" -source = "git+https://github.com/fermyon/wit-bindgen-backport?rev=b46f69ef2150d65d8a223d49d106457efdb7cdb3#b46f69ef2150d65d8a223d49d106457efdb7cdb3" +source = "git+https://github.com/fermyon/wit-bindgen-backport?rev=b89d5079ba5b07b319631a1b191d2139f126c976#b89d5079ba5b07b319631a1b191d2139f126c976" dependencies = [ "anyhow", "id-arena", diff --git a/Cargo.toml b/Cargo.toml index efa3f54d57..5ac5084ff5 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -112,7 +112,7 @@ tracing = { version = "0.1", features = ["log"] } wasmtime-wasi = { version = "10.0.0", features = ["tokio"] } wasi-common-preview1 = { package = "wasi-common", version = "10.0.0" } wasmtime = { version = "10.0.0", features = ["component-model"] } -spin-componentize = { git = "https://github.com/fermyon/spin-componentize", rev = "545afb39ca5f9ead37cbe56bcb5bf7f4678fe209" } +spin-componentize = { git = "https://github.com/fermyon/spin-componentize", rev = "bdea058594f73edba21e12950b5f71a71244bac9" } [workspace.dependencies.bindle] git = "https://github.com/fermyon/bindle" diff --git a/crates/templates/Cargo.toml b/crates/templates/Cargo.toml index c1e67819a7..554b0f9d53 100644 --- a/crates/templates/Cargo.toml +++ b/crates/templates/Cargo.toml @@ -37,6 +37,5 @@ wasmtime-wasi = { workspace = true } [dependencies.wit-bindgen-wasmtime] git = "https://github.com/fermyon/wit-bindgen-backport" -# TODO: update to merge commit when merged -rev = "b46f69ef2150d65d8a223d49d106457efdb7cdb3" +rev = "b89d5079ba5b07b319631a1b191d2139f126c976" features = ["async"]