diff --git a/Cargo.lock b/Cargo.lock index c6fcbc298a..3d45ad3640 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1077,18 +1077,16 @@ dependencies = [ [[package]] name = "cranelift-bforest" -version = "0.100.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "03b9d1a9e776c27ad55d7792a380785d1fe8c2d7b099eed8dbd8f4af2b598192" +version = "0.101.0" +source = "git+https://github.com/bytecodealliance/wasmtime?rev=c796ce7376a57a40605f03e74bd78cefcc9acf3a#c796ce7376a57a40605f03e74bd78cefcc9acf3a" dependencies = [ "cranelift-entity", ] [[package]] name = "cranelift-codegen" -version = "0.100.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5528483314c2dd5da438576cd8a9d0b3cedad66fb8a4727f90cd319a81950038" +version = "0.101.0" +source = "git+https://github.com/bytecodealliance/wasmtime?rev=c796ce7376a57a40605f03e74bd78cefcc9acf3a#c796ce7376a57a40605f03e74bd78cefcc9acf3a" dependencies = [ "bumpalo", "cranelift-bforest", @@ -1107,33 +1105,29 @@ dependencies = [ [[package]] name = "cranelift-codegen-meta" -version = "0.100.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f46a8318163f7682e35b8730ba93c1b586a2da8ce12a0ed545efc1218550f70" +version = "0.101.0" +source = "git+https://github.com/bytecodealliance/wasmtime?rev=c796ce7376a57a40605f03e74bd78cefcc9acf3a#c796ce7376a57a40605f03e74bd78cefcc9acf3a" dependencies = [ "cranelift-codegen-shared", ] [[package]] name = "cranelift-codegen-shared" -version = "0.100.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "37d1239cfd50eecfaed468d46943f8650e32969591868ad50111613704da6c70" +version = "0.101.0" +source = "git+https://github.com/bytecodealliance/wasmtime?rev=c796ce7376a57a40605f03e74bd78cefcc9acf3a#c796ce7376a57a40605f03e74bd78cefcc9acf3a" [[package]] name = "cranelift-control" -version = "0.100.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bcc530560c8f16cc1d4dd7ea000c56f519c60d1a914977abe849ce555c35a61d" +version = "0.101.0" +source = "git+https://github.com/bytecodealliance/wasmtime?rev=c796ce7376a57a40605f03e74bd78cefcc9acf3a#c796ce7376a57a40605f03e74bd78cefcc9acf3a" dependencies = [ "arbitrary", ] [[package]] name = "cranelift-entity" -version = "0.100.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f333fa641a9ad2bff0b107767dcb972c18c2bfab7969805a1d7e42449ccb0408" +version = "0.101.0" +source = "git+https://github.com/bytecodealliance/wasmtime?rev=c796ce7376a57a40605f03e74bd78cefcc9acf3a#c796ce7376a57a40605f03e74bd78cefcc9acf3a" dependencies = [ "serde", "serde_derive", @@ -1141,9 +1135,8 @@ dependencies = [ [[package]] name = "cranelift-frontend" -version = "0.100.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "06abf6563015a80f03f8bc4df307d0a81363f4eb73108df3a34f6e66fb6d5307" +version = "0.101.0" +source = "git+https://github.com/bytecodealliance/wasmtime?rev=c796ce7376a57a40605f03e74bd78cefcc9acf3a#c796ce7376a57a40605f03e74bd78cefcc9acf3a" dependencies = [ "cranelift-codegen", "log", @@ -1153,15 +1146,13 @@ dependencies = [ [[package]] name = "cranelift-isle" -version = "0.100.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0eb29d0edc8a5c029ed0f7ca77501f272738e3c410020b4a00f42ffe8ad2a8aa" +version = "0.101.0" +source = "git+https://github.com/bytecodealliance/wasmtime?rev=c796ce7376a57a40605f03e74bd78cefcc9acf3a#c796ce7376a57a40605f03e74bd78cefcc9acf3a" [[package]] name = "cranelift-native" -version = "0.100.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "006056a7fa920870bad06bf8e1b3033d70cbb7ee625b035efa9d90882a931868" +version = "0.101.0" +source = "git+https://github.com/bytecodealliance/wasmtime?rev=c796ce7376a57a40605f03e74bd78cefcc9acf3a#c796ce7376a57a40605f03e74bd78cefcc9acf3a" dependencies = [ "cranelift-codegen", "libc", @@ -1170,9 +1161,8 @@ dependencies = [ [[package]] name = "cranelift-wasm" -version = "0.100.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7b3d08c05f82903a1f6a04d89c4b9ecb47a4035710f89a39a21a147a80214672" +version = "0.101.0" +source = "git+https://github.com/bytecodealliance/wasmtime?rev=c796ce7376a57a40605f03e74bd78cefcc9acf3a#c796ce7376a57a40605f03e74bd78cefcc9acf3a" dependencies = [ "cranelift-codegen", "cranelift-entity", @@ -1180,7 +1170,7 @@ dependencies = [ "itertools 0.10.5", "log", "smallvec", - "wasmparser 0.112.0", + "wasmparser", "wasmtime-types", ] @@ -2824,9 +2814,9 @@ checksum = "453ad9f582a441959e5f0d088b02ce04cfe8d51a8eaf077f12ac6d3e94164ca6" [[package]] name = "ittapi" -version = "0.3.3" +version = "0.3.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2e648c437172ce7d3ac35ca11a068755072054826fa455a916b43524fa4a62a7" +checksum = "25a5c0b993601cad796222ea076565c5d9f337d35592f8622c753724f06d7271" dependencies = [ "anyhow", "ittapi-sys", @@ -2835,9 +2825,9 @@ dependencies = [ [[package]] name = "ittapi-sys" -version = "0.3.3" +version = "0.3.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a9b32a4d23f72548178dde54f3c12c6b6a08598e25575c0d0fa5bd861e0dc1a5" +checksum = "cb7b5e473765060536a660eed127f758cf1a810c73e49063264959c60d1727d9" dependencies = [ "cc", ] @@ -4389,17 +4379,6 @@ dependencies = [ "cc", ] -[[package]] -name = "pulldown-cmark" -version = "0.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ffade02495f22453cd593159ea2f59827aae7f53fa8323f756799b670881dcf8" -dependencies = [ - "bitflags 1.3.2", - "memchr", - "unicase", -] - [[package]] name = "pulldown-cmark" version = "0.9.3" @@ -4608,9 +4587,9 @@ dependencies = [ [[package]] name = "regalloc2" -version = "0.9.2" +version = "0.9.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b4dcbd3a2ae7fb94b5813fa0e957c6ab51bf5d0a8ee1b69e0c2d0f1e6eb8485" +checksum = "ad156d539c879b7a24a363a2016d77961786e71f48f2e2fc8302a92abd2429a6" dependencies = [ "hashbrown 0.13.2", "log", @@ -5461,13 +5440,13 @@ dependencies = [ [[package]] name = "spin-componentize" version = "0.1.0" -source = "git+https://github.com/fermyon/spin-componentize?rev=f29cdb26a6b1700ae1fe48c94bbef26a8069d566#f29cdb26a6b1700ae1fe48c94bbef26a8069d566" +source = "git+https://github.com/fermyon/spin-componentize?rev=84286054d632ccb8ae06c6419940b5d328229e59#84286054d632ccb8ae06c6419940b5d328229e59" dependencies = [ "anyhow", - "wasm-encoder 0.32.0", - "wasmparser 0.112.0", - "wit-component 0.14.0", - "wit-parser 0.11.0", + "wasm-encoder", + "wasmparser", + "wit-component", + "wit-parser", ] [[package]] @@ -6640,7 +6619,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "97fee6b57c6a41524a810daee9286c02d7752c4253064d0b05472833a438f675" dependencies = [ "cfg-if", - "rand 0.8.5", + "rand 0.7.3", "static_assertions", ] @@ -6854,9 +6833,8 @@ checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" [[package]] name = "wasi-cap-std-sync" -version = "13.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec076cd75f207327f5bfaebb915ef03d82c3a01a6d9b5d0deb6eafffceab3095" +version = "14.0.0" +source = "git+https://github.com/bytecodealliance/wasmtime?rev=c796ce7376a57a40605f03e74bd78cefcc9acf3a#c796ce7376a57a40605f03e74bd78cefcc9acf3a" dependencies = [ "anyhow", "async-trait", @@ -6867,7 +6845,6 @@ dependencies = [ "fs-set-times", "io-extras", "io-lifetimes 2.0.2", - "is-terminal", "once_cell", "rustix 0.38.13", "system-interface", @@ -6878,9 +6855,8 @@ dependencies = [ [[package]] name = "wasi-common" -version = "13.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3f391b334c783c1154369be62c31dc8598ffa1a6c34ea05d7f8cf0b18ce7c272" +version = "14.0.0" +source = "git+https://github.com/bytecodealliance/wasmtime?rev=c796ce7376a57a40605f03e74bd78cefcc9acf3a#c796ce7376a57a40605f03e74bd78cefcc9acf3a" dependencies = [ "anyhow", "bitflags 2.4.0", @@ -6898,9 +6874,8 @@ dependencies = [ [[package]] name = "wasi-tokio" -version = "13.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6de05e4d9f81b8e82672cff04bab4128a170274ed2c44ff4c9e36905aefcaf35" +version = "14.0.0" +source = "git+https://github.com/bytecodealliance/wasmtime?rev=c796ce7376a57a40605f03e74bd78cefcc9acf3a#c796ce7376a57a40605f03e74bd78cefcc9acf3a" dependencies = [ "anyhow", "cap-std", @@ -6981,48 +6956,26 @@ checksum = "0046fef7e28c3804e5e38bfa31ea2a0f73905319b677e57ebe37e49358989b5d" [[package]] name = "wasm-encoder" -version = "0.29.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "18c41dbd92eaebf3612a39be316540b8377c871cb9bde6b064af962984912881" -dependencies = [ - "leb128", -] - -[[package]] -name = "wasm-encoder" -version = "0.32.0" +version = "0.33.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ba64e81215916eaeb48fee292f29401d69235d62d8b8fd92a7b2844ec5ae5f7" +checksum = "34180c89672b3e4825c3a8db4b61a674f1447afd5fe2445b2d22c3d8b6ea086c" dependencies = [ "leb128", ] [[package]] name = "wasm-metadata" -version = "0.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "36e5156581ff4a302405c44ca7c85347563ca431d15f1a773f12c9c7b9a6cdc9" -dependencies = [ - "anyhow", - "indexmap 1.9.2", - "serde", - "wasm-encoder 0.29.0", - "wasmparser 0.107.0", -] - -[[package]] -name = "wasm-metadata" -version = "0.10.3" +version = "0.10.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08dc59d1fa569150851542143ca79438ca56845ccb31696c70225c638e063471" +checksum = "4f2c051ef041d348324b01ff0419f6f6593f094b4897d93c9cf52d5d1ac879ba" dependencies = [ "anyhow", "indexmap 2.0.0", "serde", "serde_json", "spdx", - "wasm-encoder 0.32.0", - "wasmparser 0.112.0", + "wasm-encoder", + "wasmparser", ] [[package]] @@ -7040,19 +6993,9 @@ dependencies = [ [[package]] name = "wasmparser" -version = "0.107.0" +version = "0.113.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "29e3ac9b780c7dda0cac7a52a5d6d2d6707cc6e3451c9db209b6c758f40d7acb" -dependencies = [ - "indexmap 1.9.2", - "semver", -] - -[[package]] -name = "wasmparser" -version = "0.112.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e986b010f47fcce49cf8ea5d5f9e5d2737832f12b53ae8ae785bbe895d0877bf" +checksum = "286049849b5a5bd09a8773171be96824afabffc7cc3df6caaf33a38db6cd07ae" dependencies = [ "indexmap 2.0.0", "semver", @@ -7060,19 +7003,18 @@ dependencies = [ [[package]] name = "wasmprinter" -version = "0.2.64" +version = "0.2.68" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "34ddf5892036cd4b780d505eff1194a0cbc10ed896097656fdcea3744b5e7c2f" +checksum = "537030718ce76e985896e91fe2cac77c1913c8dccd46eaf8ab1a4cd56d824cc3" dependencies = [ "anyhow", - "wasmparser 0.112.0", + "wasmparser", ] [[package]] name = "wasmtime" -version = "13.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "16ed7db409c1acf60d33128b2a38bee25aaf38c4bd955ab98a5b623c8294593c" +version = "14.0.0" +source = "git+https://github.com/bytecodealliance/wasmtime?rev=c796ce7376a57a40605f03e74bd78cefcc9acf3a#c796ce7376a57a40605f03e74bd78cefcc9acf3a" dependencies = [ "anyhow", "async-trait", @@ -7093,8 +7035,8 @@ dependencies = [ "serde_derive", "serde_json", "target-lexicon", - "wasm-encoder 0.32.0", - "wasmparser 0.112.0", + "wasm-encoder", + "wasmparser", "wasmtime-cache", "wasmtime-component-macro", "wasmtime-component-util", @@ -7110,18 +7052,16 @@ dependencies = [ [[package]] name = "wasmtime-asm-macros" -version = "13.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "53af0f8f6271bd687fe5632c8fe0a0f061d0aa1b99a0cd4e1df8e4cbeb809d2f" +version = "14.0.0" +source = "git+https://github.com/bytecodealliance/wasmtime?rev=c796ce7376a57a40605f03e74bd78cefcc9acf3a#c796ce7376a57a40605f03e74bd78cefcc9acf3a" dependencies = [ "cfg-if", ] [[package]] name = "wasmtime-cache" -version = "13.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "41376a7c094335ee08abe6a4eff79a32510cc805a249eff1b5e7adf0a42e7cdf" +version = "14.0.0" +source = "git+https://github.com/bytecodealliance/wasmtime?rev=c796ce7376a57a40605f03e74bd78cefcc9acf3a#c796ce7376a57a40605f03e74bd78cefcc9acf3a" dependencies = [ "anyhow", "base64 0.21.3", @@ -7139,9 +7079,8 @@ dependencies = [ [[package]] name = "wasmtime-component-macro" -version = "13.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "74ab5b291f2dad56f1e6929cc61fb7cac68845766ca77c3838b5d05d82c33976" +version = "14.0.0" +source = "git+https://github.com/bytecodealliance/wasmtime?rev=c796ce7376a57a40605f03e74bd78cefcc9acf3a#c796ce7376a57a40605f03e74bd78cefcc9acf3a" dependencies = [ "anyhow", "proc-macro2", @@ -7149,20 +7088,18 @@ dependencies = [ "syn 2.0.29", "wasmtime-component-util", "wasmtime-wit-bindgen", - "wit-parser 0.11.0", + "wit-parser", ] [[package]] name = "wasmtime-component-util" -version = "13.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "21436177bf19f6b60dc0b83ad5872e849892a4a90c3572785e1a28c0e2e1132c" +version = "14.0.0" +source = "git+https://github.com/bytecodealliance/wasmtime?rev=c796ce7376a57a40605f03e74bd78cefcc9acf3a#c796ce7376a57a40605f03e74bd78cefcc9acf3a" [[package]] name = "wasmtime-cranelift" -version = "13.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "920e42058862d1f7a3dd3fca73cb495a20d7506e3ada4bbc0a9780cd636da7ca" +version = "14.0.0" +source = "git+https://github.com/bytecodealliance/wasmtime?rev=c796ce7376a57a40605f03e74bd78cefcc9acf3a#c796ce7376a57a40605f03e74bd78cefcc9acf3a" dependencies = [ "anyhow", "cfg-if", @@ -7177,7 +7114,7 @@ dependencies = [ "object 0.32.1", "target-lexicon", "thiserror", - "wasmparser 0.112.0", + "wasmparser", "wasmtime-cranelift-shared", "wasmtime-environ", "wasmtime-versioned-export-macros", @@ -7185,9 +7122,8 @@ dependencies = [ [[package]] name = "wasmtime-cranelift-shared" -version = "13.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "516d63bbe18219e64a9705cf3a2c865afe1fb711454ea03091dc85a1d708194d" +version = "14.0.0" +source = "git+https://github.com/bytecodealliance/wasmtime?rev=c796ce7376a57a40605f03e74bd78cefcc9acf3a#c796ce7376a57a40605f03e74bd78cefcc9acf3a" dependencies = [ "anyhow", "cranelift-codegen", @@ -7201,9 +7137,8 @@ dependencies = [ [[package]] name = "wasmtime-environ" -version = "13.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "59cef239d663885f1427f8b8f4fde7be6075249c282580d94b480f11953ca194" +version = "14.0.0" +source = "git+https://github.com/bytecodealliance/wasmtime?rev=c796ce7376a57a40605f03e74bd78cefcc9acf3a#c796ce7376a57a40605f03e74bd78cefcc9acf3a" dependencies = [ "anyhow", "cranelift-entity", @@ -7215,8 +7150,8 @@ dependencies = [ "serde_derive", "target-lexicon", "thiserror", - "wasm-encoder 0.32.0", - "wasmparser 0.112.0", + "wasm-encoder", + "wasmparser", "wasmprinter", "wasmtime-component-util", "wasmtime-types", @@ -7224,9 +7159,8 @@ dependencies = [ [[package]] name = "wasmtime-fiber" -version = "13.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2ef118b557df6193cd82cfb45ab57cd12388fedfe2bb76f090b2d77c96c1b56e" +version = "14.0.0" +source = "git+https://github.com/bytecodealliance/wasmtime?rev=c796ce7376a57a40605f03e74bd78cefcc9acf3a#c796ce7376a57a40605f03e74bd78cefcc9acf3a" dependencies = [ "cc", "cfg-if", @@ -7238,9 +7172,8 @@ dependencies = [ [[package]] name = "wasmtime-jit" -version = "13.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c8089d5909b8f923aad57702ebaacb7b662aa9e43a3f71e83e025c5379a1205f" +version = "14.0.0" +source = "git+https://github.com/bytecodealliance/wasmtime?rev=c796ce7376a57a40605f03e74bd78cefcc9acf3a#c796ce7376a57a40605f03e74bd78cefcc9acf3a" dependencies = [ "addr2line 0.21.0", "anyhow", @@ -7265,9 +7198,8 @@ dependencies = [ [[package]] name = "wasmtime-jit-debug" -version = "13.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b13924aedf6799ad66edb25500a20e3226629978b30a958c55285352bad130a" +version = "14.0.0" +source = "git+https://github.com/bytecodealliance/wasmtime?rev=c796ce7376a57a40605f03e74bd78cefcc9acf3a#c796ce7376a57a40605f03e74bd78cefcc9acf3a" dependencies = [ "object 0.32.1", "once_cell", @@ -7277,9 +7209,8 @@ dependencies = [ [[package]] name = "wasmtime-jit-icache-coherence" -version = "13.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c6ff5f3707a5e3797deeeeac6ac26b2e1dd32dbc06693c0ab52e8ac4d18ec706" +version = "14.0.0" +source = "git+https://github.com/bytecodealliance/wasmtime?rev=c796ce7376a57a40605f03e74bd78cefcc9acf3a#c796ce7376a57a40605f03e74bd78cefcc9acf3a" dependencies = [ "cfg-if", "libc", @@ -7288,9 +7219,8 @@ dependencies = [ [[package]] name = "wasmtime-runtime" -version = "13.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "11ab4ce04ac05342edfa7f42895f2a5d8b16ee914330869acb865cd1facf265f" +version = "14.0.0" +source = "git+https://github.com/bytecodealliance/wasmtime?rev=c796ce7376a57a40605f03e74bd78cefcc9acf3a#c796ce7376a57a40605f03e74bd78cefcc9acf3a" dependencies = [ "anyhow", "cc", @@ -7306,7 +7236,7 @@ dependencies = [ "rand 0.8.5", "rustix 0.38.13", "sptr", - "wasm-encoder 0.32.0", + "wasm-encoder", "wasmtime-asm-macros", "wasmtime-environ", "wasmtime-fiber", @@ -7318,22 +7248,20 @@ dependencies = [ [[package]] name = "wasmtime-types" -version = "13.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ecf61e21d5bd95e1ad7fa42b7bdabe21220682d6a6046d376edca29760849222" +version = "14.0.0" +source = "git+https://github.com/bytecodealliance/wasmtime?rev=c796ce7376a57a40605f03e74bd78cefcc9acf3a#c796ce7376a57a40605f03e74bd78cefcc9acf3a" dependencies = [ "cranelift-entity", "serde", "serde_derive", "thiserror", - "wasmparser 0.112.0", + "wasmparser", ] [[package]] name = "wasmtime-versioned-export-macros" -version = "13.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fe877472cbdd6d96b4ecdc112af764e3b9d58c2e4175a87828f892ab94c60643" +version = "14.0.0" +source = "git+https://github.com/bytecodealliance/wasmtime?rev=c796ce7376a57a40605f03e74bd78cefcc9acf3a#c796ce7376a57a40605f03e74bd78cefcc9acf3a" dependencies = [ "proc-macro2", "quote", @@ -7342,9 +7270,8 @@ dependencies = [ [[package]] name = "wasmtime-wasi" -version = "13.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6db393deb775e8bece53a6869be6425e46b28426aa7709df8c529a19759f4be" +version = "14.0.0" +source = "git+https://github.com/bytecodealliance/wasmtime?rev=c796ce7376a57a40605f03e74bd78cefcc9acf3a#c796ce7376a57a40605f03e74bd78cefcc9acf3a" dependencies = [ "anyhow", "async-trait", @@ -7359,14 +7286,15 @@ dependencies = [ "futures", "io-extras", "io-lifetimes 2.0.2", - "is-terminal", "libc", + "log", "once_cell", "rustix 0.38.13", "system-interface", "thiserror", "tokio", "tracing", + "url", "wasi-cap-std-sync", "wasi-common", "wasi-tokio", @@ -7377,16 +7305,15 @@ dependencies = [ [[package]] name = "wasmtime-winch" -version = "13.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0bc5a770003807c55f2187a0092dea01722b0e24151e35816bd5091538bb8e88" +version = "14.0.0" +source = "git+https://github.com/bytecodealliance/wasmtime?rev=c796ce7376a57a40605f03e74bd78cefcc9acf3a#c796ce7376a57a40605f03e74bd78cefcc9acf3a" dependencies = [ "anyhow", "cranelift-codegen", "gimli 0.28.0", "object 0.32.1", "target-lexicon", - "wasmparser 0.112.0", + "wasmparser", "wasmtime-cranelift-shared", "wasmtime-environ", "winch-codegen", @@ -7394,21 +7321,19 @@ dependencies = [ [[package]] name = "wasmtime-wit-bindgen" -version = "13.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62003d48822f89cc393e93643366ddbee1766779c0874353b8ba2ede4679fbf9" +version = "14.0.0" +source = "git+https://github.com/bytecodealliance/wasmtime?rev=c796ce7376a57a40605f03e74bd78cefcc9acf3a#c796ce7376a57a40605f03e74bd78cefcc9acf3a" dependencies = [ "anyhow", "heck 0.4.1", "indexmap 2.0.0", - "wit-parser 0.11.0", + "wit-parser", ] [[package]] name = "wasmtime-wmemcheck" -version = "13.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5412bb464066d64c3398c96e6974348f90fa2a55110ad7da3f9295438cd4de84" +version = "14.0.0" +source = "git+https://github.com/bytecodealliance/wasmtime?rev=c796ce7376a57a40605f03e74bd78cefcc9acf3a#c796ce7376a57a40605f03e74bd78cefcc9acf3a" [[package]] name = "wast" @@ -7421,23 +7346,23 @@ dependencies = [ [[package]] name = "wast" -version = "64.0.0" +version = "66.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a259b226fd6910225aa7baeba82f9d9933b6d00f2ce1b49b80fa4214328237cc" +checksum = "0da7529bb848d58ab8bf32230fc065b363baee2bd338d5e58c589a1e7d83ad07" dependencies = [ "leb128", "memchr", "unicode-width", - "wasm-encoder 0.32.0", + "wasm-encoder", ] [[package]] name = "wat" -version = "1.0.71" +version = "1.0.75" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "53253d920ab413fca1c7dc2161d601c79b4fdf631d0ba51dd4343bf9b556c3f6" +checksum = "4780374047c65b6b6e86019093fe80c18b66825eb684df778a4e068282a780e7" dependencies = [ - "wast 64.0.0", + "wast 66.0.0", ] [[package]] @@ -7548,9 +7473,8 @@ dependencies = [ [[package]] name = "wiggle" -version = "13.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da341f21516453768bd115bdc17b186c0a1ab6773c2b2eeab44a062db49bd616" +version = "14.0.0" +source = "git+https://github.com/bytecodealliance/wasmtime?rev=c796ce7376a57a40605f03e74bd78cefcc9acf3a#c796ce7376a57a40605f03e74bd78cefcc9acf3a" dependencies = [ "anyhow", "async-trait", @@ -7563,9 +7487,8 @@ dependencies = [ [[package]] name = "wiggle-generate" -version = "13.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e22c6bd943a4bae37052b79d249fb32d7afa22b3f6a147a5f2e7bc2b9f901879" +version = "14.0.0" +source = "git+https://github.com/bytecodealliance/wasmtime?rev=c796ce7376a57a40605f03e74bd78cefcc9acf3a#c796ce7376a57a40605f03e74bd78cefcc9acf3a" dependencies = [ "anyhow", "heck 0.4.1", @@ -7578,9 +7501,8 @@ dependencies = [ [[package]] name = "wiggle-macro" -version = "13.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7d72d838b7c9302b2ca7c44f36d6af5ce1988239a16deba951d99c4630d17caf" +version = "14.0.0" +source = "git+https://github.com/bytecodealliance/wasmtime?rev=c796ce7376a57a40605f03e74bd78cefcc9acf3a#c796ce7376a57a40605f03e74bd78cefcc9acf3a" dependencies = [ "proc-macro2", "quote", @@ -7621,9 +7543,8 @@ checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" [[package]] name = "winch-codegen" -version = "0.11.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "50647204d600a2a112eefac0645ba6653809a15bd362c7e4e6a049a5bdff0de9" +version = "0.12.0" +source = "git+https://github.com/bytecodealliance/wasmtime?rev=c796ce7376a57a40605f03e74bd78cefcc9acf3a#c796ce7376a57a40605f03e74bd78cefcc9acf3a" dependencies = [ "anyhow", "cranelift-codegen", @@ -7631,7 +7552,7 @@ dependencies = [ "regalloc2", "smallvec", "target-lexicon", - "wasmparser 0.112.0", + "wasmparser", "wasmtime-environ", ] @@ -7837,9 +7758,8 @@ dependencies = [ [[package]] name = "wit-bindgen" -version = "0.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "392d16e9e46cc7ca98125bc288dd5e4db469efe8323d3e0dac815ca7f2398522" +version = "0.12.0" +source = "git+https://github.com/bytecodealliance/wit-bindgen?rev=46fba30bb667a3a4962f63b1cc28b84427b49114#46fba30bb667a3a4962f63b1cc28b84427b49114" dependencies = [ "bitflags 2.4.0", "wit-bindgen-rust-macro", @@ -7847,73 +7767,45 @@ dependencies = [ [[package]] name = "wit-bindgen-core" -version = "0.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d422d36cbd78caa0e18c3371628447807c66ee72466b69865ea7e33682598158" +version = "0.12.0" +source = "git+https://github.com/bytecodealliance/wit-bindgen?rev=46fba30bb667a3a4962f63b1cc28b84427b49114#46fba30bb667a3a4962f63b1cc28b84427b49114" dependencies = [ "anyhow", - "wit-component 0.11.0", - "wit-parser 0.8.0", + "wit-component", + "wit-parser", ] [[package]] name = "wit-bindgen-rust" -version = "0.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b76db68264f5d2089dc4652581236d8e75c5b89338de6187716215fd0e68ba3" -dependencies = [ - "heck 0.4.1", - "wasm-metadata 0.8.0", - "wit-bindgen-core", - "wit-bindgen-rust-lib", - "wit-component 0.11.0", -] - -[[package]] -name = "wit-bindgen-rust-lib" -version = "0.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1c50f334bc08b0903a43387f6eea6ef6aa9eb2a085729f1677b29992ecef20ba" +version = "0.12.0" +source = "git+https://github.com/bytecodealliance/wit-bindgen?rev=46fba30bb667a3a4962f63b1cc28b84427b49114#46fba30bb667a3a4962f63b1cc28b84427b49114" dependencies = [ + "anyhow", "heck 0.4.1", + "wasm-metadata", "wit-bindgen-core", + "wit-component", ] [[package]] name = "wit-bindgen-rust-macro" -version = "0.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ced38a5e174940c6a41ae587babeadfd2e2c2dc32f3b6488bcdca0e8922cf3f3" +version = "0.12.0" +source = "git+https://github.com/bytecodealliance/wit-bindgen?rev=46fba30bb667a3a4962f63b1cc28b84427b49114#46fba30bb667a3a4962f63b1cc28b84427b49114" dependencies = [ "anyhow", "proc-macro2", + "quote", "syn 2.0.29", "wit-bindgen-core", "wit-bindgen-rust", - "wit-component 0.11.0", + "wit-component", ] [[package]] name = "wit-component" -version = "0.11.0" +version = "0.14.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7cbd4c7f8f400327c482c88571f373844b7889e61460650d650fc5881bb3575c" -dependencies = [ - "anyhow", - "bitflags 1.3.2", - "indexmap 1.9.2", - "log", - "wasm-encoder 0.29.0", - "wasm-metadata 0.8.0", - "wasmparser 0.107.0", - "wit-parser 0.8.0", -] - -[[package]] -name = "wit-component" -version = "0.14.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "66d9f2d16dd55d1a372dcfd4b7a466ea876682a5a3cb97e71ec9eef04affa876" +checksum = "2e2bf941487fc5afa9e3fc94761f6b80ecef5a2bed6239b959d23d9de69e3448" dependencies = [ "anyhow", "bitflags 2.4.0", @@ -7921,40 +7813,26 @@ dependencies = [ "log", "serde", "serde_json", - "wasm-encoder 0.32.0", - "wasm-metadata 0.10.3", - "wasmparser 0.112.0", - "wit-parser 0.11.0", -] - -[[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 1.9.2", - "log", - "pulldown-cmark 0.8.0", - "semver", - "unicode-xid", - "url", + "wasm-encoder", + "wasm-metadata", + "wasmparser", + "wit-parser", ] [[package]] name = "wit-parser" -version = "0.11.0" +version = "0.11.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "61e8b849bea13cc2315426b16efe6eb6813466d78f5fde69b0bb150c9c40e0dc" +checksum = "a39edca9abb16309def3843af73b58d47d243fe33a9ceee572446bcc57556b9a" dependencies = [ "anyhow", "id-arena", "indexmap 2.0.0", "log", - "pulldown-cmark 0.9.3", + "pulldown-cmark", "semver", + "serde", + "serde_json", "unicode-xid", "url", ] @@ -7962,8 +7840,7 @@ dependencies = [ [[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?rev=c796ce7376a57a40605f03e74bd78cefcc9acf3a#c796ce7376a57a40605f03e74bd78cefcc9acf3a" dependencies = [ "anyhow", "log", diff --git a/Cargo.toml b/Cargo.toml index 652a0156f0..3d93ebea2b 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -107,10 +107,14 @@ members = ["crates/*", "sdk/rust", "sdk/rust/macro"] [workspace.dependencies] tracing = { version = "0.1", features = ["log"] } -wasmtime-wasi = { version = "13.0.0", features = ["tokio"] } -wasi-common-preview1 = { version = "13.0.0", package = "wasi-common" } -wasmtime = { version = "13.0.0", features = ["component-model"] } -spin-componentize = { git = "https://github.com/fermyon/spin-componentize", rev = "f29cdb26a6b1700ae1fe48c94bbef26a8069d566" } +wasmtime-wasi = { git = "https://github.com/bytecodealliance/wasmtime", rev = "c796ce7376a57a40605f03e74bd78cefcc9acf3a", features = [ + "tokio", +] } +wasi-common-preview1 = { git = "https://github.com/bytecodealliance/wasmtime", rev = "c796ce7376a57a40605f03e74bd78cefcc9acf3a", package = "wasi-common" } +wasmtime = { git = "https://github.com/bytecodealliance/wasmtime", rev = "c796ce7376a57a40605f03e74bd78cefcc9acf3a", features = [ + "component-model", +] } +spin-componentize = { git = "https://github.com/fermyon/spin-componentize", rev = "84286054d632ccb8ae06c6419940b5d328229e59" } [[bin]] name = "spin" diff --git a/crates/config/src/host_component.rs b/crates/config/src/host_component.rs index 4a72d91b24..3c29364549 100644 --- a/crates/config/src/host_component.rs +++ b/crates/config/src/host_component.rs @@ -4,7 +4,7 @@ use anyhow::Result; use once_cell::sync::OnceCell; use spin_app::{AppComponent, DynamicHostComponent}; use spin_core::{async_trait, HostComponent}; -use spin_world::config; +use spin_world::v1::config; use crate::{Error, Key, Provider, Resolver}; diff --git a/crates/core/src/store.rs b/crates/core/src/store.rs index 50fe5a164c..9d2e2454b0 100644 --- a/crates/core/src/store.rs +++ b/crates/core/src/store.rs @@ -2,13 +2,15 @@ use anyhow::{anyhow, Result}; use std::{ io::{Read, Write}, path::{Path, PathBuf}, + sync::Mutex, time::{Duration, Instant}, }; use system_interface::io::ReadReady; use tokio::io::{AsyncRead, AsyncWrite}; 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::{self as wasi_preview2, StdinStream, StdoutStream}; +use wasmtime_wasi_preview1::preview2::{HostInputStream, HostOutputStream}; use crate::{ host_component::{HostComponents, HostComponentsData}, @@ -172,10 +174,9 @@ impl StoreBuilder { ctx.set_stdin(Box::new(wasi_preview1::pipe::ReadPipe::new(r))) } WasiCtxBuilder::Preview2(ctx) => { - ctx.stdin( + ctx.stdin(MyStdinStream(Mutex::new(Some(Box::new( wasi_preview2::pipe::AsyncReadStream::new(r), - wasi_preview2::IsATTY::No, - ); + ))))); } }) } @@ -212,10 +213,9 @@ impl StoreBuilder { ctx.set_stdout(Box::new(wasi_preview1::pipe::WritePipe::new(w))) } WasiCtxBuilder::Preview2(ctx) => { - ctx.stdout( + ctx.stdout(MyStdoutStream(Mutex::new(Some(Box::new( wasi_preview2::pipe::AsyncWriteStream::new(1024 * 1024, w), - wasi_preview2::IsATTY::No, - ); + ))))); } }) } @@ -230,7 +230,7 @@ impl StoreBuilder { "`Store::stdout_buffered` only supported with WASI Preview 2" )), WasiCtxBuilder::Preview2(ctx) => { - ctx.stdout(buffer.writer(), wasi_preview2::IsATTY::No); + ctx.stdout(MyStdoutStream(Mutex::new(Some(Box::new(buffer.writer()))))); Ok(()) } })?; @@ -256,10 +256,9 @@ impl StoreBuilder { ctx.set_stderr(Box::new(wasi_preview1::pipe::WritePipe::new(w))) } WasiCtxBuilder::Preview2(ctx) => { - ctx.stderr( + ctx.stderr(MyStdoutStream(Mutex::new(Some(Box::new( wasi_preview2::pipe::AsyncWriteStream::new(1024 * 1024, w), - wasi_preview2::IsATTY::No, - ); + ))))); } }) } @@ -364,8 +363,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 = wasi_preview2::Table::new(); - let wasi = self.wasi.map_err(anyhow::Error::msg)?.build(&mut table)?; + let wasi = self.wasi.map_err(anyhow::Error::msg)?.build(); let mut inner = wasmtime::Store::new( &self.engine, @@ -374,7 +372,7 @@ impl StoreBuilder { wasi, host_components_data: self.host_components_data, store_limits: self.store_limits, - table, + table: wasi_preview2::Table::new(), }, ); @@ -420,6 +418,38 @@ impl StoreBuilder { } } +struct MyStdinStream(Mutex>>); + +impl StdinStream for MyStdinStream { + fn stream(&self) -> Box { + self.0 + .lock() + .unwrap() + .take() + .expect("MyStdinStream::stream should only be called once") + } + + fn isatty(&self) -> bool { + false + } +} + +struct MyStdoutStream(Mutex>>); + +impl StdoutStream for MyStdoutStream { + fn stream(&self) -> Box { + self.0 + .lock() + .unwrap() + .take() + .expect("MyStdoutStream::stream should only be called once") + } + + fn isatty(&self) -> bool { + false + } +} + /// A builder of a `WasiCtx` for all versions of Wasi #[allow(clippy::large_enum_variant)] enum WasiCtxBuilder { @@ -439,10 +469,10 @@ impl From for WasiCtxBuilder { } impl WasiCtxBuilder { - fn build(self, table: &mut wasi_preview2::Table) -> anyhow::Result { + fn build(self) -> Wasi { match self { - WasiCtxBuilder::Preview1(ctx) => Ok(Wasi::Preview1(ctx)), - WasiCtxBuilder::Preview2(mut b) => b.build(table).map(Wasi::Preview2), + WasiCtxBuilder::Preview1(ctx) => Wasi::Preview1(ctx), + WasiCtxBuilder::Preview2(mut b) => Wasi::Preview2(b.build()), } } } diff --git a/crates/core/tests/core-wasi-test/Cargo.toml b/crates/core/tests/core-wasi-test/Cargo.toml index 675b7ccfa0..b67bea22c8 100644 --- a/crates/core/tests/core-wasi-test/Cargo.toml +++ b/crates/core/tests/core-wasi-test/Cargo.toml @@ -1,5 +1,5 @@ [package] -name = "core-wasi-test" +name = "core-wasi-test" version = "0.1.0" edition = "2021" @@ -7,6 +7,6 @@ edition = "2021" debug = true [dependencies] -wit-bindgen = "0.8" +wit-bindgen = { git = "https://github.com/bytecodealliance/wit-bindgen", rev = "46fba30bb667a3a4962f63b1cc28b84427b49114" } [workspace] diff --git a/crates/key-value-sqlite/src/lib.rs b/crates/key-value-sqlite/src/lib.rs index 954cfb1eb7..652d55ac72 100644 --- a/crates/key-value-sqlite/src/lib.rs +++ b/crates/key-value-sqlite/src/lib.rs @@ -144,8 +144,9 @@ impl Store for SqliteStore { #[cfg(test)] mod test { use super::*; + use spin_core::wasmtime::component::Resource; use spin_key_value::{DelegatingStoreManager, KeyValueDispatch}; - use spin_world::key_value::Host; + use spin_world::v2::key_value::HostStore; #[tokio::test(flavor = "multi_thread", worker_threads = 1)] async fn all() -> Result<()> { @@ -162,7 +163,7 @@ mod test { ); assert!(matches!( - kv.exists(42, "bar".to_owned()).await?, + kv.exists(Resource::new_own(42), "bar".to_owned()).await?, Err(Error::InvalidStore) )); @@ -176,41 +177,66 @@ mod test { )); let store = kv.open("default".to_owned()).await??; + let rep = store.rep(); - assert!(!kv.exists(store, "bar".to_owned()).await??); + assert!( + !kv.exists(Resource::new_own(rep), "bar".to_owned()) + .await?? + ); assert!(matches!( - kv.get(store, "bar".to_owned()).await?, + kv.get(Resource::new_own(rep), "bar".to_owned()).await?, Err(Error::NoSuchKey) )); - kv.set(store, "bar".to_owned(), b"baz".to_vec()).await??; + kv.set(Resource::new_own(rep), "bar".to_owned(), b"baz".to_vec()) + .await??; - assert!(kv.exists(store, "bar".to_owned()).await??); + assert!( + kv.exists(Resource::new_own(rep), "bar".to_owned()) + .await?? + ); - assert_eq!(b"baz" as &[_], &kv.get(store, "bar".to_owned()).await??); + assert_eq!( + b"baz" as &[_], + &kv.get(Resource::new_own(rep), "bar".to_owned()).await?? + ); - kv.set(store, "bar".to_owned(), b"wow".to_vec()).await??; + kv.set(Resource::new_own(rep), "bar".to_owned(), b"wow".to_vec()) + .await??; - assert_eq!(b"wow" as &[_], &kv.get(store, "bar".to_owned()).await??); + assert_eq!( + b"wow" as &[_], + &kv.get(Resource::new_own(rep), "bar".to_owned()).await?? + ); - assert_eq!(&["bar".to_owned()] as &[_], &kv.get_keys(store).await??); + assert_eq!( + &["bar".to_owned()] as &[_], + &kv.get_keys(Resource::new_own(rep)).await?? + ); - kv.delete(store, "bar".to_owned()).await??; + kv.delete(Resource::new_own(rep), "bar".to_owned()) + .await??; - assert!(!kv.exists(store, "bar".to_owned()).await??); + assert!( + !kv.exists(Resource::new_own(rep), "bar".to_owned()) + .await?? + ); - assert_eq!(&[] as &[String], &kv.get_keys(store).await??); + assert_eq!( + &[] as &[String], + &kv.get_keys(Resource::new_own(rep)).await?? + ); assert!(matches!( - kv.get(store, "bar".to_owned()).await?, + kv.get(Resource::new_own(rep), "bar".to_owned()).await?, Err(Error::NoSuchKey) )); - kv.close(store).await?; + kv.drop(Resource::new_own(rep))?; assert!(matches!( - kv.exists(store, "bar".to_owned()).await?, + kv.exists(Resource::new_own(rep), "bar".to_owned()).await?, Err(Error::InvalidStore) )); diff --git a/crates/key-value/src/host_component.rs b/crates/key-value/src/host_component.rs index 379ba78d09..2c16ea89db 100644 --- a/crates/key-value/src/host_component.rs +++ b/crates/key-value/src/host_component.rs @@ -102,3 +102,36 @@ impl DynamicHostComponent for KeyValueComponent { } } } + +pub struct LegacyKeyValueComponent(KeyValueComponent); + +impl LegacyKeyValueComponent { + pub fn new(new: KeyValueComponent) -> Self { + Self(new) + } +} + +impl HostComponent for LegacyKeyValueComponent { + type Data = KeyValueDispatch; + + fn add_to_linker( + linker: &mut spin_core::Linker, + get: impl Fn(&mut spin_core::Data) -> &mut Self::Data + Send + Sync + Copy + 'static, + ) -> anyhow::Result<()> { + spin_world::v1::key_value::add_to_linker(linker, get) + } + + fn build_data(&self) -> Self::Data { + self.0.build_data() + } +} + +impl DynamicHostComponent for LegacyKeyValueComponent { + fn update_data(&self, data: &mut Self::Data, component: &AppComponent) -> anyhow::Result<()> { + self.0.update_data(data, component) + } + + fn validate_app(&self, app: &spin_app::App) -> anyhow::Result<()> { + self.0.validate_app(app) + } +} diff --git a/crates/key-value/src/lib.rs b/crates/key-value/src/lib.rs index 0d307ef3e5..b61bb88c21 100644 --- a/crates/key-value/src/lib.rs +++ b/crates/key-value/src/lib.rs @@ -1,7 +1,7 @@ use anyhow::Result; use spin_app::MetadataKey; -use spin_core::async_trait; -use spin_world::key_value; +use spin_core::{async_trait, wasmtime::component::Resource}; +use spin_world::v2::key_value; use std::{collections::HashSet, sync::Arc}; use table::Table; @@ -9,14 +9,14 @@ mod host_component; pub mod table; mod util; -pub use host_component::{manager, KeyValueComponent}; +pub use host_component::{manager, KeyValueComponent, LegacyKeyValueComponent}; pub use util::{CachingStoreManager, DelegatingStoreManager, EmptyStoreManager}; pub const KEY_VALUE_STORES_KEY: MetadataKey> = MetadataKey::new("key_value_stores"); const DEFAULT_STORE_TABLE_CAPACITY: u32 = 256; -pub use key_value::{Error, Store as StoreHandle}; +pub use key_value::Error; #[async_trait] pub trait StoreManager: Sync + Send { @@ -27,13 +27,9 @@ pub trait StoreManager: Sync + Send { #[async_trait] pub trait Store: Sync + Send { async fn get(&self, key: &str) -> Result, Error>; - async fn set(&self, key: &str, value: &[u8]) -> Result<(), Error>; - async fn delete(&self, key: &str) -> Result<(), Error>; - async fn exists(&self, key: &str) -> Result; - async fn get_keys(&self) -> Result, Error>; } @@ -69,13 +65,18 @@ impl Default for KeyValueDispatch { } #[async_trait] -impl key_value::Host for KeyValueDispatch { - async fn open(&mut self, name: String) -> Result> { +impl key_value::Host for KeyValueDispatch {} + +#[async_trait] +impl key_value::HostStore for KeyValueDispatch { + async fn open(&mut self, name: String) -> Result, Error>> { Ok(async { if self.allowed_stores.contains(&name) { - self.stores + let store = self + .stores .push(self.manager.get(&name).await?) - .map_err(|()| Error::StoreTableFull) + .map_err(|()| Error::StoreTableFull)?; + Ok(Resource::new_own(store)) } else { Err(Error::AccessDenied) } @@ -83,10 +84,14 @@ impl key_value::Host for KeyValueDispatch { .await) } - async fn get(&mut self, store: StoreHandle, key: String) -> Result, Error>> { + async fn get( + &mut self, + store: Resource, + key: String, + ) -> Result, Error>> { Ok(async { self.stores - .get(store) + .get(store.rep()) .ok_or(Error::InvalidStore)? .get(&key) .await @@ -96,13 +101,13 @@ impl key_value::Host for KeyValueDispatch { async fn set( &mut self, - store: StoreHandle, + store: Resource, key: String, value: Vec, ) -> Result> { Ok(async { self.stores - .get(store) + .get(store.rep()) .ok_or(Error::InvalidStore)? .set(&key, &value) .await @@ -110,10 +115,14 @@ impl key_value::Host for KeyValueDispatch { .await) } - async fn delete(&mut self, store: StoreHandle, key: String) -> Result> { + async fn delete( + &mut self, + store: Resource, + key: String, + ) -> Result> { Ok(async { self.stores - .get(store) + .get(store.rep()) .ok_or(Error::InvalidStore)? .delete(&key) .await @@ -121,10 +130,14 @@ impl key_value::Host for KeyValueDispatch { .await) } - async fn exists(&mut self, store: StoreHandle, key: String) -> Result> { + async fn exists( + &mut self, + store: Resource, + key: String, + ) -> Result> { Ok(async { self.stores - .get(store) + .get(store.rep()) .ok_or(Error::InvalidStore)? .exists(&key) .await @@ -132,10 +145,13 @@ impl key_value::Host for KeyValueDispatch { .await) } - async fn get_keys(&mut self, store: StoreHandle) -> Result, Error>> { + async fn get_keys( + &mut self, + store: Resource, + ) -> Result, Error>> { Ok(async { self.stores - .get(store) + .get(store.rep()) .ok_or(Error::InvalidStore)? .get_keys() .await @@ -143,8 +159,8 @@ impl key_value::Host for KeyValueDispatch { .await) } - async fn close(&mut self, store: StoreHandle) -> Result<()> { - self.stores.remove(store); + fn drop(&mut self, store: Resource) -> Result<()> { + self.stores.remove(store.rep()); Ok(()) } } @@ -153,3 +169,64 @@ pub fn log_error(err: impl std::fmt::Debug) -> Error { tracing::warn!("key-value error: {err:?}"); Error::Io(format!("{err:?}")) } + +use spin_world::v1::key_value::Error as LegacyError; + +fn to_legacy_error(value: key_value::Error) -> LegacyError { + match value { + Error::StoreTableFull => LegacyError::StoreTableFull, + Error::NoSuchStore => LegacyError::NoSuchStore, + Error::AccessDenied => LegacyError::AccessDenied, + Error::InvalidStore => LegacyError::InvalidStore, + Error::NoSuchKey => LegacyError::NoSuchKey, + Error::Io(s) => LegacyError::Io(s), + } +} + +#[async_trait] +impl spin_world::v1::key_value::Host for KeyValueDispatch { + async fn open(&mut self, name: String) -> Result> { + let result = ::open(self, name).await?; + Ok(result.map_err(to_legacy_error).map(|s| s.rep())) + } + + async fn get(&mut self, store: u32, key: String) -> Result, LegacyError>> { + let this = Resource::new_borrow(store); + let result = ::get(self, this, key).await?; + Ok(result.map_err(to_legacy_error)) + } + + async fn set( + &mut self, + store: u32, + key: String, + value: Vec, + ) -> Result> { + let this = Resource::new_borrow(store); + let result = ::set(self, this, key, value).await?; + Ok(result.map_err(to_legacy_error)) + } + + async fn delete(&mut self, store: u32, key: String) -> Result> { + let this = Resource::new_borrow(store); + let result = ::delete(self, this, key).await?; + Ok(result.map_err(to_legacy_error)) + } + + async fn exists(&mut self, store: u32, key: String) -> Result> { + let this = Resource::new_borrow(store); + let result = ::exists(self, this, key).await?; + Ok(result.map_err(to_legacy_error)) + } + + async fn get_keys(&mut self, store: u32) -> Result, LegacyError>> { + let this = Resource::new_borrow(store); + let result = ::get_keys(self, this).await?; + Ok(result.map_err(to_legacy_error)) + } + + async fn close(&mut self, store: u32) -> Result<()> { + let this = Resource::new_borrow(store); + ::drop(self, this) + } +} diff --git a/crates/llm-local/src/lib.rs b/crates/llm-local/src/lib.rs index aa30102e24..aa9d1355b0 100644 --- a/crates/llm-local/src/lib.rs +++ b/crates/llm-local/src/lib.rs @@ -11,7 +11,7 @@ use llm::{ use rand::SeedableRng; use spin_core::async_trait; use spin_llm::{LlmEngine, MODEL_ALL_MINILM_L6_V2}; -use spin_world::llm::{self as wasi_llm}; +use spin_world::v1::llm::{self as wasi_llm}; use std::{ collections::hash_map::Entry, collections::HashMap, diff --git a/crates/llm-remote-http/src/lib.rs b/crates/llm-remote-http/src/lib.rs index 0cc12a3ca0..6110dc8979 100644 --- a/crates/llm-remote-http/src/lib.rs +++ b/crates/llm-remote-http/src/lib.rs @@ -7,7 +7,7 @@ use serde::{Deserialize, Serialize}; use serde_json::json; use spin_core::async_trait; use spin_llm::LlmEngine; -use spin_world::llm::{self as wasi_llm}; +use spin_world::v1::llm::{self as wasi_llm}; #[derive(Clone)] pub struct RemoteHttpLlmEngine { diff --git a/crates/llm/src/host_component.rs b/crates/llm/src/host_component.rs index 6696f79ea2..62d9476b0b 100644 --- a/crates/llm/src/host_component.rs +++ b/crates/llm/src/host_component.rs @@ -25,7 +25,7 @@ impl HostComponent for LlmComponent { linker: &mut spin_core::Linker, get: impl Fn(&mut spin_core::Data) -> &mut Self::Data + Send + Sync + Copy + 'static, ) -> anyhow::Result<()> { - spin_world::llm::add_to_linker(linker, get) + spin_world::v1::llm::add_to_linker(linker, get) } fn build_data(&self) -> Self::Data { diff --git a/crates/llm/src/lib.rs b/crates/llm/src/lib.rs index c948f3a95e..2d12769497 100644 --- a/crates/llm/src/lib.rs +++ b/crates/llm/src/lib.rs @@ -2,7 +2,7 @@ pub mod host_component; use spin_app::MetadataKey; use spin_core::async_trait; -use spin_world::llm::{self as wasi_llm}; +use spin_world::v1::llm::{self as wasi_llm}; use std::collections::HashSet; pub use crate::host_component::LlmComponent; diff --git a/crates/outbound-http/src/host_component.rs b/crates/outbound-http/src/host_component.rs index 61c262f3b1..9a8553244d 100644 --- a/crates/outbound-http/src/host_component.rs +++ b/crates/outbound-http/src/host_component.rs @@ -2,7 +2,7 @@ use anyhow::Result; use spin_app::DynamicHostComponent; use spin_core::{Data, HostComponent, Linker}; -use spin_world::http; +use spin_world::v1::http; use crate::{allowed_http_hosts::parse_allowed_http_hosts, OutboundHttp}; diff --git a/crates/outbound-http/src/lib.rs b/crates/outbound-http/src/lib.rs index a7e4ead421..1d63b3d2a6 100644 --- a/crates/outbound-http/src/lib.rs +++ b/crates/outbound-http/src/lib.rs @@ -6,7 +6,7 @@ use http::HeaderMap; use reqwest::{Client, Url}; use spin_app::MetadataKey; use spin_core::async_trait; -use spin_world::{ +use spin_world::v1::{ http as outbound_http, http_types::{Headers, HttpError, Method, Request, Response}, }; diff --git a/crates/outbound-mysql/src/lib.rs b/crates/outbound-mysql/src/lib.rs index 80f800edc9..9cd8322cdc 100644 --- a/crates/outbound-mysql/src/lib.rs +++ b/crates/outbound-mysql/src/lib.rs @@ -2,7 +2,7 @@ use anyhow::Result; pub use mysql::add_to_linker; use mysql_async::{consts::ColumnType, from_value_opt, prelude::*, Opts, OptsBuilder, SslOpts}; use spin_core::{async_trait, HostComponent}; -use spin_world::{ +use spin_world::v1::{ mysql::{self, MysqlError}, rdbms_types::{Column, DbDataType, DbValue, ParameterValue, RowSet}, }; diff --git a/crates/outbound-pg/src/lib.rs b/crates/outbound-pg/src/lib.rs index 45d805e4a0..f2a7013a3f 100644 --- a/crates/outbound-pg/src/lib.rs +++ b/crates/outbound-pg/src/lib.rs @@ -2,7 +2,7 @@ use anyhow::{anyhow, Result}; use native_tls::TlsConnector; use postgres_native_tls::MakeTlsConnector; use spin_core::{async_trait, HostComponent}; -use spin_world::{ +use spin_world::v1::{ postgres::{self, PgError}, rdbms_types::{Column, DbDataType, DbValue, ParameterValue, RowSet}, }; diff --git a/crates/outbound-redis/src/lib.rs b/crates/outbound-redis/src/lib.rs index 27e7b93048..8ccbe1b38a 100644 --- a/crates/outbound-redis/src/lib.rs +++ b/crates/outbound-redis/src/lib.rs @@ -5,7 +5,7 @@ use std::collections::{hash_map::Entry, HashMap}; use anyhow::Result; use redis::{aio::Connection, AsyncCommands, FromRedisValue, Value}; use spin_core::async_trait; -use spin_world::{ +use spin_world::v1::{ redis as outbound_redis, redis_types::{Error, RedisParameter, RedisResult}, }; diff --git a/crates/redis/src/spin.rs b/crates/redis/src/spin.rs index fbeeb456cd..b9ad4eb384 100644 --- a/crates/redis/src/spin.rs +++ b/crates/redis/src/spin.rs @@ -2,7 +2,7 @@ use anyhow::{anyhow, Result}; use async_trait::async_trait; use spin_core::Instance; use spin_trigger::{EitherInstance, TriggerAppEngine}; -use spin_world::redis_types::{Error, Payload}; +use spin_world::v1::redis_types::{Error, Payload}; use crate::{RedisExecutor, RedisTrigger, Store}; diff --git a/crates/redis/tests/rust/Cargo.lock b/crates/redis/tests/rust/Cargo.lock index 70b7cc2eeb..47b9ba52e1 100644 --- a/crates/redis/tests/rust/Cargo.lock +++ b/crates/redis/tests/rust/Cargo.lock @@ -4,15 +4,9 @@ version = 3 [[package]] name = "anyhow" -version = "1.0.71" +version = "1.0.75" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c7d0618f0e0b7e8ff11427422b64564d5fb0be1940354bfe2e0529b18a9d9b8" - -[[package]] -name = "autocfg" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" +checksum = "a4668cab20f66d8d020e1fbc0ebe47217433c1b6c8f2040faf858554e394ace6" [[package]] name = "bitflags" @@ -22,9 +16,15 @@ checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" [[package]] name = "bitflags" -version = "2.3.2" +version = "2.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b4682ae6287fcf752ecaabbfcc7b6f9b72aa33933dc23a554d853aea8eea8635" + +[[package]] +name = "equivalent" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6dbe3c979c178231552ecba20214a8272df4e09f232a87aef4320cf06539aded" +checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" [[package]] name = "form_urlencoded" @@ -37,9 +37,9 @@ dependencies = [ [[package]] name = "hashbrown" -version = "0.12.3" +version = "0.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" +checksum = "2c6201b9ff9fd90a5a3bac2e56a830d0caa509576f0e503818ee82c181b3437a" [[package]] name = "heck" @@ -68,15 +68,21 @@ dependencies = [ [[package]] name = "indexmap" -version = "1.9.3" +version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bd070e393353796e801d209ad339e89596eb4c8d430d18ede6a1cced8fafbd99" +checksum = "d5477fe2230a79769d8dc68e0eabf5437907c0457a5614a9e8dddb67f65eb65d" dependencies = [ - "autocfg", + "equivalent", "hashbrown", "serde", ] +[[package]] +name = "itoa" +version = "1.0.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "af150ab688ff2122fcef229be89cb50dd66af9e01a4ff320cc137eecc9bacc38" + [[package]] name = "leb128" version = "0.2.5" @@ -91,9 +97,9 @@ checksum = "b06a4cde4c0f271a446782e3eff8de789548ce57dbc8eca9292c27f4a42004b4" [[package]] name = "memchr" -version = "2.4.1" +version = "2.6.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "308cc39be01b73d0d18f82a0e7b2a3df85245f84af96fdddc5d202d27e47b86a" +checksum = "8f232d6ef707e1956a43342693d2a31e72989554d58299d7a88738cc95b0d35c" [[package]] name = "percent-encoding" @@ -103,18 +109,18 @@ checksum = "9b2a4787296e9989611394c33f193f676704af1686e70b8f8033ab5ba9a35a94" [[package]] name = "proc-macro2" -version = "1.0.60" +version = "1.0.67" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dec2b086b7a862cf4de201096214fa870344cf922b2b30c167badb3af3195406" +checksum = "3d433d9f1a3e8c1263d9456598b16fec66f4acc9a74dacffd35c7bb09b3a1328" dependencies = [ "unicode-ident", ] [[package]] name = "pulldown-cmark" -version = "0.8.0" +version = "0.9.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ffade02495f22453cd593159ea2f59827aae7f53fa8323f756799b670881dcf8" +checksum = "77a1a2f1f0a7ecff9c31abbe177637be0e97a0aef46cf8738ece09327985d998" dependencies = [ "bitflags 1.3.2", "memchr", @@ -137,6 +143,12 @@ dependencies = [ "wit-bindgen", ] +[[package]] +name = "ryu" +version = "1.0.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1ad4cc8da4ef723ed60bced201181d83791ad433213d8c24efffda1eec85d741" + [[package]] name = "semver" version = "1.0.17" @@ -145,29 +157,55 @@ checksum = "bebd363326d05ec3e2f532ab7660680f3b02130d780c299bca73469d521bc0ed" [[package]] name = "serde" -version = "1.0.164" +version = "1.0.188" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9e8c8cf938e98f769bc164923b06dce91cea1751522f46f8466461af04c9027d" +checksum = "cf9e0fcba69a370eed61bcf2b728575f726b50b55cba78064753d708ddc7549e" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.164" +version = "1.0.188" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d9735b638ccc51c28bf6914d90a2e9725b377144fc612c49a611fddd1b631d68" +checksum = "4eca7ac642d82aa35b60049a6eccb4be6be75e599bd2e9adb5f875a737654af2" dependencies = [ "proc-macro2", "quote", "syn", ] +[[package]] +name = "serde_json" +version = "1.0.107" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6b420ce6e3d8bd882e9b243c6eed35dbc9a6110c9769e74b584e0d68d1f20c65" +dependencies = [ + "itoa", + "ryu", + "serde", +] + +[[package]] +name = "smallvec" +version = "1.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "62bb4feee49fdd9f707ef802e22365a35de4b7b299de4763d44bfea899442ff9" + +[[package]] +name = "spdx" +version = "0.10.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b19b32ed6d899ab23174302ff105c1577e45a06b08d4fe0a9dd13ce804bbbf71" +dependencies = [ + "smallvec", +] + [[package]] name = "syn" -version = "2.0.18" +version = "2.0.37" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "32d41677bcbe24c20c52e7c70b0d8db04134c5d1066bf98662e2871ad200ea3e" +checksum = "7303ef2c05cd654186cb250d29049a24840ca25d2747c25c0381c8d9e2f582e8" dependencies = [ "proc-macro2", "quote", @@ -250,31 +288,33 @@ checksum = "5fecdca9a5291cc2b8dcf7dc02453fee791a280f3743cb0905f8822ae463b3fe" [[package]] name = "wasm-encoder" -version = "0.29.0" +version = "0.33.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "18c41dbd92eaebf3612a39be316540b8377c871cb9bde6b064af962984912881" +checksum = "34180c89672b3e4825c3a8db4b61a674f1447afd5fe2445b2d22c3d8b6ea086c" dependencies = [ "leb128", ] [[package]] name = "wasm-metadata" -version = "0.8.0" +version = "0.10.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "36e5156581ff4a302405c44ca7c85347563ca431d15f1a773f12c9c7b9a6cdc9" +checksum = "4f2c051ef041d348324b01ff0419f6f6593f094b4897d93c9cf52d5d1ac879ba" dependencies = [ "anyhow", "indexmap", "serde", + "serde_json", + "spdx", "wasm-encoder", "wasmparser", ] [[package]] name = "wasmparser" -version = "0.107.0" +version = "0.113.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "29e3ac9b780c7dda0cac7a52a5d6d2d6707cc6e3451c9db209b6c758f40d7acb" +checksum = "286049849b5a5bd09a8773171be96824afabffc7cc3df6caaf33a38db6cd07ae" dependencies = [ "indexmap", "semver", @@ -282,19 +322,17 @@ dependencies = [ [[package]] name = "wit-bindgen" -version = "0.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "392d16e9e46cc7ca98125bc288dd5e4db469efe8323d3e0dac815ca7f2398522" +version = "0.12.0" +source = "git+https://github.com/bytecodealliance/wit-bindgen?rev=46fba30bb667a3a4962f63b1cc28b84427b49114#46fba30bb667a3a4962f63b1cc28b84427b49114" dependencies = [ - "bitflags 2.3.2", + "bitflags 2.4.0", "wit-bindgen-rust-macro", ] [[package]] name = "wit-bindgen-core" -version = "0.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d422d36cbd78caa0e18c3371628447807c66ee72466b69865ea7e33682598158" +version = "0.12.0" +source = "git+https://github.com/bytecodealliance/wit-bindgen?rev=46fba30bb667a3a4962f63b1cc28b84427b49114#46fba30bb667a3a4962f63b1cc28b84427b49114" dependencies = [ "anyhow", "wit-component", @@ -303,35 +341,24 @@ dependencies = [ [[package]] name = "wit-bindgen-rust" -version = "0.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b76db68264f5d2089dc4652581236d8e75c5b89338de6187716215fd0e68ba3" +version = "0.12.0" +source = "git+https://github.com/bytecodealliance/wit-bindgen?rev=46fba30bb667a3a4962f63b1cc28b84427b49114#46fba30bb667a3a4962f63b1cc28b84427b49114" dependencies = [ + "anyhow", "heck", "wasm-metadata", "wit-bindgen-core", - "wit-bindgen-rust-lib", "wit-component", ] -[[package]] -name = "wit-bindgen-rust-lib" -version = "0.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1c50f334bc08b0903a43387f6eea6ef6aa9eb2a085729f1677b29992ecef20ba" -dependencies = [ - "heck", - "wit-bindgen-core", -] - [[package]] name = "wit-bindgen-rust-macro" -version = "0.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ced38a5e174940c6a41ae587babeadfd2e2c2dc32f3b6488bcdca0e8922cf3f3" +version = "0.12.0" +source = "git+https://github.com/bytecodealliance/wit-bindgen?rev=46fba30bb667a3a4962f63b1cc28b84427b49114#46fba30bb667a3a4962f63b1cc28b84427b49114" dependencies = [ "anyhow", "proc-macro2", + "quote", "syn", "wit-bindgen-core", "wit-bindgen-rust", @@ -340,14 +367,16 @@ dependencies = [ [[package]] name = "wit-component" -version = "0.11.0" +version = "0.14.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7cbd4c7f8f400327c482c88571f373844b7889e61460650d650fc5881bb3575c" +checksum = "2e2bf941487fc5afa9e3fc94761f6b80ecef5a2bed6239b959d23d9de69e3448" dependencies = [ "anyhow", - "bitflags 1.3.2", + "bitflags 2.4.0", "indexmap", "log", + "serde", + "serde_json", "wasm-encoder", "wasm-metadata", "wasmparser", @@ -356,9 +385,9 @@ dependencies = [ [[package]] name = "wit-parser" -version = "0.8.0" +version = "0.11.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6daec9f093dbaea0e94043eeb92ece327bbbe70c86b1f41aca9bbfefd7f050f0" +checksum = "a39edca9abb16309def3843af73b58d47d243fe33a9ceee572446bcc57556b9a" dependencies = [ "anyhow", "id-arena", @@ -366,6 +395,8 @@ dependencies = [ "log", "pulldown-cmark", "semver", + "serde", + "serde_json", "unicode-xid", "url", ] diff --git a/crates/redis/tests/rust/Cargo.toml b/crates/redis/tests/rust/Cargo.toml index 162b516f46..e039c6627f 100644 --- a/crates/redis/tests/rust/Cargo.toml +++ b/crates/redis/tests/rust/Cargo.toml @@ -1,13 +1,13 @@ [package] -name = "rust" +name = "rust" version = "0.1.0" edition = "2021" -authors = [ "Radu Matei " ] +authors = ["Radu Matei "] [lib] -crate-type = [ "cdylib" ] +crate-type = ["cdylib"] [dependencies] -wit-bindgen = "0.8" +wit-bindgen = { git = "https://github.com/bytecodealliance/wit-bindgen", rev = "46fba30bb667a3a4962f63b1cc28b84427b49114" } [workspace] diff --git a/crates/redis/tests/rust/src/lib.rs b/crates/redis/tests/rust/src/lib.rs index 618e9d5dc5..15ced0c092 100644 --- a/crates/redis/tests/rust/src/lib.rs +++ b/crates/redis/tests/rust/src/lib.rs @@ -1,12 +1,17 @@ use std::str::{from_utf8, Utf8Error}; -wit_bindgen::generate!("redis-trigger" in "../../../../wit/preview2"); +wit_bindgen::generate!({ + world: "redis-trigger", + path: "../../../../wit/preview2", + exports: { + "fermyon:spin/inbound-redis": SpinRedis, + } +}); use exports::fermyon::spin::inbound_redis::{self, Error, Payload}; struct SpinRedis; -export_redis_trigger!(SpinRedis); -impl inbound_redis::InboundRedis for SpinRedis { +impl inbound_redis::Guest for SpinRedis { fn handle_message(message: Payload) -> Result<(), Error> { println!("Message: {:?}", from_utf8(&message)); Ok(()) diff --git a/crates/sqlite-inproc/src/lib.rs b/crates/sqlite-inproc/src/lib.rs index aca57c1b01..cd79f580e4 100644 --- a/crates/sqlite-inproc/src/lib.rs +++ b/crates/sqlite-inproc/src/lib.rs @@ -7,6 +7,7 @@ use anyhow::Context; use async_trait::async_trait; use once_cell::sync::OnceCell; use spin_sqlite::Connection; +use spin_world::v2::sqlite; #[derive(Debug, Clone)] pub enum InProcDatabaseLocation { @@ -21,7 +22,7 @@ pub struct InProcConnection { } impl InProcConnection { - pub fn new(location: InProcDatabaseLocation) -> Result { + pub fn new(location: InProcDatabaseLocation) -> Result { let connection = OnceCell::new(); Ok(Self { location, @@ -29,16 +30,14 @@ impl InProcConnection { }) } - pub fn db_connection( - &self, - ) -> Result>, spin_world::sqlite::Error> { + pub fn db_connection(&self) -> Result>, sqlite::Error> { self.connection .get_or_try_init(|| { match &self.location { InProcDatabaseLocation::InMemory => rusqlite::Connection::open_in_memory(), InProcDatabaseLocation::Path(path) => rusqlite::Connection::open(path), } - .map_err(|e| spin_world::sqlite::Error::Io(e.to_string())) + .map_err(|e| sqlite::Error::Io(e.to_string())) .map(|c| Arc::new(Mutex::new(c))) }) .cloned() @@ -50,15 +49,15 @@ impl Connection for InProcConnection { async fn query( &self, query: &str, - parameters: Vec, - ) -> Result { + parameters: Vec, + ) -> Result { let connection = self.db_connection()?; let query = query.to_owned(); // Tell the tokio runtime that we're going to block while making the query tokio::task::spawn_blocking(move || execute_query(&connection, &query, parameters)) .await .context("internal runtime error") - .map_err(|e| spin_world::sqlite::Error::Io(e.to_string()))? + .map_err(|e| sqlite::Error::Io(e.to_string()))? } async fn execute_batch(&self, statements: &str) -> anyhow::Result<()> { @@ -78,12 +77,12 @@ impl Connection for InProcConnection { fn execute_query( connection: &Mutex, query: &str, - parameters: Vec, -) -> Result { + parameters: Vec, +) -> Result { let conn = connection.lock().unwrap(); let mut statement = conn .prepare_cached(query) - .map_err(|e| spin_world::sqlite::Error::Io(e.to_string()))?; + .map_err(|e| sqlite::Error::Io(e.to_string()))?; let columns = statement .column_names() .into_iter() @@ -102,42 +101,42 @@ fn execute_query( let value = value?.0; values.push(value); } - Ok(spin_world::sqlite::RowResult { values }) + Ok(sqlite::RowResult { values }) }, ) - .map_err(|e| spin_world::sqlite::Error::Io(e.to_string()))?; + .map_err(|e| sqlite::Error::Io(e.to_string()))?; let rows = rows .into_iter() - .map(|r| r.map_err(|e| spin_world::sqlite::Error::Io(e.to_string()))) - .collect::>()?; - Ok(spin_world::sqlite::QueryResult { columns, rows }) + .map(|r| r.map_err(|e| sqlite::Error::Io(e.to_string()))) + .collect::>()?; + Ok(sqlite::QueryResult { columns, rows }) } fn convert_data( - arguments: impl Iterator, + arguments: impl Iterator, ) -> impl Iterator { arguments.map(|a| match a { - spin_world::sqlite::Value::Null => rusqlite::types::Value::Null, - spin_world::sqlite::Value::Integer(i) => rusqlite::types::Value::Integer(i), - spin_world::sqlite::Value::Real(r) => rusqlite::types::Value::Real(r), - spin_world::sqlite::Value::Text(t) => rusqlite::types::Value::Text(t), - spin_world::sqlite::Value::Blob(b) => rusqlite::types::Value::Blob(b), + sqlite::Value::Null => rusqlite::types::Value::Null, + sqlite::Value::Integer(i) => rusqlite::types::Value::Integer(i), + sqlite::Value::Real(r) => rusqlite::types::Value::Real(r), + sqlite::Value::Text(t) => rusqlite::types::Value::Text(t), + sqlite::Value::Blob(b) => rusqlite::types::Value::Blob(b), }) } -// A wrapper around spin_world::sqlite::Value so that we can convert from rusqlite ValueRef -struct ValueWrapper(spin_world::sqlite::Value); +// A wrapper around sqlite::Value so that we can convert from rusqlite ValueRef +struct ValueWrapper(sqlite::Value); impl rusqlite::types::FromSql for ValueWrapper { fn column_result(value: rusqlite::types::ValueRef<'_>) -> rusqlite::types::FromSqlResult { let value = match value { - rusqlite::types::ValueRef::Null => spin_world::sqlite::Value::Null, - rusqlite::types::ValueRef::Integer(i) => spin_world::sqlite::Value::Integer(i), - rusqlite::types::ValueRef::Real(f) => spin_world::sqlite::Value::Real(f), + rusqlite::types::ValueRef::Null => sqlite::Value::Null, + rusqlite::types::ValueRef::Integer(i) => sqlite::Value::Integer(i), + rusqlite::types::ValueRef::Real(f) => sqlite::Value::Real(f), rusqlite::types::ValueRef::Text(t) => { - spin_world::sqlite::Value::Text(String::from_utf8(t.to_vec()).unwrap()) + sqlite::Value::Text(String::from_utf8(t.to_vec()).unwrap()) } - rusqlite::types::ValueRef::Blob(b) => spin_world::sqlite::Value::Blob(b.to_vec()), + rusqlite::types::ValueRef::Blob(b) => sqlite::Value::Blob(b.to_vec()), }; Ok(ValueWrapper(value)) } diff --git a/crates/sqlite-libsql/src/lib.rs b/crates/sqlite-libsql/src/lib.rs index 76539a6a21..cc056bc3e3 100644 --- a/crates/sqlite-libsql/src/lib.rs +++ b/crates/sqlite-libsql/src/lib.rs @@ -1,6 +1,6 @@ mod split; -use spin_world::sqlite::{self, RowResult}; +use spin_world::v2::sqlite::{self, RowResult}; #[derive(Clone)] pub struct LibsqlClient { diff --git a/crates/sqlite/src/host_component.rs b/crates/sqlite/src/host_component.rs index 2bb3cd5ddd..1750a24499 100644 --- a/crates/sqlite/src/host_component.rs +++ b/crates/sqlite/src/host_component.rs @@ -4,7 +4,7 @@ use crate::{ConnectionsStore, SqliteDispatch, DATABASES_KEY}; use anyhow::anyhow; use spin_app::{AppComponent, DynamicHostComponent}; use spin_core::HostComponent; -use spin_world::sqlite; +use spin_world::v2::sqlite; type InitConnectionsStore = dyn (Fn(&AppComponent) -> Arc) + Sync + Send; @@ -44,8 +44,7 @@ impl HostComponent for SqliteComponent { async fn get_connection( &self, _database: &str, - ) -> Result>, spin_world::sqlite::Error> - { + ) -> Result>, sqlite::Error> { debug_assert!(false, "`Noop` `ConnectionsStore` was called"); Ok(None) } @@ -99,3 +98,36 @@ impl DynamicHostComponent for SqliteComponent { } } } + +pub struct LegacySqliteComponent(SqliteComponent); + +impl LegacySqliteComponent { + pub fn new(new: SqliteComponent) -> Self { + Self(new) + } +} + +impl HostComponent for LegacySqliteComponent { + type Data = super::SqliteDispatch; + + fn add_to_linker( + linker: &mut spin_core::Linker, + get: impl Fn(&mut spin_core::Data) -> &mut Self::Data + Send + Sync + Copy + 'static, + ) -> anyhow::Result<()> { + spin_world::v1::sqlite::add_to_linker(linker, get) + } + + fn build_data(&self) -> Self::Data { + self.0.build_data() + } +} + +impl DynamicHostComponent for LegacySqliteComponent { + fn update_data(&self, data: &mut Self::Data, component: &AppComponent) -> anyhow::Result<()> { + self.0.update_data(data, component) + } + + fn validate_app(&self, app: &spin_app::App) -> anyhow::Result<()> { + self.0.validate_app(app) + } +} diff --git a/crates/sqlite/src/lib.rs b/crates/sqlite/src/lib.rs index d61980908d..6edf3ff435 100644 --- a/crates/sqlite/src/lib.rs +++ b/crates/sqlite/src/lib.rs @@ -1,10 +1,12 @@ mod host_component; use spin_app::{async_trait, MetadataKey}; +use spin_core::wasmtime::component::Resource; use spin_key_value::table; +use spin_world::v2::sqlite; use std::{collections::HashSet, sync::Arc}; -pub use host_component::SqliteComponent; +pub use host_component::{LegacySqliteComponent, SqliteComponent}; pub const DATABASES_KEY: MetadataKey> = MetadataKey::new("databases"); @@ -15,7 +17,7 @@ pub trait ConnectionsStore: Send + Sync { async fn get_connection( &self, database: &str, - ) -> Result>, spin_world::sqlite::Error>; + ) -> Result>, sqlite::Error>; fn has_connection_for(&self, database: &str) -> bool; } @@ -26,8 +28,8 @@ pub trait Connection: Send + Sync { async fn query( &self, query: &str, - parameters: Vec, - ) -> Result; + parameters: Vec, + ) -> Result; async fn execute_batch(&self, statements: &str) -> anyhow::Result<()>; } @@ -60,41 +62,45 @@ impl SqliteDispatch { fn get_connection( &self, - connection: spin_world::sqlite::Connection, - ) -> Result<&Arc, spin_world::sqlite::Error> { + connection: Resource, + ) -> Result<&Arc, sqlite::Error> { self.connections - .get(connection) - .ok_or(spin_world::sqlite::Error::InvalidConnection) + .get(connection.rep()) + .ok_or(sqlite::Error::InvalidConnection) } } #[async_trait] -impl spin_world::sqlite::Host for SqliteDispatch { +impl sqlite::Host for SqliteDispatch {} + +#[async_trait] +impl sqlite::HostConnection for SqliteDispatch { async fn open( &mut self, database: String, - ) -> anyhow::Result> { + ) -> anyhow::Result, sqlite::Error>> { if !self.allowed_databases.contains(&database) { - return Ok(Err(spin_world::sqlite::Error::AccessDenied)); + return Ok(Err(sqlite::Error::AccessDenied)); } Ok(self .connections_store .get_connection(&database) .await - .and_then(|conn| conn.ok_or(spin_world::sqlite::Error::NoSuchDatabase)) + .and_then(|conn| conn.ok_or(sqlite::Error::NoSuchDatabase)) .and_then(|conn| { - self.connections.push(conn).map_err(|()| { - spin_world::sqlite::Error::Io("too many connections opened".to_string()) - }) - })) + self.connections + .push(conn) + .map_err(|()| sqlite::Error::Io("too many connections opened".to_string())) + }) + .map(Resource::new_own)) } async fn execute( &mut self, - connection: spin_world::sqlite::Connection, + connection: Resource, query: String, - parameters: Vec, - ) -> anyhow::Result> { + parameters: Vec, + ) -> anyhow::Result> { let conn = match self.get_connection(connection) { Ok(c) => c, Err(err) => return Ok(Err(err)), @@ -102,8 +108,85 @@ impl spin_world::sqlite::Host for SqliteDispatch { Ok(conn.query(&query, parameters).await) } - async fn close(&mut self, connection: spin_world::sqlite::Connection) -> anyhow::Result<()> { - let _ = self.connections.remove(connection); + fn drop(&mut self, connection: Resource) -> anyhow::Result<()> { + let _ = self.connections.remove(connection.rep()); Ok(()) } } + +#[async_trait] +impl spin_world::v1::sqlite::Host for SqliteDispatch { + async fn open( + &mut self, + database: String, + ) -> anyhow::Result> { + let result = ::open(self, database).await?; + Ok(result.map_err(to_legacy_error).map(|s| s.rep())) + } + + async fn execute( + &mut self, + connection: u32, + query: String, + parameters: Vec, + ) -> anyhow::Result> + { + let this = Resource::new_borrow(connection); + let result = ::execute( + self, + this, + query, + parameters.into_iter().map(from_legacy_value).collect(), + ) + .await?; + Ok(result.map_err(to_legacy_error).map(to_legacy_query_result)) + } + + async fn close(&mut self, connection: u32) -> anyhow::Result<()> { + ::drop(self, Resource::new_own(connection)) + } +} +use spin_world::v1::sqlite as v1; + +fn to_legacy_error(error: sqlite::Error) -> v1::Error { + match error { + sqlite::Error::NoSuchDatabase => v1::Error::NoSuchDatabase, + sqlite::Error::AccessDenied => v1::Error::AccessDenied, + sqlite::Error::InvalidConnection => v1::Error::InvalidConnection, + sqlite::Error::DatabaseFull => v1::Error::DatabaseFull, + sqlite::Error::Io(s) => v1::Error::Io(s), + } +} + +fn to_legacy_query_result(result: sqlite::QueryResult) -> v1::QueryResult { + v1::QueryResult { + columns: result.columns, + rows: result.rows.into_iter().map(to_legacy_row_result).collect(), + } +} + +fn to_legacy_row_result(result: sqlite::RowResult) -> v1::RowResult { + v1::RowResult { + values: result.values.into_iter().map(to_legacy_value).collect(), + } +} + +fn to_legacy_value(value: sqlite::Value) -> v1::Value { + match value { + sqlite::Value::Integer(i) => v1::Value::Integer(i), + sqlite::Value::Real(r) => v1::Value::Real(r), + sqlite::Value::Text(t) => v1::Value::Text(t), + sqlite::Value::Blob(b) => v1::Value::Blob(b), + sqlite::Value::Null => v1::Value::Null, + } +} + +fn from_legacy_value(value: v1::Value) -> sqlite::Value { + match value { + v1::Value::Integer(i) => sqlite::Value::Integer(i), + v1::Value::Real(r) => sqlite::Value::Real(r), + v1::Value::Text(t) => sqlite::Value::Text(t), + v1::Value::Blob(b) => sqlite::Value::Blob(b), + v1::Value::Null => sqlite::Value::Null, + } +} diff --git a/crates/trigger-http/benches/spin-http-benchmark/Cargo.toml b/crates/trigger-http/benches/spin-http-benchmark/Cargo.toml index 6b697754f6..cd7133b77e 100644 --- a/crates/trigger-http/benches/spin-http-benchmark/Cargo.toml +++ b/crates/trigger-http/benches/spin-http-benchmark/Cargo.toml @@ -1,13 +1,13 @@ [package] -name = "spin-http-benchmark" +name = "spin-http-benchmark" version = "0.2.0" edition = "2021" [lib] -crate-type = [ "cdylib" ] +crate-type = ["cdylib"] [dependencies] -wit-bindgen = "0.8" +wit-bindgen = { git = "https://github.com/bytecodealliance/wit-bindgen", rev = "46fba30bb667a3a4962f63b1cc28b84427b49114" } url = "2.4.1" [workspace] diff --git a/crates/trigger-http/benches/spin-http-benchmark/src/lib.rs b/crates/trigger-http/benches/spin-http-benchmark/src/lib.rs index 219857c07b..4c37e3d27f 100644 --- a/crates/trigger-http/benches/spin-http-benchmark/src/lib.rs +++ b/crates/trigger-http/benches/spin-http-benchmark/src/lib.rs @@ -1,11 +1,16 @@ -wit_bindgen::generate!("http-trigger" in "../../../../wit/preview2"); +wit_bindgen::generate!({ + world: "http-trigger", + path: "../../../../wit/preview2", + exports: { + "fermyon:spin/inbound-http": SpinHttp, + } +}); use exports::fermyon::spin::inbound_http; struct SpinHttp; -export_http_trigger!(SpinHttp); -impl inbound_http::InboundHttp for SpinHttp { +impl inbound_http::Guest for SpinHttp { fn handle_request(req: inbound_http::Request) -> inbound_http::Response { let params = req.uri.find('?').map(|i| &req.uri[i + 1..]).unwrap_or(""); for (key, value) in url::form_urlencoded::parse(params.as_bytes()) { diff --git a/crates/trigger-http/src/spin.rs b/crates/trigger-http/src/spin.rs index abb383ecc9..f4f1bfaa57 100644 --- a/crates/trigger-http/src/spin.rs +++ b/crates/trigger-http/src/spin.rs @@ -7,7 +7,7 @@ use hyper::{Body, Request, Response}; use outbound_http::OutboundHttpComponent; use spin_core::Instance; use spin_trigger::{EitherInstance, TriggerAppEngine}; -use spin_world::http_types; +use spin_world::v1::http_types; use std::sync::Arc; #[derive(Clone)] diff --git a/crates/trigger-http/tests/rust-http-test/Cargo.toml b/crates/trigger-http/tests/rust-http-test/Cargo.toml index 8e19e76335..d4b7960ff5 100644 --- a/crates/trigger-http/tests/rust-http-test/Cargo.toml +++ b/crates/trigger-http/tests/rust-http-test/Cargo.toml @@ -1,13 +1,13 @@ [package] -name = "rust-http-test" +name = "rust-http-test" version = "0.1.0" edition = "2021" -authors = [ "Radu Matei " ] +authors = ["Radu Matei "] [lib] -crate-type = [ "cdylib" ] +crate-type = ["cdylib"] [dependencies] -wit-bindgen = "0.8" +wit-bindgen = { git = "https://github.com/bytecodealliance/wit-bindgen", rev = "46fba30bb667a3a4962f63b1cc28b84427b49114" } [workspace] diff --git a/crates/trigger-http/tests/rust-http-test/src/lib.rs b/crates/trigger-http/tests/rust-http-test/src/lib.rs index 370e33897e..5d0e21b7ea 100644 --- a/crates/trigger-http/tests/rust-http-test/src/lib.rs +++ b/crates/trigger-http/tests/rust-http-test/src/lib.rs @@ -1,11 +1,16 @@ -wit_bindgen::generate!("http-trigger" in "../../../../wit/preview2"); +wit_bindgen::generate!({ + world: "http-trigger", + path: "../../../../wit/preview2", + exports: { + "fermyon:spin/inbound-http": SpinHttp, + } +}); use exports::fermyon::spin::inbound_http::{self, Request, Response}; struct SpinHttp; -export_http_trigger!(SpinHttp); -impl inbound_http::InboundHttp for SpinHttp { +impl inbound_http::Guest for SpinHttp { fn handle_request(req: Request) -> Response { assert!(req.params.is_empty()); assert!(req.uri.contains("?abc=def")); diff --git a/crates/trigger/Cargo.toml b/crates/trigger/Cargo.toml index 39da32c37d..d9acdfae2c 100644 --- a/crates/trigger/Cargo.toml +++ b/crates/trigger/Cargo.toml @@ -59,4 +59,4 @@ tokio = { version = "1.23", features = ["rt", "macros"] } [[test]] name = "ui" path = "tests/ui.rs" -harness = false \ No newline at end of file +harness = false diff --git a/crates/trigger/src/lib.rs b/crates/trigger/src/lib.rs index 125f31ecd8..7ac513ba12 100644 --- a/crates/trigger/src/lib.rs +++ b/crates/trigger/src/lib.rs @@ -128,11 +128,23 @@ impl TriggerExecutorBuilder { ) .await?, )?; + self.loader.add_dynamic_host_component( + &mut builder, + runtime_config::key_value::build_legacy_key_value_component( + &runtime_config, + &init_data.kv, + ) + .await?, + )?; self.loader.add_dynamic_host_component( &mut builder, runtime_config::sqlite::build_component(&runtime_config, &init_data.sqlite) .await?, )?; + self.loader.add_dynamic_host_component( + &mut builder, + runtime_config::sqlite::build_legacy_component(&runtime_config).await?, + )?; self.loader.add_dynamic_host_component( &mut builder, outbound_http::OutboundHttpComponent, diff --git a/crates/trigger/src/loader.rs b/crates/trigger/src/loader.rs index b9373705e8..4721d9974c 100644 --- a/crates/trigger/src/loader.rs +++ b/crates/trigger/src/loader.rs @@ -64,7 +64,7 @@ impl Loader for TriggerLoader { path.display() ) } - spin_core::Component::new(engine, component) + spin_core::Component::new(engine, component.as_ref()) .with_context(|| format!("loading module {path:?}")) } diff --git a/crates/trigger/src/runtime_config/key_value.rs b/crates/trigger/src/runtime_config/key_value.rs index 40a92c1c96..f8a9f98e8e 100644 --- a/crates/trigger/src/runtime_config/key_value.rs +++ b/crates/trigger/src/runtime_config/key_value.rs @@ -4,8 +4,8 @@ use crate::{runtime_config::RuntimeConfig, TriggerHooks}; use anyhow::{bail, Context, Result}; use serde::Deserialize; use spin_key_value::{ - CachingStoreManager, DelegatingStoreManager, KeyValueComponent, StoreManager, - KEY_VALUE_STORES_KEY, + CachingStoreManager, DelegatingStoreManager, KeyValueComponent, LegacyKeyValueComponent, + StoreManager, KEY_VALUE_STORES_KEY, }; use spin_key_value_azure::KeyValueAzureCosmos; use spin_key_value_sqlite::{DatabaseLocation, KeyValueSqlite}; @@ -54,6 +54,14 @@ pub async fn build_key_value_component( }))) } +pub async fn build_legacy_key_value_component( + runtime_config: &RuntimeConfig, + init_data: &[(String, String)], +) -> Result { + let new = build_key_value_component(runtime_config, init_data).await?; + Ok(LegacyKeyValueComponent::new(new)) +} + // Holds deserialized options from a `[key_value_store.]` runtime config section. #[derive(Clone, Debug, Deserialize)] #[serde(rename_all = "snake_case", tag = "type")] diff --git a/crates/trigger/src/runtime_config/llm.rs b/crates/trigger/src/runtime_config/llm.rs index cef351a810..bead39107c 100644 --- a/crates/trigger/src/runtime_config/llm.rs +++ b/crates/trigger/src/runtime_config/llm.rs @@ -1,7 +1,7 @@ use async_trait::async_trait; use spin_llm::LlmEngine; use spin_llm_remote_http::RemoteHttpLlmEngine; -use spin_world::llm as wasi_llm; +use spin_world::v1::llm as wasi_llm; use url::Url; #[derive(Default)] diff --git a/crates/trigger/src/runtime_config/sqlite.rs b/crates/trigger/src/runtime_config/sqlite.rs index 676ce676d8..5e6250ae7c 100644 --- a/crates/trigger/src/runtime_config/sqlite.rs +++ b/crates/trigger/src/runtime_config/sqlite.rs @@ -2,7 +2,9 @@ use std::{collections::HashMap, path::PathBuf, sync::Arc}; use crate::{runtime_config::RuntimeConfig, TriggerHooks}; use anyhow::Context; -use spin_sqlite::{Connection, ConnectionsStore, SqliteComponent, DATABASES_KEY}; +use spin_sqlite::{ + Connection, ConnectionsStore, LegacySqliteComponent, SqliteComponent, DATABASES_KEY, +}; use super::RuntimeConfigOpts; @@ -23,6 +25,13 @@ pub(crate) async fn build_component( Ok(SqliteComponent::new(move |_| connections_store.clone())) } +pub(crate) async fn build_legacy_component( + runtime_config: &RuntimeConfig, +) -> anyhow::Result { + let component = build_component(runtime_config, &[]).await?; + Ok(LegacySqliteComponent::new(component)) +} + /// A `ConnectionStore` based on a `HashMap` struct SimpleConnectionsStore(HashMap>); @@ -31,7 +40,7 @@ impl ConnectionsStore for SimpleConnectionsStore { async fn get_connection( &self, database: &str, - ) -> Result>, spin_world::sqlite::Error> { + ) -> Result>, spin_world::v2::sqlite::Error> { Ok(self.0.get(database).cloned()) } diff --git a/crates/world/Cargo.toml b/crates/world/Cargo.toml index 02fa84745a..3c51d5b247 100644 --- a/crates/world/Cargo.toml +++ b/crates/world/Cargo.toml @@ -5,4 +5,4 @@ authors = { workspace = true } edition = { workspace = true } [dependencies] -wasmtime = { workspace = true } \ No newline at end of file +wasmtime = { workspace = true } diff --git a/crates/world/src/lib.rs b/crates/world/src/lib.rs index 2181cbbc1e..0ed064d9d2 100644 --- a/crates/world/src/lib.rs +++ b/crates/world/src/lib.rs @@ -2,8 +2,9 @@ wasmtime::component::bindgen!({ path: "../../wit/preview2", - world: "reactor", + world: "host", async: true }); -pub use fermyon::spin::*; +pub use fermyon::spin as v1; +pub use fermyon::spin2_0_0 as v2; diff --git a/examples/config-rust/Cargo.lock b/examples/config-rust/Cargo.lock index 3645bb8eb9..dcb9846e4b 100644 --- a/examples/config-rust/Cargo.lock +++ b/examples/config-rust/Cargo.lock @@ -4,9 +4,9 @@ version = 3 [[package]] name = "anyhow" -version = "1.0.71" +version = "1.0.75" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c7d0618f0e0b7e8ff11427422b64564d5fb0be1940354bfe2e0529b18a9d9b8" +checksum = "a4668cab20f66d8d020e1fbc0ebe47217433c1b6c8f2040faf858554e394ace6" [[package]] name = "autocfg" @@ -22,15 +22,21 @@ checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" [[package]] name = "bitflags" -version = "2.3.2" +version = "2.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6dbe3c979c178231552ecba20214a8272df4e09f232a87aef4320cf06539aded" +checksum = "b4682ae6287fcf752ecaabbfcc7b6f9b72aa33933dc23a554d853aea8eea8635" [[package]] name = "bytes" -version = "1.1.0" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a2bd12c1caf447e69cd4528f47f94d203fd2582878ecb9e9465484c4148a8223" + +[[package]] +name = "equivalent" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c4872d67bab6358e59559027aa3b9157c53d9358c51423c17554809a8858e0f8" +checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" [[package]] name = "fnv" @@ -40,19 +46,18 @@ checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" [[package]] name = "form_urlencoded" -version = "1.0.1" +version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5fc25a87fa4fd2094bffb06925852034d90a17f0d1e05197d4956d3555752191" +checksum = "a62bc1cf6f830c2ec14a513a9fb124d0a213a629668a4186f329db21fe045652" dependencies = [ - "matches", "percent-encoding", ] [[package]] name = "hashbrown" -version = "0.12.3" +version = "0.14.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" +checksum = "7dfda62a12f55daeae5015f81b0baea145391cb4520f86c248fc615d72640d12" [[package]] name = "heck" @@ -65,9 +70,9 @@ dependencies = [ [[package]] name = "http" -version = "0.2.8" +version = "0.2.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "75f43d41e26995c17e71ee126451dd3941010b0514a81a9d11f3b341debc2399" +checksum = "bd6effc99afb63425aff9b05836f029929e345a6148a14b7ecd5ab67af944482" dependencies = [ "bytes", "fnv", @@ -82,31 +87,30 @@ checksum = "25a2bc672d1148e28034f176e01fffebb08b35768468cc954630da77a1449005" [[package]] name = "idna" -version = "0.2.3" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "418a0a6fab821475f634efe3ccc45c013f742efe03d853e8d3355d5cb850ecf8" +checksum = "7d20d6b07bfbc108882d88ed8e37d39636dcc260e15e30c45e6ba089610b917c" dependencies = [ - "matches", "unicode-bidi", "unicode-normalization", ] [[package]] name = "indexmap" -version = "1.9.3" +version = "2.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bd070e393353796e801d209ad339e89596eb4c8d430d18ede6a1cced8fafbd99" +checksum = "8adf3ddd720272c6ea8bf59463c04e0f93d0bbf7c5439b691bca2987e0270897" dependencies = [ - "autocfg", + "equivalent", "hashbrown", "serde", ] [[package]] name = "itoa" -version = "1.0.2" +version = "1.0.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "112c678d4050afce233f4f2852bb2eb519230b3cf12f33585275537d7e41578d" +checksum = "af150ab688ff2122fcef229be89cb50dd66af9e01a4ff320cc137eecc9bacc38" [[package]] name = "leb128" @@ -116,42 +120,36 @@ checksum = "884e2677b40cc8c339eaefcb701c32ef1fd2493d71118dc0ca4b6a736c93bd67" [[package]] name = "log" -version = "0.4.19" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b06a4cde4c0f271a446782e3eff8de789548ce57dbc8eca9292c27f4a42004b4" - -[[package]] -name = "matches" -version = "0.1.9" +version = "0.4.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a3e378b66a060d48947b590737b30a1be76706c8dd7b8ba0f2fe3989c68a853f" +checksum = "b5e6163cb8c49088c2c36f57875e58ccd8c87c7427f7fbd50ea6710b2f3f2e8f" [[package]] name = "memchr" -version = "2.5.0" +version = "2.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2dffe52ecf27772e601905b7522cb4ef790d2cc203488bbd0e2fe85fcb74566d" +checksum = "f665ee40bc4a3c5590afb1e9677db74a508659dfd71e126420da8274909a0167" [[package]] name = "percent-encoding" -version = "2.1.0" +version = "2.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d4fd5641d01c8f18a23da7b6fe29298ff4b55afcccdf78973b24cf3175fee32e" +checksum = "9b2a4787296e9989611394c33f193f676704af1686e70b8f8033ab5ba9a35a94" [[package]] name = "proc-macro2" -version = "1.0.60" +version = "1.0.69" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dec2b086b7a862cf4de201096214fa870344cf922b2b30c167badb3af3195406" +checksum = "134c189feb4956b20f6f547d2cf727d4c0fe06722b20a0eec87ed445a97f92da" dependencies = [ "unicode-ident", ] [[package]] name = "pulldown-cmark" -version = "0.8.0" +version = "0.9.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ffade02495f22453cd593159ea2f59827aae7f53fa8323f756799b670881dcf8" +checksum = "77a1a2f1f0a7ecff9c31abbe177637be0e97a0aef46cf8738ece09327985d998" dependencies = [ "bitflags 1.3.2", "memchr", @@ -160,9 +158,9 @@ dependencies = [ [[package]] name = "quote" -version = "1.0.28" +version = "1.0.33" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1b9ab9c7eadfd8df19006f1cf1a4aed13540ed5cbc047010ece5826e10825488" +checksum = "5267fca4496028628a95160fc423a33e8b2e6af8a5302579e322e4b520293cae" dependencies = [ "proc-macro2", ] @@ -177,32 +175,55 @@ dependencies = [ "smartstring", ] +[[package]] +name = "ryu" +version = "1.0.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1ad4cc8da4ef723ed60bced201181d83791ad433213d8c24efffda1eec85d741" + [[package]] name = "semver" -version = "1.0.17" +version = "1.0.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bebd363326d05ec3e2f532ab7660680f3b02130d780c299bca73469d521bc0ed" +checksum = "836fa6a3e1e547f9a2c4040802ec865b5d85f4014efe00555d7090a3dcaa1090" [[package]] name = "serde" -version = "1.0.164" +version = "1.0.188" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9e8c8cf938e98f769bc164923b06dce91cea1751522f46f8466461af04c9027d" +checksum = "cf9e0fcba69a370eed61bcf2b728575f726b50b55cba78064753d708ddc7549e" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.164" +version = "1.0.188" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d9735b638ccc51c28bf6914d90a2e9725b377144fc612c49a611fddd1b631d68" +checksum = "4eca7ac642d82aa35b60049a6eccb4be6be75e599bd2e9adb5f875a737654af2" dependencies = [ "proc-macro2", "quote", - "syn 2.0.18", + "syn 2.0.38", +] + +[[package]] +name = "serde_json" +version = "1.0.107" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6b420ce6e3d8bd882e9b243c6eed35dbc9a6110c9769e74b584e0d68d1f20c65" +dependencies = [ + "itoa", + "ryu", + "serde", ] +[[package]] +name = "smallvec" +version = "1.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "942b4a808e05215192e39f4ab80813e599068285906cc91aa64f923db842bd5a" + [[package]] name = "smartcow" version = "0.2.1" @@ -223,6 +244,15 @@ dependencies = [ "version_check", ] +[[package]] +name = "spdx" +version = "0.10.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b19b32ed6d899ab23174302ff105c1577e45a06b08d4fe0a9dd13ce804bbbf71" +dependencies = [ + "smallvec", +] + [[package]] name = "spin-config-example" version = "0.1.0" @@ -242,7 +272,7 @@ dependencies = [ "http", "proc-macro2", "quote", - "syn 1.0.98", + "syn 1.0.109", ] [[package]] @@ -267,9 +297,9 @@ checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" [[package]] name = "syn" -version = "1.0.98" +version = "1.0.109" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c50aef8a904de4c23c788f104b7dddc7d6f79c647c7c8ce4cc8f73eb0ca773dd" +checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237" dependencies = [ "proc-macro2", "quote", @@ -278,9 +308,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.18" +version = "2.0.38" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "32d41677bcbe24c20c52e7c70b0d8db04134c5d1066bf98662e2871ad200ea3e" +checksum = "e96b79aaa137db8f61e26363a0c9b47d8b4ec75da28b7d1d614c2303e232408b" dependencies = [ "proc-macro2", "quote", @@ -289,22 +319,22 @@ dependencies = [ [[package]] name = "thiserror" -version = "1.0.37" +version = "1.0.49" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "10deb33631e3c9018b9baf9dcbbc4f737320d2b576bac10f6aefa048fa407e3e" +checksum = "1177e8c6d7ede7afde3585fd2513e611227efd6481bd78d2e82ba1ce16557ed4" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.37" +version = "1.0.49" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "982d17546b47146b28f7c22e3d08465f6b8903d0ea13c1660d9d84a6e7adcdbb" +checksum = "10712f02019e9288794769fba95cd6847df9874d49d871d062172f9dd41bc4cc" dependencies = [ "proc-macro2", "quote", - "syn 1.0.98", + "syn 2.0.38", ] [[package]] @@ -318,15 +348,15 @@ dependencies = [ [[package]] name = "tinyvec_macros" -version = "0.1.0" +version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cda74da7e1a664f795bb1f8a87ec406fb89a02522cf6e50620d016add6dbbf5c" +checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" [[package]] name = "unicase" -version = "2.6.0" +version = "2.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "50f37be617794602aabbeee0be4f259dc1778fabe05e2d67ee8f79326d5cb4f6" +checksum = "f7d2d4dafb69621809a81864c9c1b864479e1235c0dd4e199924b9742439ed89" dependencies = [ "version_check", ] @@ -339,36 +369,36 @@ checksum = "92888ba5573ff080736b3648696b70cafad7d250551175acbaa4e0385b3e1460" [[package]] name = "unicode-ident" -version = "1.0.2" +version = "1.0.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "15c61ba63f9235225a22310255a29b806b907c9b8c964bcbd0a2c70f3f2deea7" +checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" [[package]] name = "unicode-normalization" -version = "0.1.21" +version = "0.1.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "854cbdc4f7bc6ae19c820d44abdc3277ac3e1b2b93db20a636825d9322fb60e6" +checksum = "5c5713f0fc4b5db668a2ac63cdb7bb4469d8c9fed047b1d0292cc7b0ce2ba921" dependencies = [ "tinyvec", ] [[package]] name = "unicode-segmentation" -version = "1.9.0" +version = "1.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7e8820f5d777f6224dc4be3632222971ac30164d4a258d595640799554ebfd99" +checksum = "1dd624098567895118886609431a7c3b8f516e41d30e0643f03d94592a147e36" [[package]] name = "unicode-xid" -version = "0.2.3" +version = "0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "957e51f3646910546462e67d5f7599b9e4fb8acdd304b087a6494730f9eebf04" +checksum = "f962df74c8c05a667b5ee8bcf162993134c104e96440b663c8daa176dc772d8c" [[package]] name = "url" -version = "2.3.0" +version = "2.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22fe195a4f217c25b25cb5058ced57059824a678474874038dc88d211bf508d3" +checksum = "143b538f18257fac9cad154828a57c6bf5157e1aa604d4816b5995bf6de87ae5" dependencies = [ "form_urlencoded", "idna", @@ -383,31 +413,33 @@ checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" [[package]] name = "wasm-encoder" -version = "0.29.0" +version = "0.33.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "18c41dbd92eaebf3612a39be316540b8377c871cb9bde6b064af962984912881" +checksum = "34180c89672b3e4825c3a8db4b61a674f1447afd5fe2445b2d22c3d8b6ea086c" dependencies = [ "leb128", ] [[package]] name = "wasm-metadata" -version = "0.8.0" +version = "0.10.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "36e5156581ff4a302405c44ca7c85347563ca431d15f1a773f12c9c7b9a6cdc9" +checksum = "4f2c051ef041d348324b01ff0419f6f6593f094b4897d93c9cf52d5d1ac879ba" dependencies = [ "anyhow", "indexmap", "serde", + "serde_json", + "spdx", "wasm-encoder", "wasmparser", ] [[package]] name = "wasmparser" -version = "0.107.0" +version = "0.113.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "29e3ac9b780c7dda0cac7a52a5d6d2d6707cc6e3451c9db209b6c758f40d7acb" +checksum = "286049849b5a5bd09a8773171be96824afabffc7cc3df6caaf33a38db6cd07ae" dependencies = [ "indexmap", "semver", @@ -415,19 +447,17 @@ dependencies = [ [[package]] name = "wit-bindgen" -version = "0.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "392d16e9e46cc7ca98125bc288dd5e4db469efe8323d3e0dac815ca7f2398522" +version = "0.12.0" +source = "git+https://github.com/bytecodealliance/wit-bindgen?rev=46fba30bb667a3a4962f63b1cc28b84427b49114#46fba30bb667a3a4962f63b1cc28b84427b49114" dependencies = [ - "bitflags 2.3.2", + "bitflags 2.4.0", "wit-bindgen-rust-macro", ] [[package]] name = "wit-bindgen-core" -version = "0.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d422d36cbd78caa0e18c3371628447807c66ee72466b69865ea7e33682598158" +version = "0.12.0" +source = "git+https://github.com/bytecodealliance/wit-bindgen?rev=46fba30bb667a3a4962f63b1cc28b84427b49114#46fba30bb667a3a4962f63b1cc28b84427b49114" dependencies = [ "anyhow", "wit-component", @@ -436,36 +466,25 @@ dependencies = [ [[package]] name = "wit-bindgen-rust" -version = "0.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b76db68264f5d2089dc4652581236d8e75c5b89338de6187716215fd0e68ba3" +version = "0.12.0" +source = "git+https://github.com/bytecodealliance/wit-bindgen?rev=46fba30bb667a3a4962f63b1cc28b84427b49114#46fba30bb667a3a4962f63b1cc28b84427b49114" dependencies = [ + "anyhow", "heck", "wasm-metadata", "wit-bindgen-core", - "wit-bindgen-rust-lib", "wit-component", ] -[[package]] -name = "wit-bindgen-rust-lib" -version = "0.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1c50f334bc08b0903a43387f6eea6ef6aa9eb2a085729f1677b29992ecef20ba" -dependencies = [ - "heck", - "wit-bindgen-core", -] - [[package]] name = "wit-bindgen-rust-macro" -version = "0.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ced38a5e174940c6a41ae587babeadfd2e2c2dc32f3b6488bcdca0e8922cf3f3" +version = "0.12.0" +source = "git+https://github.com/bytecodealliance/wit-bindgen?rev=46fba30bb667a3a4962f63b1cc28b84427b49114#46fba30bb667a3a4962f63b1cc28b84427b49114" dependencies = [ "anyhow", "proc-macro2", - "syn 2.0.18", + "quote", + "syn 2.0.38", "wit-bindgen-core", "wit-bindgen-rust", "wit-component", @@ -473,14 +492,16 @@ dependencies = [ [[package]] name = "wit-component" -version = "0.11.0" +version = "0.14.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7cbd4c7f8f400327c482c88571f373844b7889e61460650d650fc5881bb3575c" +checksum = "2e2bf941487fc5afa9e3fc94761f6b80ecef5a2bed6239b959d23d9de69e3448" dependencies = [ "anyhow", - "bitflags 1.3.2", + "bitflags 2.4.0", "indexmap", "log", + "serde", + "serde_json", "wasm-encoder", "wasm-metadata", "wasmparser", @@ -489,9 +510,9 @@ dependencies = [ [[package]] name = "wit-parser" -version = "0.8.0" +version = "0.11.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6daec9f093dbaea0e94043eeb92ece327bbbe70c86b1f41aca9bbfefd7f050f0" +checksum = "a39edca9abb16309def3843af73b58d47d243fe33a9ceee572446bcc57556b9a" dependencies = [ "anyhow", "id-arena", @@ -499,6 +520,8 @@ dependencies = [ "log", "pulldown-cmark", "semver", + "serde", + "serde_json", "unicode-xid", "url", ] diff --git a/examples/http-rust/Cargo.lock b/examples/http-rust/Cargo.lock index 54219c5ac9..8100bdbcf5 100644 --- a/examples/http-rust/Cargo.lock +++ b/examples/http-rust/Cargo.lock @@ -4,9 +4,9 @@ version = 3 [[package]] name = "anyhow" -version = "1.0.71" +version = "1.0.75" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c7d0618f0e0b7e8ff11427422b64564d5fb0be1940354bfe2e0529b18a9d9b8" +checksum = "a4668cab20f66d8d020e1fbc0ebe47217433c1b6c8f2040faf858554e394ace6" [[package]] name = "autocfg" @@ -22,15 +22,21 @@ checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" [[package]] name = "bitflags" -version = "2.3.3" +version = "2.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "630be753d4e58660abd17930c71b647fe46c27ea6b63cc59e1e3851406972e42" +checksum = "b4682ae6287fcf752ecaabbfcc7b6f9b72aa33933dc23a554d853aea8eea8635" [[package]] name = "bytes" -version = "1.4.0" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a2bd12c1caf447e69cd4528f47f94d203fd2582878ecb9e9465484c4148a8223" + +[[package]] +name = "equivalent" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "89b2fd2a0dcf38d7971e2194b6b6eebab45ae01067456a7fd93d5547a61b70be" +checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" [[package]] name = "fnv" @@ -49,9 +55,9 @@ dependencies = [ [[package]] name = "hashbrown" -version = "0.12.3" +version = "0.14.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" +checksum = "7dfda62a12f55daeae5015f81b0baea145391cb4520f86c248fc615d72640d12" [[package]] name = "heck" @@ -101,20 +107,20 @@ dependencies = [ [[package]] name = "indexmap" -version = "1.9.3" +version = "2.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bd070e393353796e801d209ad339e89596eb4c8d430d18ede6a1cced8fafbd99" +checksum = "8adf3ddd720272c6ea8bf59463c04e0f93d0bbf7c5439b691bca2987e0270897" dependencies = [ - "autocfg", + "equivalent", "hashbrown", "serde", ] [[package]] name = "itoa" -version = "1.0.8" +version = "1.0.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62b02a5381cc465bd3041d84623d0fa3b66738b52b8e2fc3bab8ad63ab032f4a" +checksum = "af150ab688ff2122fcef229be89cb50dd66af9e01a4ff320cc137eecc9bacc38" [[package]] name = "leb128" @@ -124,15 +130,15 @@ checksum = "884e2677b40cc8c339eaefcb701c32ef1fd2493d71118dc0ca4b6a736c93bd67" [[package]] name = "log" -version = "0.4.19" +version = "0.4.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b06a4cde4c0f271a446782e3eff8de789548ce57dbc8eca9292c27f4a42004b4" +checksum = "b5e6163cb8c49088c2c36f57875e58ccd8c87c7427f7fbd50ea6710b2f3f2e8f" [[package]] name = "memchr" -version = "2.5.0" +version = "2.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2dffe52ecf27772e601905b7522cb4ef790d2cc203488bbd0e2fe85fcb74566d" +checksum = "f665ee40bc4a3c5590afb1e9677db74a508659dfd71e126420da8274909a0167" [[package]] name = "percent-encoding" @@ -142,18 +148,18 @@ checksum = "9b2a4787296e9989611394c33f193f676704af1686e70b8f8033ab5ba9a35a94" [[package]] name = "proc-macro2" -version = "1.0.64" +version = "1.0.69" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "78803b62cbf1f46fde80d7c0e803111524b9877184cfe7c3033659490ac7a7da" +checksum = "134c189feb4956b20f6f547d2cf727d4c0fe06722b20a0eec87ed445a97f92da" dependencies = [ "unicode-ident", ] [[package]] name = "pulldown-cmark" -version = "0.8.0" +version = "0.9.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ffade02495f22453cd593159ea2f59827aae7f53fa8323f756799b670881dcf8" +checksum = "77a1a2f1f0a7ecff9c31abbe177637be0e97a0aef46cf8738ece09327985d998" dependencies = [ "bitflags 1.3.2", "memchr", @@ -162,9 +168,9 @@ dependencies = [ [[package]] name = "quote" -version = "1.0.29" +version = "1.0.33" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "573015e8ab27661678357f27dc26460738fd2b6c86e46f386fde94cb5d913105" +checksum = "5267fca4496028628a95160fc423a33e8b2e6af8a5302579e322e4b520293cae" dependencies = [ "proc-macro2", ] @@ -179,32 +185,55 @@ dependencies = [ "smartstring", ] +[[package]] +name = "ryu" +version = "1.0.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1ad4cc8da4ef723ed60bced201181d83791ad433213d8c24efffda1eec85d741" + [[package]] name = "semver" -version = "1.0.17" +version = "1.0.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bebd363326d05ec3e2f532ab7660680f3b02130d780c299bca73469d521bc0ed" +checksum = "836fa6a3e1e547f9a2c4040802ec865b5d85f4014efe00555d7090a3dcaa1090" [[package]] name = "serde" -version = "1.0.171" +version = "1.0.188" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "30e27d1e4fd7659406c492fd6cfaf2066ba8773de45ca75e855590f856dc34a9" +checksum = "cf9e0fcba69a370eed61bcf2b728575f726b50b55cba78064753d708ddc7549e" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.171" +version = "1.0.188" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "389894603bd18c46fa56231694f8d827779c0951a667087194cf9de94ed24682" +checksum = "4eca7ac642d82aa35b60049a6eccb4be6be75e599bd2e9adb5f875a737654af2" dependencies = [ "proc-macro2", "quote", - "syn 2.0.25", + "syn 2.0.38", ] +[[package]] +name = "serde_json" +version = "1.0.107" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6b420ce6e3d8bd882e9b243c6eed35dbc9a6110c9769e74b584e0d68d1f20c65" +dependencies = [ + "itoa", + "ryu", + "serde", +] + +[[package]] +name = "smallvec" +version = "1.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "942b4a808e05215192e39f4ab80813e599068285906cc91aa64f923db842bd5a" + [[package]] name = "smartcow" version = "0.2.1" @@ -225,6 +254,15 @@ dependencies = [ "version_check", ] +[[package]] +name = "spdx" +version = "0.10.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b19b32ed6d899ab23174302ff105c1577e45a06b08d4fe0a9dd13ce804bbbf71" +dependencies = [ + "smallvec", +] + [[package]] name = "spin-macro" version = "0.1.0" @@ -270,9 +308,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.25" +version = "2.0.38" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "15e3fc8c0c74267e2df136e5e5fb656a464158aa57624053375eb9c8c6e25ae2" +checksum = "e96b79aaa137db8f61e26363a0c9b47d8b4ec75da28b7d1d614c2303e232408b" dependencies = [ "proc-macro2", "quote", @@ -281,22 +319,22 @@ dependencies = [ [[package]] name = "thiserror" -version = "1.0.43" +version = "1.0.49" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a35fc5b8971143ca348fa6df4f024d4d55264f3468c71ad1c2f365b0a4d58c42" +checksum = "1177e8c6d7ede7afde3585fd2513e611227efd6481bd78d2e82ba1ce16557ed4" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.43" +version = "1.0.49" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "463fe12d7993d3b327787537ce8dd4dfa058de32fc2b195ef3cde03dc4771e8f" +checksum = "10712f02019e9288794769fba95cd6847df9874d49d871d062172f9dd41bc4cc" dependencies = [ "proc-macro2", "quote", - "syn 2.0.25", + "syn 2.0.38", ] [[package]] @@ -316,9 +354,9 @@ checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" [[package]] name = "unicase" -version = "2.6.0" +version = "2.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "50f37be617794602aabbeee0be4f259dc1778fabe05e2d67ee8f79326d5cb4f6" +checksum = "f7d2d4dafb69621809a81864c9c1b864479e1235c0dd4e199924b9742439ed89" dependencies = [ "version_check", ] @@ -331,9 +369,9 @@ checksum = "92888ba5573ff080736b3648696b70cafad7d250551175acbaa4e0385b3e1460" [[package]] name = "unicode-ident" -version = "1.0.10" +version = "1.0.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22049a19f4a68748a168c0fc439f9516686aa045927ff767eca0a85101fb6e73" +checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" [[package]] name = "unicode-normalization" @@ -358,9 +396,9 @@ checksum = "f962df74c8c05a667b5ee8bcf162993134c104e96440b663c8daa176dc772d8c" [[package]] name = "url" -version = "2.4.0" +version = "2.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "50bff7831e19200a85b17131d085c25d7811bc4e186efdaf54bbd132994a88cb" +checksum = "143b538f18257fac9cad154828a57c6bf5157e1aa604d4816b5995bf6de87ae5" dependencies = [ "form_urlencoded", "idna", @@ -375,31 +413,33 @@ checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" [[package]] name = "wasm-encoder" -version = "0.29.0" +version = "0.33.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "18c41dbd92eaebf3612a39be316540b8377c871cb9bde6b064af962984912881" +checksum = "34180c89672b3e4825c3a8db4b61a674f1447afd5fe2445b2d22c3d8b6ea086c" dependencies = [ "leb128", ] [[package]] name = "wasm-metadata" -version = "0.8.0" +version = "0.10.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "36e5156581ff4a302405c44ca7c85347563ca431d15f1a773f12c9c7b9a6cdc9" +checksum = "4f2c051ef041d348324b01ff0419f6f6593f094b4897d93c9cf52d5d1ac879ba" dependencies = [ "anyhow", "indexmap", "serde", + "serde_json", + "spdx", "wasm-encoder", "wasmparser", ] [[package]] name = "wasmparser" -version = "0.107.0" +version = "0.113.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "29e3ac9b780c7dda0cac7a52a5d6d2d6707cc6e3451c9db209b6c758f40d7acb" +checksum = "286049849b5a5bd09a8773171be96824afabffc7cc3df6caaf33a38db6cd07ae" dependencies = [ "indexmap", "semver", @@ -407,19 +447,17 @@ dependencies = [ [[package]] name = "wit-bindgen" -version = "0.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "392d16e9e46cc7ca98125bc288dd5e4db469efe8323d3e0dac815ca7f2398522" +version = "0.12.0" +source = "git+https://github.com/bytecodealliance/wit-bindgen?rev=46fba30bb667a3a4962f63b1cc28b84427b49114#46fba30bb667a3a4962f63b1cc28b84427b49114" dependencies = [ - "bitflags 2.3.3", + "bitflags 2.4.0", "wit-bindgen-rust-macro", ] [[package]] name = "wit-bindgen-core" -version = "0.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d422d36cbd78caa0e18c3371628447807c66ee72466b69865ea7e33682598158" +version = "0.12.0" +source = "git+https://github.com/bytecodealliance/wit-bindgen?rev=46fba30bb667a3a4962f63b1cc28b84427b49114#46fba30bb667a3a4962f63b1cc28b84427b49114" dependencies = [ "anyhow", "wit-component", @@ -428,36 +466,25 @@ dependencies = [ [[package]] name = "wit-bindgen-rust" -version = "0.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b76db68264f5d2089dc4652581236d8e75c5b89338de6187716215fd0e68ba3" +version = "0.12.0" +source = "git+https://github.com/bytecodealliance/wit-bindgen?rev=46fba30bb667a3a4962f63b1cc28b84427b49114#46fba30bb667a3a4962f63b1cc28b84427b49114" dependencies = [ + "anyhow", "heck", "wasm-metadata", "wit-bindgen-core", - "wit-bindgen-rust-lib", "wit-component", ] -[[package]] -name = "wit-bindgen-rust-lib" -version = "0.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1c50f334bc08b0903a43387f6eea6ef6aa9eb2a085729f1677b29992ecef20ba" -dependencies = [ - "heck", - "wit-bindgen-core", -] - [[package]] name = "wit-bindgen-rust-macro" -version = "0.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ced38a5e174940c6a41ae587babeadfd2e2c2dc32f3b6488bcdca0e8922cf3f3" +version = "0.12.0" +source = "git+https://github.com/bytecodealliance/wit-bindgen?rev=46fba30bb667a3a4962f63b1cc28b84427b49114#46fba30bb667a3a4962f63b1cc28b84427b49114" dependencies = [ "anyhow", "proc-macro2", - "syn 2.0.25", + "quote", + "syn 2.0.38", "wit-bindgen-core", "wit-bindgen-rust", "wit-component", @@ -465,14 +492,16 @@ dependencies = [ [[package]] name = "wit-component" -version = "0.11.0" +version = "0.14.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7cbd4c7f8f400327c482c88571f373844b7889e61460650d650fc5881bb3575c" +checksum = "2e2bf941487fc5afa9e3fc94761f6b80ecef5a2bed6239b959d23d9de69e3448" dependencies = [ "anyhow", - "bitflags 1.3.2", + "bitflags 2.4.0", "indexmap", "log", + "serde", + "serde_json", "wasm-encoder", "wasm-metadata", "wasmparser", @@ -481,9 +510,9 @@ dependencies = [ [[package]] name = "wit-parser" -version = "0.8.0" +version = "0.11.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6daec9f093dbaea0e94043eeb92ece327bbbe70c86b1f41aca9bbfefd7f050f0" +checksum = "a39edca9abb16309def3843af73b58d47d243fe33a9ceee572446bcc57556b9a" dependencies = [ "anyhow", "id-arena", @@ -491,6 +520,8 @@ dependencies = [ "log", "pulldown-cmark", "semver", + "serde", + "serde_json", "unicode-xid", "url", ] diff --git a/examples/redis-rust/Cargo.lock b/examples/redis-rust/Cargo.lock index e412d518ef..57d0ac89a0 100644 --- a/examples/redis-rust/Cargo.lock +++ b/examples/redis-rust/Cargo.lock @@ -4,9 +4,9 @@ version = 3 [[package]] name = "anyhow" -version = "1.0.71" +version = "1.0.75" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c7d0618f0e0b7e8ff11427422b64564d5fb0be1940354bfe2e0529b18a9d9b8" +checksum = "a4668cab20f66d8d020e1fbc0ebe47217433c1b6c8f2040faf858554e394ace6" [[package]] name = "autocfg" @@ -22,15 +22,21 @@ checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" [[package]] name = "bitflags" -version = "2.3.2" +version = "2.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6dbe3c979c178231552ecba20214a8272df4e09f232a87aef4320cf06539aded" +checksum = "b4682ae6287fcf752ecaabbfcc7b6f9b72aa33933dc23a554d853aea8eea8635" [[package]] name = "bytes" -version = "1.1.0" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c4872d67bab6358e59559027aa3b9157c53d9358c51423c17554809a8858e0f8" +checksum = "a2bd12c1caf447e69cd4528f47f94d203fd2582878ecb9e9465484c4148a8223" + +[[package]] +name = "equivalent" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" [[package]] name = "fnv" @@ -40,19 +46,18 @@ checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" [[package]] name = "form_urlencoded" -version = "1.0.1" +version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5fc25a87fa4fd2094bffb06925852034d90a17f0d1e05197d4956d3555752191" +checksum = "a62bc1cf6f830c2ec14a513a9fb124d0a213a629668a4186f329db21fe045652" dependencies = [ - "matches", "percent-encoding", ] [[package]] name = "hashbrown" -version = "0.12.3" +version = "0.14.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" +checksum = "7dfda62a12f55daeae5015f81b0baea145391cb4520f86c248fc615d72640d12" [[package]] name = "heck" @@ -65,9 +70,9 @@ dependencies = [ [[package]] name = "http" -version = "0.2.6" +version = "0.2.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "31f4c6746584866f0feabcc69893c5b51beef3831656a968ed7ae254cdc4fd03" +checksum = "bd6effc99afb63425aff9b05836f029929e345a6148a14b7ecd5ab67af944482" dependencies = [ "bytes", "fnv", @@ -82,31 +87,30 @@ checksum = "25a2bc672d1148e28034f176e01fffebb08b35768468cc954630da77a1449005" [[package]] name = "idna" -version = "0.2.3" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "418a0a6fab821475f634efe3ccc45c013f742efe03d853e8d3355d5cb850ecf8" +checksum = "7d20d6b07bfbc108882d88ed8e37d39636dcc260e15e30c45e6ba089610b917c" dependencies = [ - "matches", "unicode-bidi", "unicode-normalization", ] [[package]] name = "indexmap" -version = "1.9.3" +version = "2.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bd070e393353796e801d209ad339e89596eb4c8d430d18ede6a1cced8fafbd99" +checksum = "8adf3ddd720272c6ea8bf59463c04e0f93d0bbf7c5439b691bca2987e0270897" dependencies = [ - "autocfg", + "equivalent", "hashbrown", "serde", ] [[package]] name = "itoa" -version = "1.0.1" +version = "1.0.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1aab8fc367588b89dcee83ab0fd66b72b50b72fa1904d7095045ace2b0c81c35" +checksum = "af150ab688ff2122fcef229be89cb50dd66af9e01a4ff320cc137eecc9bacc38" [[package]] name = "leb128" @@ -116,42 +120,36 @@ checksum = "884e2677b40cc8c339eaefcb701c32ef1fd2493d71118dc0ca4b6a736c93bd67" [[package]] name = "log" -version = "0.4.19" +version = "0.4.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b06a4cde4c0f271a446782e3eff8de789548ce57dbc8eca9292c27f4a42004b4" - -[[package]] -name = "matches" -version = "0.1.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a3e378b66a060d48947b590737b30a1be76706c8dd7b8ba0f2fe3989c68a853f" +checksum = "b5e6163cb8c49088c2c36f57875e58ccd8c87c7427f7fbd50ea6710b2f3f2e8f" [[package]] name = "memchr" -version = "2.4.1" +version = "2.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "308cc39be01b73d0d18f82a0e7b2a3df85245f84af96fdddc5d202d27e47b86a" +checksum = "f665ee40bc4a3c5590afb1e9677db74a508659dfd71e126420da8274909a0167" [[package]] name = "percent-encoding" -version = "2.1.0" +version = "2.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d4fd5641d01c8f18a23da7b6fe29298ff4b55afcccdf78973b24cf3175fee32e" +checksum = "9b2a4787296e9989611394c33f193f676704af1686e70b8f8033ab5ba9a35a94" [[package]] name = "proc-macro2" -version = "1.0.60" +version = "1.0.69" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dec2b086b7a862cf4de201096214fa870344cf922b2b30c167badb3af3195406" +checksum = "134c189feb4956b20f6f547d2cf727d4c0fe06722b20a0eec87ed445a97f92da" dependencies = [ "unicode-ident", ] [[package]] name = "pulldown-cmark" -version = "0.8.0" +version = "0.9.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ffade02495f22453cd593159ea2f59827aae7f53fa8323f756799b670881dcf8" +checksum = "77a1a2f1f0a7ecff9c31abbe177637be0e97a0aef46cf8738ece09327985d998" dependencies = [ "bitflags 1.3.2", "memchr", @@ -160,9 +158,9 @@ dependencies = [ [[package]] name = "quote" -version = "1.0.28" +version = "1.0.33" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1b9ab9c7eadfd8df19006f1cf1a4aed13540ed5cbc047010ece5826e10825488" +checksum = "5267fca4496028628a95160fc423a33e8b2e6af8a5302579e322e4b520293cae" dependencies = [ "proc-macro2", ] @@ -177,32 +175,55 @@ dependencies = [ "smartstring", ] +[[package]] +name = "ryu" +version = "1.0.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1ad4cc8da4ef723ed60bced201181d83791ad433213d8c24efffda1eec85d741" + [[package]] name = "semver" -version = "1.0.17" +version = "1.0.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bebd363326d05ec3e2f532ab7660680f3b02130d780c299bca73469d521bc0ed" +checksum = "836fa6a3e1e547f9a2c4040802ec865b5d85f4014efe00555d7090a3dcaa1090" [[package]] name = "serde" -version = "1.0.164" +version = "1.0.188" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9e8c8cf938e98f769bc164923b06dce91cea1751522f46f8466461af04c9027d" +checksum = "cf9e0fcba69a370eed61bcf2b728575f726b50b55cba78064753d708ddc7549e" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.164" +version = "1.0.188" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d9735b638ccc51c28bf6914d90a2e9725b377144fc612c49a611fddd1b631d68" +checksum = "4eca7ac642d82aa35b60049a6eccb4be6be75e599bd2e9adb5f875a737654af2" dependencies = [ "proc-macro2", "quote", - "syn 2.0.18", + "syn 2.0.38", ] +[[package]] +name = "serde_json" +version = "1.0.107" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6b420ce6e3d8bd882e9b243c6eed35dbc9a6110c9769e74b584e0d68d1f20c65" +dependencies = [ + "itoa", + "ryu", + "serde", +] + +[[package]] +name = "smallvec" +version = "1.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "942b4a808e05215192e39f4ab80813e599068285906cc91aa64f923db842bd5a" + [[package]] name = "smartcow" version = "0.2.1" @@ -223,6 +244,15 @@ dependencies = [ "version_check", ] +[[package]] +name = "spdx" +version = "0.10.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b19b32ed6d899ab23174302ff105c1577e45a06b08d4fe0a9dd13ce804bbbf71" +dependencies = [ + "smallvec", +] + [[package]] name = "spin-macro" version = "0.1.0" @@ -232,7 +262,7 @@ dependencies = [ "http", "proc-macro2", "quote", - "syn 1.0.86", + "syn 1.0.109", ] [[package]] @@ -266,20 +296,20 @@ checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" [[package]] name = "syn" -version = "1.0.86" +version = "1.0.109" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a65b3f4ffa0092e9887669db0eae07941f023991ab58ea44da8fe8e2d511c6b" +checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237" dependencies = [ "proc-macro2", "quote", - "unicode-xid", + "unicode-ident", ] [[package]] name = "syn" -version = "2.0.18" +version = "2.0.38" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "32d41677bcbe24c20c52e7c70b0d8db04134c5d1066bf98662e2871ad200ea3e" +checksum = "e96b79aaa137db8f61e26363a0c9b47d8b4ec75da28b7d1d614c2303e232408b" dependencies = [ "proc-macro2", "quote", @@ -288,44 +318,44 @@ dependencies = [ [[package]] name = "thiserror" -version = "1.0.37" +version = "1.0.49" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "10deb33631e3c9018b9baf9dcbbc4f737320d2b576bac10f6aefa048fa407e3e" +checksum = "1177e8c6d7ede7afde3585fd2513e611227efd6481bd78d2e82ba1ce16557ed4" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.37" +version = "1.0.49" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "982d17546b47146b28f7c22e3d08465f6b8903d0ea13c1660d9d84a6e7adcdbb" +checksum = "10712f02019e9288794769fba95cd6847df9874d49d871d062172f9dd41bc4cc" dependencies = [ "proc-macro2", "quote", - "syn 1.0.86", + "syn 2.0.38", ] [[package]] name = "tinyvec" -version = "1.5.1" +version = "1.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2c1c1d5a42b6245520c249549ec267180beaffcc0615401ac8e31853d4b6d8d2" +checksum = "87cc5ceb3875bb20c2890005a4e226a4651264a5c75edb2421b52861a0a0cb50" dependencies = [ "tinyvec_macros", ] [[package]] name = "tinyvec_macros" -version = "0.1.0" +version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cda74da7e1a664f795bb1f8a87ec406fb89a02522cf6e50620d016add6dbbf5c" +checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" [[package]] name = "unicase" -version = "2.6.0" +version = "2.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "50f37be617794602aabbeee0be4f259dc1778fabe05e2d67ee8f79326d5cb4f6" +checksum = "f7d2d4dafb69621809a81864c9c1b864479e1235c0dd4e199924b9742439ed89" dependencies = [ "version_check", ] @@ -338,36 +368,36 @@ checksum = "92888ba5573ff080736b3648696b70cafad7d250551175acbaa4e0385b3e1460" [[package]] name = "unicode-ident" -version = "1.0.9" +version = "1.0.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b15811caf2415fb889178633e7724bad2509101cde276048e013b9def5e51fa0" +checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" [[package]] name = "unicode-normalization" -version = "0.1.19" +version = "0.1.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d54590932941a9e9266f0832deed84ebe1bf2e4c9e4a3554d393d18f5e854bf9" +checksum = "5c5713f0fc4b5db668a2ac63cdb7bb4469d8c9fed047b1d0292cc7b0ce2ba921" dependencies = [ "tinyvec", ] [[package]] name = "unicode-segmentation" -version = "1.9.0" +version = "1.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7e8820f5d777f6224dc4be3632222971ac30164d4a258d595640799554ebfd99" +checksum = "1dd624098567895118886609431a7c3b8f516e41d30e0643f03d94592a147e36" [[package]] name = "unicode-xid" -version = "0.2.2" +version = "0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ccb82d61f80a663efe1f787a51b16b5a51e3314d6ac365b08639f52387b33f3" +checksum = "f962df74c8c05a667b5ee8bcf162993134c104e96440b663c8daa176dc772d8c" [[package]] name = "url" -version = "2.3.0" +version = "2.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22fe195a4f217c25b25cb5058ced57059824a678474874038dc88d211bf508d3" +checksum = "143b538f18257fac9cad154828a57c6bf5157e1aa604d4816b5995bf6de87ae5" dependencies = [ "form_urlencoded", "idna", @@ -382,31 +412,33 @@ checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" [[package]] name = "wasm-encoder" -version = "0.29.0" +version = "0.33.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "18c41dbd92eaebf3612a39be316540b8377c871cb9bde6b064af962984912881" +checksum = "34180c89672b3e4825c3a8db4b61a674f1447afd5fe2445b2d22c3d8b6ea086c" dependencies = [ "leb128", ] [[package]] name = "wasm-metadata" -version = "0.8.0" +version = "0.10.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "36e5156581ff4a302405c44ca7c85347563ca431d15f1a773f12c9c7b9a6cdc9" +checksum = "4f2c051ef041d348324b01ff0419f6f6593f094b4897d93c9cf52d5d1ac879ba" dependencies = [ "anyhow", "indexmap", "serde", + "serde_json", + "spdx", "wasm-encoder", "wasmparser", ] [[package]] name = "wasmparser" -version = "0.107.0" +version = "0.113.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "29e3ac9b780c7dda0cac7a52a5d6d2d6707cc6e3451c9db209b6c758f40d7acb" +checksum = "286049849b5a5bd09a8773171be96824afabffc7cc3df6caaf33a38db6cd07ae" dependencies = [ "indexmap", "semver", @@ -414,19 +446,17 @@ dependencies = [ [[package]] name = "wit-bindgen" -version = "0.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "392d16e9e46cc7ca98125bc288dd5e4db469efe8323d3e0dac815ca7f2398522" +version = "0.12.0" +source = "git+https://github.com/bytecodealliance/wit-bindgen?rev=46fba30bb667a3a4962f63b1cc28b84427b49114#46fba30bb667a3a4962f63b1cc28b84427b49114" dependencies = [ - "bitflags 2.3.2", + "bitflags 2.4.0", "wit-bindgen-rust-macro", ] [[package]] name = "wit-bindgen-core" -version = "0.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d422d36cbd78caa0e18c3371628447807c66ee72466b69865ea7e33682598158" +version = "0.12.0" +source = "git+https://github.com/bytecodealliance/wit-bindgen?rev=46fba30bb667a3a4962f63b1cc28b84427b49114#46fba30bb667a3a4962f63b1cc28b84427b49114" dependencies = [ "anyhow", "wit-component", @@ -435,36 +465,25 @@ dependencies = [ [[package]] name = "wit-bindgen-rust" -version = "0.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b76db68264f5d2089dc4652581236d8e75c5b89338de6187716215fd0e68ba3" +version = "0.12.0" +source = "git+https://github.com/bytecodealliance/wit-bindgen?rev=46fba30bb667a3a4962f63b1cc28b84427b49114#46fba30bb667a3a4962f63b1cc28b84427b49114" dependencies = [ + "anyhow", "heck", "wasm-metadata", "wit-bindgen-core", - "wit-bindgen-rust-lib", "wit-component", ] -[[package]] -name = "wit-bindgen-rust-lib" -version = "0.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1c50f334bc08b0903a43387f6eea6ef6aa9eb2a085729f1677b29992ecef20ba" -dependencies = [ - "heck", - "wit-bindgen-core", -] - [[package]] name = "wit-bindgen-rust-macro" -version = "0.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ced38a5e174940c6a41ae587babeadfd2e2c2dc32f3b6488bcdca0e8922cf3f3" +version = "0.12.0" +source = "git+https://github.com/bytecodealliance/wit-bindgen?rev=46fba30bb667a3a4962f63b1cc28b84427b49114#46fba30bb667a3a4962f63b1cc28b84427b49114" dependencies = [ "anyhow", "proc-macro2", - "syn 2.0.18", + "quote", + "syn 2.0.38", "wit-bindgen-core", "wit-bindgen-rust", "wit-component", @@ -472,14 +491,16 @@ dependencies = [ [[package]] name = "wit-component" -version = "0.11.0" +version = "0.14.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7cbd4c7f8f400327c482c88571f373844b7889e61460650d650fc5881bb3575c" +checksum = "2e2bf941487fc5afa9e3fc94761f6b80ecef5a2bed6239b959d23d9de69e3448" dependencies = [ "anyhow", - "bitflags 1.3.2", + "bitflags 2.4.0", "indexmap", "log", + "serde", + "serde_json", "wasm-encoder", "wasm-metadata", "wasmparser", @@ -488,9 +509,9 @@ dependencies = [ [[package]] name = "wit-parser" -version = "0.8.0" +version = "0.11.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6daec9f093dbaea0e94043eeb92ece327bbbe70c86b1f41aca9bbfefd7f050f0" +checksum = "a39edca9abb16309def3843af73b58d47d243fe33a9ceee572446bcc57556b9a" dependencies = [ "anyhow", "id-arena", @@ -498,6 +519,8 @@ dependencies = [ "log", "pulldown-cmark", "semver", + "serde", + "serde_json", "unicode-xid", "url", ] diff --git a/examples/rust-outbound-mysql/src/lib.rs b/examples/rust-outbound-mysql/src/lib.rs index 079c8208a5..924b9ba554 100644 --- a/examples/rust-outbound-mysql/src/lib.rs +++ b/examples/rust-outbound-mysql/src/lib.rs @@ -27,7 +27,7 @@ fn rust_outbound_mysql(req: Request) -> Result { match parse_request(req) { RequestAction::List => list(), RequestAction::Get(id) => get(id), - RequestAction::Create(name, prey, is_finicky) => create(&name, &prey, is_finicky), + RequestAction::Create(name, prey, is_finicky) => create(name, prey, is_finicky), RequestAction::Error(status) => error(status), } } @@ -141,7 +141,7 @@ fn get(id: i32) -> Result { } } -fn create(name: &str, prey: &Option, is_finicky: bool) -> Result { +fn create(name: String, prey: Option, is_finicky: bool) -> Result { let address = std::env::var(DB_URL_ENV)?; let id = max_pet_id(&address)? + 1; diff --git a/examples/rust-outbound-pg/Cargo.lock b/examples/rust-outbound-pg/Cargo.lock index eb57eec1dc..b7c118f5eb 100644 --- a/examples/rust-outbound-pg/Cargo.lock +++ b/examples/rust-outbound-pg/Cargo.lock @@ -4,9 +4,9 @@ version = 3 [[package]] name = "anyhow" -version = "1.0.71" +version = "1.0.75" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c7d0618f0e0b7e8ff11427422b64564d5fb0be1940354bfe2e0529b18a9d9b8" +checksum = "a4668cab20f66d8d020e1fbc0ebe47217433c1b6c8f2040faf858554e394ace6" [[package]] name = "autocfg" @@ -22,15 +22,21 @@ checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" [[package]] name = "bitflags" -version = "2.3.2" +version = "2.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6dbe3c979c178231552ecba20214a8272df4e09f232a87aef4320cf06539aded" +checksum = "b4682ae6287fcf752ecaabbfcc7b6f9b72aa33933dc23a554d853aea8eea8635" [[package]] name = "bytes" -version = "1.1.0" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c4872d67bab6358e59559027aa3b9157c53d9358c51423c17554809a8858e0f8" +checksum = "a2bd12c1caf447e69cd4528f47f94d203fd2582878ecb9e9465484c4148a8223" + +[[package]] +name = "equivalent" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" [[package]] name = "fnv" @@ -40,19 +46,18 @@ checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" [[package]] name = "form_urlencoded" -version = "1.0.1" +version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5fc25a87fa4fd2094bffb06925852034d90a17f0d1e05197d4956d3555752191" +checksum = "a62bc1cf6f830c2ec14a513a9fb124d0a213a629668a4186f329db21fe045652" dependencies = [ - "matches", "percent-encoding", ] [[package]] name = "hashbrown" -version = "0.12.3" +version = "0.14.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" +checksum = "7dfda62a12f55daeae5015f81b0baea145391cb4520f86c248fc615d72640d12" [[package]] name = "heck" @@ -65,9 +70,9 @@ dependencies = [ [[package]] name = "http" -version = "0.2.6" +version = "0.2.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "31f4c6746584866f0feabcc69893c5b51beef3831656a968ed7ae254cdc4fd03" +checksum = "bd6effc99afb63425aff9b05836f029929e345a6148a14b7ecd5ab67af944482" dependencies = [ "bytes", "fnv", @@ -82,31 +87,30 @@ checksum = "25a2bc672d1148e28034f176e01fffebb08b35768468cc954630da77a1449005" [[package]] name = "idna" -version = "0.2.3" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "418a0a6fab821475f634efe3ccc45c013f742efe03d853e8d3355d5cb850ecf8" +checksum = "7d20d6b07bfbc108882d88ed8e37d39636dcc260e15e30c45e6ba089610b917c" dependencies = [ - "matches", "unicode-bidi", "unicode-normalization", ] [[package]] name = "indexmap" -version = "1.9.3" +version = "2.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bd070e393353796e801d209ad339e89596eb4c8d430d18ede6a1cced8fafbd99" +checksum = "8adf3ddd720272c6ea8bf59463c04e0f93d0bbf7c5439b691bca2987e0270897" dependencies = [ - "autocfg", + "equivalent", "hashbrown", "serde", ] [[package]] name = "itoa" -version = "1.0.1" +version = "1.0.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1aab8fc367588b89dcee83ab0fd66b72b50b72fa1904d7095045ace2b0c81c35" +checksum = "af150ab688ff2122fcef229be89cb50dd66af9e01a4ff320cc137eecc9bacc38" [[package]] name = "leb128" @@ -116,42 +120,36 @@ checksum = "884e2677b40cc8c339eaefcb701c32ef1fd2493d71118dc0ca4b6a736c93bd67" [[package]] name = "log" -version = "0.4.19" +version = "0.4.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b06a4cde4c0f271a446782e3eff8de789548ce57dbc8eca9292c27f4a42004b4" - -[[package]] -name = "matches" -version = "0.1.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a3e378b66a060d48947b590737b30a1be76706c8dd7b8ba0f2fe3989c68a853f" +checksum = "b5e6163cb8c49088c2c36f57875e58ccd8c87c7427f7fbd50ea6710b2f3f2e8f" [[package]] name = "memchr" -version = "2.4.1" +version = "2.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "308cc39be01b73d0d18f82a0e7b2a3df85245f84af96fdddc5d202d27e47b86a" +checksum = "f665ee40bc4a3c5590afb1e9677db74a508659dfd71e126420da8274909a0167" [[package]] name = "percent-encoding" -version = "2.1.0" +version = "2.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d4fd5641d01c8f18a23da7b6fe29298ff4b55afcccdf78973b24cf3175fee32e" +checksum = "9b2a4787296e9989611394c33f193f676704af1686e70b8f8033ab5ba9a35a94" [[package]] name = "proc-macro2" -version = "1.0.60" +version = "1.0.69" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dec2b086b7a862cf4de201096214fa870344cf922b2b30c167badb3af3195406" +checksum = "134c189feb4956b20f6f547d2cf727d4c0fe06722b20a0eec87ed445a97f92da" dependencies = [ "unicode-ident", ] [[package]] name = "pulldown-cmark" -version = "0.8.0" +version = "0.9.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ffade02495f22453cd593159ea2f59827aae7f53fa8323f756799b670881dcf8" +checksum = "77a1a2f1f0a7ecff9c31abbe177637be0e97a0aef46cf8738ece09327985d998" dependencies = [ "bitflags 1.3.2", "memchr", @@ -160,9 +158,9 @@ dependencies = [ [[package]] name = "quote" -version = "1.0.28" +version = "1.0.33" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1b9ab9c7eadfd8df19006f1cf1a4aed13540ed5cbc047010ece5826e10825488" +checksum = "5267fca4496028628a95160fc423a33e8b2e6af8a5302579e322e4b520293cae" dependencies = [ "proc-macro2", ] @@ -187,32 +185,55 @@ dependencies = [ "spin-sdk", ] +[[package]] +name = "ryu" +version = "1.0.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1ad4cc8da4ef723ed60bced201181d83791ad433213d8c24efffda1eec85d741" + [[package]] name = "semver" -version = "1.0.17" +version = "1.0.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bebd363326d05ec3e2f532ab7660680f3b02130d780c299bca73469d521bc0ed" +checksum = "836fa6a3e1e547f9a2c4040802ec865b5d85f4014efe00555d7090a3dcaa1090" [[package]] name = "serde" -version = "1.0.164" +version = "1.0.188" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9e8c8cf938e98f769bc164923b06dce91cea1751522f46f8466461af04c9027d" +checksum = "cf9e0fcba69a370eed61bcf2b728575f726b50b55cba78064753d708ddc7549e" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.164" +version = "1.0.188" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d9735b638ccc51c28bf6914d90a2e9725b377144fc612c49a611fddd1b631d68" +checksum = "4eca7ac642d82aa35b60049a6eccb4be6be75e599bd2e9adb5f875a737654af2" dependencies = [ "proc-macro2", "quote", - "syn 2.0.18", + "syn 2.0.38", ] +[[package]] +name = "serde_json" +version = "1.0.107" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6b420ce6e3d8bd882e9b243c6eed35dbc9a6110c9769e74b584e0d68d1f20c65" +dependencies = [ + "itoa", + "ryu", + "serde", +] + +[[package]] +name = "smallvec" +version = "1.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "942b4a808e05215192e39f4ab80813e599068285906cc91aa64f923db842bd5a" + [[package]] name = "smartcow" version = "0.2.1" @@ -233,6 +254,15 @@ dependencies = [ "version_check", ] +[[package]] +name = "spdx" +version = "0.10.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b19b32ed6d899ab23174302ff105c1577e45a06b08d4fe0a9dd13ce804bbbf71" +dependencies = [ + "smallvec", +] + [[package]] name = "spin-macro" version = "0.1.0" @@ -242,7 +272,7 @@ dependencies = [ "http", "proc-macro2", "quote", - "syn 1.0.90", + "syn 1.0.109", ] [[package]] @@ -267,20 +297,20 @@ checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" [[package]] name = "syn" -version = "1.0.90" +version = "1.0.109" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "704df27628939572cd88d33f171cd6f896f4eaca85252c6e0a72d8d8287ee86f" +checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237" dependencies = [ "proc-macro2", "quote", - "unicode-xid", + "unicode-ident", ] [[package]] name = "syn" -version = "2.0.18" +version = "2.0.38" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "32d41677bcbe24c20c52e7c70b0d8db04134c5d1066bf98662e2871ad200ea3e" +checksum = "e96b79aaa137db8f61e26363a0c9b47d8b4ec75da28b7d1d614c2303e232408b" dependencies = [ "proc-macro2", "quote", @@ -289,44 +319,44 @@ dependencies = [ [[package]] name = "thiserror" -version = "1.0.37" +version = "1.0.49" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "10deb33631e3c9018b9baf9dcbbc4f737320d2b576bac10f6aefa048fa407e3e" +checksum = "1177e8c6d7ede7afde3585fd2513e611227efd6481bd78d2e82ba1ce16557ed4" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.37" +version = "1.0.49" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "982d17546b47146b28f7c22e3d08465f6b8903d0ea13c1660d9d84a6e7adcdbb" +checksum = "10712f02019e9288794769fba95cd6847df9874d49d871d062172f9dd41bc4cc" dependencies = [ "proc-macro2", "quote", - "syn 1.0.90", + "syn 2.0.38", ] [[package]] name = "tinyvec" -version = "1.5.1" +version = "1.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2c1c1d5a42b6245520c249549ec267180beaffcc0615401ac8e31853d4b6d8d2" +checksum = "87cc5ceb3875bb20c2890005a4e226a4651264a5c75edb2421b52861a0a0cb50" dependencies = [ "tinyvec_macros", ] [[package]] name = "tinyvec_macros" -version = "0.1.0" +version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cda74da7e1a664f795bb1f8a87ec406fb89a02522cf6e50620d016add6dbbf5c" +checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" [[package]] name = "unicase" -version = "2.6.0" +version = "2.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "50f37be617794602aabbeee0be4f259dc1778fabe05e2d67ee8f79326d5cb4f6" +checksum = "f7d2d4dafb69621809a81864c9c1b864479e1235c0dd4e199924b9742439ed89" dependencies = [ "version_check", ] @@ -339,36 +369,36 @@ checksum = "92888ba5573ff080736b3648696b70cafad7d250551175acbaa4e0385b3e1460" [[package]] name = "unicode-ident" -version = "1.0.9" +version = "1.0.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b15811caf2415fb889178633e7724bad2509101cde276048e013b9def5e51fa0" +checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" [[package]] name = "unicode-normalization" -version = "0.1.19" +version = "0.1.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d54590932941a9e9266f0832deed84ebe1bf2e4c9e4a3554d393d18f5e854bf9" +checksum = "5c5713f0fc4b5db668a2ac63cdb7bb4469d8c9fed047b1d0292cc7b0ce2ba921" dependencies = [ "tinyvec", ] [[package]] name = "unicode-segmentation" -version = "1.9.0" +version = "1.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7e8820f5d777f6224dc4be3632222971ac30164d4a258d595640799554ebfd99" +checksum = "1dd624098567895118886609431a7c3b8f516e41d30e0643f03d94592a147e36" [[package]] name = "unicode-xid" -version = "0.2.2" +version = "0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ccb82d61f80a663efe1f787a51b16b5a51e3314d6ac365b08639f52387b33f3" +checksum = "f962df74c8c05a667b5ee8bcf162993134c104e96440b663c8daa176dc772d8c" [[package]] name = "url" -version = "2.3.0" +version = "2.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22fe195a4f217c25b25cb5058ced57059824a678474874038dc88d211bf508d3" +checksum = "143b538f18257fac9cad154828a57c6bf5157e1aa604d4816b5995bf6de87ae5" dependencies = [ "form_urlencoded", "idna", @@ -383,31 +413,33 @@ checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" [[package]] name = "wasm-encoder" -version = "0.29.0" +version = "0.33.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "18c41dbd92eaebf3612a39be316540b8377c871cb9bde6b064af962984912881" +checksum = "34180c89672b3e4825c3a8db4b61a674f1447afd5fe2445b2d22c3d8b6ea086c" dependencies = [ "leb128", ] [[package]] name = "wasm-metadata" -version = "0.8.0" +version = "0.10.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "36e5156581ff4a302405c44ca7c85347563ca431d15f1a773f12c9c7b9a6cdc9" +checksum = "4f2c051ef041d348324b01ff0419f6f6593f094b4897d93c9cf52d5d1ac879ba" dependencies = [ "anyhow", "indexmap", "serde", + "serde_json", + "spdx", "wasm-encoder", "wasmparser", ] [[package]] name = "wasmparser" -version = "0.107.0" +version = "0.113.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "29e3ac9b780c7dda0cac7a52a5d6d2d6707cc6e3451c9db209b6c758f40d7acb" +checksum = "286049849b5a5bd09a8773171be96824afabffc7cc3df6caaf33a38db6cd07ae" dependencies = [ "indexmap", "semver", @@ -415,19 +447,17 @@ dependencies = [ [[package]] name = "wit-bindgen" -version = "0.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "392d16e9e46cc7ca98125bc288dd5e4db469efe8323d3e0dac815ca7f2398522" +version = "0.12.0" +source = "git+https://github.com/bytecodealliance/wit-bindgen?rev=46fba30bb667a3a4962f63b1cc28b84427b49114#46fba30bb667a3a4962f63b1cc28b84427b49114" dependencies = [ - "bitflags 2.3.2", + "bitflags 2.4.0", "wit-bindgen-rust-macro", ] [[package]] name = "wit-bindgen-core" -version = "0.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d422d36cbd78caa0e18c3371628447807c66ee72466b69865ea7e33682598158" +version = "0.12.0" +source = "git+https://github.com/bytecodealliance/wit-bindgen?rev=46fba30bb667a3a4962f63b1cc28b84427b49114#46fba30bb667a3a4962f63b1cc28b84427b49114" dependencies = [ "anyhow", "wit-component", @@ -436,36 +466,25 @@ dependencies = [ [[package]] name = "wit-bindgen-rust" -version = "0.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b76db68264f5d2089dc4652581236d8e75c5b89338de6187716215fd0e68ba3" +version = "0.12.0" +source = "git+https://github.com/bytecodealliance/wit-bindgen?rev=46fba30bb667a3a4962f63b1cc28b84427b49114#46fba30bb667a3a4962f63b1cc28b84427b49114" dependencies = [ + "anyhow", "heck", "wasm-metadata", "wit-bindgen-core", - "wit-bindgen-rust-lib", "wit-component", ] -[[package]] -name = "wit-bindgen-rust-lib" -version = "0.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1c50f334bc08b0903a43387f6eea6ef6aa9eb2a085729f1677b29992ecef20ba" -dependencies = [ - "heck", - "wit-bindgen-core", -] - [[package]] name = "wit-bindgen-rust-macro" -version = "0.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ced38a5e174940c6a41ae587babeadfd2e2c2dc32f3b6488bcdca0e8922cf3f3" +version = "0.12.0" +source = "git+https://github.com/bytecodealliance/wit-bindgen?rev=46fba30bb667a3a4962f63b1cc28b84427b49114#46fba30bb667a3a4962f63b1cc28b84427b49114" dependencies = [ "anyhow", "proc-macro2", - "syn 2.0.18", + "quote", + "syn 2.0.38", "wit-bindgen-core", "wit-bindgen-rust", "wit-component", @@ -473,14 +492,16 @@ dependencies = [ [[package]] name = "wit-component" -version = "0.11.0" +version = "0.14.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7cbd4c7f8f400327c482c88571f373844b7889e61460650d650fc5881bb3575c" +checksum = "2e2bf941487fc5afa9e3fc94761f6b80ecef5a2bed6239b959d23d9de69e3448" dependencies = [ "anyhow", - "bitflags 1.3.2", + "bitflags 2.4.0", "indexmap", "log", + "serde", + "serde_json", "wasm-encoder", "wasm-metadata", "wasmparser", @@ -489,9 +510,9 @@ dependencies = [ [[package]] name = "wit-parser" -version = "0.8.0" +version = "0.11.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6daec9f093dbaea0e94043eeb92ece327bbbe70c86b1f41aca9bbfefd7f050f0" +checksum = "a39edca9abb16309def3843af73b58d47d243fe33a9ceee572446bcc57556b9a" dependencies = [ "anyhow", "id-arena", @@ -499,6 +520,8 @@ dependencies = [ "log", "pulldown-cmark", "semver", + "serde", + "serde_json", "unicode-xid", "url", ] diff --git a/examples/rust-outbound-redis/Cargo.lock b/examples/rust-outbound-redis/Cargo.lock index 7ff925548e..782ec93c48 100644 --- a/examples/rust-outbound-redis/Cargo.lock +++ b/examples/rust-outbound-redis/Cargo.lock @@ -4,9 +4,9 @@ version = 3 [[package]] name = "anyhow" -version = "1.0.71" +version = "1.0.75" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c7d0618f0e0b7e8ff11427422b64564d5fb0be1940354bfe2e0529b18a9d9b8" +checksum = "a4668cab20f66d8d020e1fbc0ebe47217433c1b6c8f2040faf858554e394ace6" [[package]] name = "autocfg" @@ -22,15 +22,21 @@ checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" [[package]] name = "bitflags" -version = "2.3.2" +version = "2.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6dbe3c979c178231552ecba20214a8272df4e09f232a87aef4320cf06539aded" +checksum = "b4682ae6287fcf752ecaabbfcc7b6f9b72aa33933dc23a554d853aea8eea8635" [[package]] name = "bytes" -version = "1.1.0" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c4872d67bab6358e59559027aa3b9157c53d9358c51423c17554809a8858e0f8" +checksum = "a2bd12c1caf447e69cd4528f47f94d203fd2582878ecb9e9465484c4148a8223" + +[[package]] +name = "equivalent" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" [[package]] name = "fnv" @@ -40,19 +46,18 @@ checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" [[package]] name = "form_urlencoded" -version = "1.0.1" +version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5fc25a87fa4fd2094bffb06925852034d90a17f0d1e05197d4956d3555752191" +checksum = "a62bc1cf6f830c2ec14a513a9fb124d0a213a629668a4186f329db21fe045652" dependencies = [ - "matches", "percent-encoding", ] [[package]] name = "hashbrown" -version = "0.12.3" +version = "0.14.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" +checksum = "7dfda62a12f55daeae5015f81b0baea145391cb4520f86c248fc615d72640d12" [[package]] name = "heck" @@ -65,9 +70,9 @@ dependencies = [ [[package]] name = "http" -version = "0.2.6" +version = "0.2.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "31f4c6746584866f0feabcc69893c5b51beef3831656a968ed7ae254cdc4fd03" +checksum = "bd6effc99afb63425aff9b05836f029929e345a6148a14b7ecd5ab67af944482" dependencies = [ "bytes", "fnv", @@ -82,31 +87,30 @@ checksum = "25a2bc672d1148e28034f176e01fffebb08b35768468cc954630da77a1449005" [[package]] name = "idna" -version = "0.2.3" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "418a0a6fab821475f634efe3ccc45c013f742efe03d853e8d3355d5cb850ecf8" +checksum = "7d20d6b07bfbc108882d88ed8e37d39636dcc260e15e30c45e6ba089610b917c" dependencies = [ - "matches", "unicode-bidi", "unicode-normalization", ] [[package]] name = "indexmap" -version = "1.9.3" +version = "2.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bd070e393353796e801d209ad339e89596eb4c8d430d18ede6a1cced8fafbd99" +checksum = "8adf3ddd720272c6ea8bf59463c04e0f93d0bbf7c5439b691bca2987e0270897" dependencies = [ - "autocfg", + "equivalent", "hashbrown", "serde", ] [[package]] name = "itoa" -version = "1.0.1" +version = "1.0.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1aab8fc367588b89dcee83ab0fd66b72b50b72fa1904d7095045ace2b0c81c35" +checksum = "af150ab688ff2122fcef229be89cb50dd66af9e01a4ff320cc137eecc9bacc38" [[package]] name = "leb128" @@ -116,42 +120,36 @@ checksum = "884e2677b40cc8c339eaefcb701c32ef1fd2493d71118dc0ca4b6a736c93bd67" [[package]] name = "log" -version = "0.4.19" +version = "0.4.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b06a4cde4c0f271a446782e3eff8de789548ce57dbc8eca9292c27f4a42004b4" - -[[package]] -name = "matches" -version = "0.1.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a3e378b66a060d48947b590737b30a1be76706c8dd7b8ba0f2fe3989c68a853f" +checksum = "b5e6163cb8c49088c2c36f57875e58ccd8c87c7427f7fbd50ea6710b2f3f2e8f" [[package]] name = "memchr" -version = "2.4.1" +version = "2.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "308cc39be01b73d0d18f82a0e7b2a3df85245f84af96fdddc5d202d27e47b86a" +checksum = "f665ee40bc4a3c5590afb1e9677db74a508659dfd71e126420da8274909a0167" [[package]] name = "percent-encoding" -version = "2.1.0" +version = "2.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d4fd5641d01c8f18a23da7b6fe29298ff4b55afcccdf78973b24cf3175fee32e" +checksum = "9b2a4787296e9989611394c33f193f676704af1686e70b8f8033ab5ba9a35a94" [[package]] name = "proc-macro2" -version = "1.0.60" +version = "1.0.69" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dec2b086b7a862cf4de201096214fa870344cf922b2b30c167badb3af3195406" +checksum = "134c189feb4956b20f6f547d2cf727d4c0fe06722b20a0eec87ed445a97f92da" dependencies = [ "unicode-ident", ] [[package]] name = "pulldown-cmark" -version = "0.8.0" +version = "0.9.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ffade02495f22453cd593159ea2f59827aae7f53fa8323f756799b670881dcf8" +checksum = "77a1a2f1f0a7ecff9c31abbe177637be0e97a0aef46cf8738ece09327985d998" dependencies = [ "bitflags 1.3.2", "memchr", @@ -160,9 +158,9 @@ dependencies = [ [[package]] name = "quote" -version = "1.0.28" +version = "1.0.33" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1b9ab9c7eadfd8df19006f1cf1a4aed13540ed5cbc047010ece5826e10825488" +checksum = "5267fca4496028628a95160fc423a33e8b2e6af8a5302579e322e4b520293cae" dependencies = [ "proc-macro2", ] @@ -187,32 +185,55 @@ dependencies = [ "spin-sdk", ] +[[package]] +name = "ryu" +version = "1.0.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1ad4cc8da4ef723ed60bced201181d83791ad433213d8c24efffda1eec85d741" + [[package]] name = "semver" -version = "1.0.17" +version = "1.0.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bebd363326d05ec3e2f532ab7660680f3b02130d780c299bca73469d521bc0ed" +checksum = "836fa6a3e1e547f9a2c4040802ec865b5d85f4014efe00555d7090a3dcaa1090" [[package]] name = "serde" -version = "1.0.164" +version = "1.0.188" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9e8c8cf938e98f769bc164923b06dce91cea1751522f46f8466461af04c9027d" +checksum = "cf9e0fcba69a370eed61bcf2b728575f726b50b55cba78064753d708ddc7549e" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.164" +version = "1.0.188" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d9735b638ccc51c28bf6914d90a2e9725b377144fc612c49a611fddd1b631d68" +checksum = "4eca7ac642d82aa35b60049a6eccb4be6be75e599bd2e9adb5f875a737654af2" dependencies = [ "proc-macro2", "quote", - "syn 2.0.18", + "syn 2.0.38", ] +[[package]] +name = "serde_json" +version = "1.0.107" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6b420ce6e3d8bd882e9b243c6eed35dbc9a6110c9769e74b584e0d68d1f20c65" +dependencies = [ + "itoa", + "ryu", + "serde", +] + +[[package]] +name = "smallvec" +version = "1.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "942b4a808e05215192e39f4ab80813e599068285906cc91aa64f923db842bd5a" + [[package]] name = "smartcow" version = "0.2.1" @@ -233,6 +254,15 @@ dependencies = [ "version_check", ] +[[package]] +name = "spdx" +version = "0.10.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b19b32ed6d899ab23174302ff105c1577e45a06b08d4fe0a9dd13ce804bbbf71" +dependencies = [ + "smallvec", +] + [[package]] name = "spin-macro" version = "0.1.0" @@ -242,7 +272,7 @@ dependencies = [ "http", "proc-macro2", "quote", - "syn 1.0.90", + "syn 1.0.109", ] [[package]] @@ -267,20 +297,20 @@ checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" [[package]] name = "syn" -version = "1.0.90" +version = "1.0.109" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "704df27628939572cd88d33f171cd6f896f4eaca85252c6e0a72d8d8287ee86f" +checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237" dependencies = [ "proc-macro2", "quote", - "unicode-xid", + "unicode-ident", ] [[package]] name = "syn" -version = "2.0.18" +version = "2.0.38" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "32d41677bcbe24c20c52e7c70b0d8db04134c5d1066bf98662e2871ad200ea3e" +checksum = "e96b79aaa137db8f61e26363a0c9b47d8b4ec75da28b7d1d614c2303e232408b" dependencies = [ "proc-macro2", "quote", @@ -289,44 +319,44 @@ dependencies = [ [[package]] name = "thiserror" -version = "1.0.37" +version = "1.0.49" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "10deb33631e3c9018b9baf9dcbbc4f737320d2b576bac10f6aefa048fa407e3e" +checksum = "1177e8c6d7ede7afde3585fd2513e611227efd6481bd78d2e82ba1ce16557ed4" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.37" +version = "1.0.49" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "982d17546b47146b28f7c22e3d08465f6b8903d0ea13c1660d9d84a6e7adcdbb" +checksum = "10712f02019e9288794769fba95cd6847df9874d49d871d062172f9dd41bc4cc" dependencies = [ "proc-macro2", "quote", - "syn 1.0.90", + "syn 2.0.38", ] [[package]] name = "tinyvec" -version = "1.5.1" +version = "1.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2c1c1d5a42b6245520c249549ec267180beaffcc0615401ac8e31853d4b6d8d2" +checksum = "87cc5ceb3875bb20c2890005a4e226a4651264a5c75edb2421b52861a0a0cb50" dependencies = [ "tinyvec_macros", ] [[package]] name = "tinyvec_macros" -version = "0.1.0" +version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cda74da7e1a664f795bb1f8a87ec406fb89a02522cf6e50620d016add6dbbf5c" +checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" [[package]] name = "unicase" -version = "2.6.0" +version = "2.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "50f37be617794602aabbeee0be4f259dc1778fabe05e2d67ee8f79326d5cb4f6" +checksum = "f7d2d4dafb69621809a81864c9c1b864479e1235c0dd4e199924b9742439ed89" dependencies = [ "version_check", ] @@ -339,36 +369,36 @@ checksum = "92888ba5573ff080736b3648696b70cafad7d250551175acbaa4e0385b3e1460" [[package]] name = "unicode-ident" -version = "1.0.9" +version = "1.0.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b15811caf2415fb889178633e7724bad2509101cde276048e013b9def5e51fa0" +checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" [[package]] name = "unicode-normalization" -version = "0.1.19" +version = "0.1.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d54590932941a9e9266f0832deed84ebe1bf2e4c9e4a3554d393d18f5e854bf9" +checksum = "5c5713f0fc4b5db668a2ac63cdb7bb4469d8c9fed047b1d0292cc7b0ce2ba921" dependencies = [ "tinyvec", ] [[package]] name = "unicode-segmentation" -version = "1.9.0" +version = "1.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7e8820f5d777f6224dc4be3632222971ac30164d4a258d595640799554ebfd99" +checksum = "1dd624098567895118886609431a7c3b8f516e41d30e0643f03d94592a147e36" [[package]] name = "unicode-xid" -version = "0.2.2" +version = "0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ccb82d61f80a663efe1f787a51b16b5a51e3314d6ac365b08639f52387b33f3" +checksum = "f962df74c8c05a667b5ee8bcf162993134c104e96440b663c8daa176dc772d8c" [[package]] name = "url" -version = "2.3.0" +version = "2.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22fe195a4f217c25b25cb5058ced57059824a678474874038dc88d211bf508d3" +checksum = "143b538f18257fac9cad154828a57c6bf5157e1aa604d4816b5995bf6de87ae5" dependencies = [ "form_urlencoded", "idna", @@ -383,31 +413,33 @@ checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" [[package]] name = "wasm-encoder" -version = "0.29.0" +version = "0.33.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "18c41dbd92eaebf3612a39be316540b8377c871cb9bde6b064af962984912881" +checksum = "34180c89672b3e4825c3a8db4b61a674f1447afd5fe2445b2d22c3d8b6ea086c" dependencies = [ "leb128", ] [[package]] name = "wasm-metadata" -version = "0.8.0" +version = "0.10.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "36e5156581ff4a302405c44ca7c85347563ca431d15f1a773f12c9c7b9a6cdc9" +checksum = "4f2c051ef041d348324b01ff0419f6f6593f094b4897d93c9cf52d5d1ac879ba" dependencies = [ "anyhow", "indexmap", "serde", + "serde_json", + "spdx", "wasm-encoder", "wasmparser", ] [[package]] name = "wasmparser" -version = "0.107.0" +version = "0.113.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "29e3ac9b780c7dda0cac7a52a5d6d2d6707cc6e3451c9db209b6c758f40d7acb" +checksum = "286049849b5a5bd09a8773171be96824afabffc7cc3df6caaf33a38db6cd07ae" dependencies = [ "indexmap", "semver", @@ -415,19 +447,17 @@ dependencies = [ [[package]] name = "wit-bindgen" -version = "0.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "392d16e9e46cc7ca98125bc288dd5e4db469efe8323d3e0dac815ca7f2398522" +version = "0.12.0" +source = "git+https://github.com/bytecodealliance/wit-bindgen?rev=46fba30bb667a3a4962f63b1cc28b84427b49114#46fba30bb667a3a4962f63b1cc28b84427b49114" dependencies = [ - "bitflags 2.3.2", + "bitflags 2.4.0", "wit-bindgen-rust-macro", ] [[package]] name = "wit-bindgen-core" -version = "0.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d422d36cbd78caa0e18c3371628447807c66ee72466b69865ea7e33682598158" +version = "0.12.0" +source = "git+https://github.com/bytecodealliance/wit-bindgen?rev=46fba30bb667a3a4962f63b1cc28b84427b49114#46fba30bb667a3a4962f63b1cc28b84427b49114" dependencies = [ "anyhow", "wit-component", @@ -436,36 +466,25 @@ dependencies = [ [[package]] name = "wit-bindgen-rust" -version = "0.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b76db68264f5d2089dc4652581236d8e75c5b89338de6187716215fd0e68ba3" +version = "0.12.0" +source = "git+https://github.com/bytecodealliance/wit-bindgen?rev=46fba30bb667a3a4962f63b1cc28b84427b49114#46fba30bb667a3a4962f63b1cc28b84427b49114" dependencies = [ + "anyhow", "heck", "wasm-metadata", "wit-bindgen-core", - "wit-bindgen-rust-lib", "wit-component", ] -[[package]] -name = "wit-bindgen-rust-lib" -version = "0.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1c50f334bc08b0903a43387f6eea6ef6aa9eb2a085729f1677b29992ecef20ba" -dependencies = [ - "heck", - "wit-bindgen-core", -] - [[package]] name = "wit-bindgen-rust-macro" -version = "0.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ced38a5e174940c6a41ae587babeadfd2e2c2dc32f3b6488bcdca0e8922cf3f3" +version = "0.12.0" +source = "git+https://github.com/bytecodealliance/wit-bindgen?rev=46fba30bb667a3a4962f63b1cc28b84427b49114#46fba30bb667a3a4962f63b1cc28b84427b49114" dependencies = [ "anyhow", "proc-macro2", - "syn 2.0.18", + "quote", + "syn 2.0.38", "wit-bindgen-core", "wit-bindgen-rust", "wit-component", @@ -473,14 +492,16 @@ dependencies = [ [[package]] name = "wit-component" -version = "0.11.0" +version = "0.14.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7cbd4c7f8f400327c482c88571f373844b7889e61460650d650fc5881bb3575c" +checksum = "2e2bf941487fc5afa9e3fc94761f6b80ecef5a2bed6239b959d23d9de69e3448" dependencies = [ "anyhow", - "bitflags 1.3.2", + "bitflags 2.4.0", "indexmap", "log", + "serde", + "serde_json", "wasm-encoder", "wasm-metadata", "wasmparser", @@ -489,9 +510,9 @@ dependencies = [ [[package]] name = "wit-parser" -version = "0.8.0" +version = "0.11.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6daec9f093dbaea0e94043eeb92ece327bbbe70c86b1f41aca9bbfefd7f050f0" +checksum = "a39edca9abb16309def3843af73b58d47d243fe33a9ceee572446bcc57556b9a" dependencies = [ "anyhow", "id-arena", @@ -499,6 +520,8 @@ dependencies = [ "log", "pulldown-cmark", "semver", + "serde", + "serde_json", "unicode-xid", "url", ] diff --git a/examples/rust-outbound-redis/src/lib.rs b/examples/rust-outbound-redis/src/lib.rs index a36ce33ef2..7eb3f230c5 100644 --- a/examples/rust-outbound-redis/src/lib.rs +++ b/examples/rust-outbound-redis/src/lib.rs @@ -26,11 +26,11 @@ fn publish(_req: Request) -> Result { let payload = redis::get(&address, "mykey").map_err(|_| anyhow!("Error querying Redis"))?; // Set the Redis key "spin-example" to value "Eureka!" - redis::set(&address, "spin-example", &b"Eureka!"[..]) + redis::set(&address, "spin-example", &"Eureka!".to_owned().into_bytes()) .map_err(|_| anyhow!("Error executing Redis set command"))?; // Set the Redis key "int-key" to value 0 - redis::set(&address, "int-key", format!("{:x}", 0).as_bytes()) + redis::set(&address, "int-key", &format!("{:x}", 0).into_bytes()) .map_err(|_| anyhow!("Error executing Redis set command"))?; let int_value = redis::incr(&address, "int-key") .map_err(|_| anyhow!("Error executing Redis incr command",))?; diff --git a/examples/spin-timer/Cargo.lock b/examples/spin-timer/Cargo.lock index 3566d96615..b0fc4f1110 100644 --- a/examples/spin-timer/Cargo.lock +++ b/examples/spin-timer/Cargo.lock @@ -28,17 +28,6 @@ dependencies = [ "cpufeatures", ] -[[package]] -name = "ahash" -version = "0.7.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fcb51a0695d8f838b1ee009b3fbf66bda078cd64590202a864a8f3e8c4315c47" -dependencies = [ - "getrandom 0.2.8", - "once_cell", - "version_check", -] - [[package]] name = "ahash" version = "0.8.3" @@ -61,9 +50,9 @@ dependencies = [ [[package]] name = "aho-corasick" -version = "1.0.5" +version = "1.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c378d78423fdad8089616f827526ee33c19f2fddbd5de1629152c9593ba4783" +checksum = "b2969dcb958b36655471fc61f7e416fa76033bdd4bfed0678d8fee1e2d07a1f0" dependencies = [ "memchr", ] @@ -74,6 +63,12 @@ version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "250f629c0161ad8107cf89319e990051fae62832fd343083bea452d93e2205fd" +[[package]] +name = "allocator-api2" +version = "0.2.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0942ffc6dcaadf03badf6e6a2d0228460359d5e34b57ccdc720b7382dfbd5ec5" + [[package]] name = "ambient-authority" version = "0.0.2" @@ -82,9 +77,9 @@ checksum = "e9d4ee0d472d1cd2e28c97dfa124b3d8d992e10eb0a035f33f5d12e3a177ba3b" [[package]] name = "anyhow" -version = "1.0.71" +version = "1.0.75" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c7d0618f0e0b7e8ff11427422b64564d5fb0be1940354bfe2e0529b18a9d9b8" +checksum = "a4668cab20f66d8d020e1fbc0ebe47217433c1b6c8f2040faf858554e394ace6" [[package]] name = "arbitrary" @@ -94,9 +89,9 @@ checksum = "e2d098ff73c1ca148721f37baad5ea6a465a13f9573aba8641fbbbae8164a54e" [[package]] name = "async-channel" -version = "1.8.0" +version = "1.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf46fee83e5ccffc220104713af3292ff9bc7c64c7de289f66dae8e38d826833" +checksum = "81953c529336010edd6d8e358f886d9581267795c61b19475b71314bffa46d35" dependencies = [ "concurrent-queue", "event-listener", @@ -105,9 +100,9 @@ dependencies = [ [[package]] name = "async-compression" -version = "0.3.15" +version = "0.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "942c7cd7ae39e91bde4820d74132e9862e62c2f386c3aa90ccf55949f5bad63a" +checksum = "bb42b2197bf15ccb092b62c74515dbd8b86d0effd934795f6687c93b6e679a2c" dependencies = [ "flate2", "futures-core", @@ -124,7 +119,7 @@ checksum = "bc00ceb34980c03614e35a3a4e218276a0a824e911d07651cd0d858a51e8c0f0" dependencies = [ "proc-macro2", "quote", - "syn 2.0.31", + "syn 2.0.38", ] [[package]] @@ -155,7 +150,7 @@ dependencies = [ "bytes", "dyn-clone", "futures", - "getrandom 0.2.8", + "getrandom 0.2.10", "http-types", "log", "paste", @@ -201,7 +196,7 @@ dependencies = [ "cc", "cfg-if", "libc", - "miniz_oxide 0.7.1", + "miniz_oxide", "object", "rustc-demangle", ] @@ -235,11 +230,11 @@ dependencies = [ [[package]] name = "bindgen" -version = "0.59.2" +version = "0.68.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2bd2a9a458e8f4304c52c43ebb0cfbd520289f8379a52e329a38afda99bf8eb8" +checksum = "726e4313eb6ec35d2730258ad4e15b547ee75d6afaa1361a922e78e59b7d8078" dependencies = [ - "bitflags 1.3.2", + "bitflags 2.4.0", "cexpr", "clang-sys", "lazy_static", @@ -250,6 +245,7 @@ dependencies = [ "regex", "rustc-hash", "shlex", + "syn 2.0.38", ] [[package]] @@ -278,36 +274,36 @@ dependencies = [ [[package]] name = "block-buffer" -version = "0.10.3" +version = "0.10.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "69cce20737498f97b993470a6e536b8523f0af7892a4f928cceb1ac5e52ebe7e" +checksum = "3078c7629b62d3f0439517fa394996acacc5cbc91c5a20d8c658e77abd503a71" dependencies = [ "generic-array", ] [[package]] name = "bumpalo" -version = "3.12.0" +version = "3.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0d261e256854913907f67ed06efbc3338dfe6179796deefc1ff763fc1aee5535" +checksum = "7f30e7476521f6f8af1a1c4c0b8cc94f0bee37d91763d0ca2665f299b6cd8aec" [[package]] name = "bytemuck" -version = "1.13.1" +version = "1.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "17febce684fd15d89027105661fec94afb475cb995fbc59d2865198446ba2eea" +checksum = "374d28ec25809ee0e23827c2ab573d729e293f281dfe393500e7ad618baa61c6" [[package]] name = "byteorder" -version = "1.4.3" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "14c189c53d098945499cdfa7ecc63567cf3886b3332b312a5b4585d8d3a6a610" +checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" [[package]] name = "bytes" -version = "1.4.0" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "89b2fd2a0dcf38d7971e2194b6b6eebab45ae01067456a7fd93d5547a61b70be" +checksum = "a2bd12c1caf447e69cd4528f47f94d203fd2582878ecb9e9465484c4148a8223" [[package]] name = "bytesize" @@ -378,7 +374,7 @@ checksum = "6ffc30dee200c20b4dcb80572226f42658e1d9c4b668656d7cc59c33d50e396e" dependencies = [ "cap-primitives", "cap-std", - "rustix 0.38.13", + "rustix 0.38.18", "smallvec", ] @@ -394,7 +390,7 @@ dependencies = [ "io-lifetimes 2.0.2", "ipnet", "maybe-owned", - "rustix 0.38.13", + "rustix 0.38.18", "windows-sys 0.48.0", "winx", ] @@ -418,7 +414,7 @@ dependencies = [ "cap-primitives", "io-extras", "io-lifetimes 2.0.2", - "rustix 0.38.13", + "rustix 0.38.18", ] [[package]] @@ -429,17 +425,18 @@ checksum = "f8f52b3c8f4abfe3252fd0a071f3004aaa3b18936ec97bdbd8763ce03aff6247" dependencies = [ "cap-primitives", "once_cell", - "rustix 0.38.13", + "rustix 0.38.18", "winx", ] [[package]] name = "cc" -version = "1.0.78" +version = "1.0.83" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a20104e2335ce8a659d6dd92a51a767a0c062599c73b343fd152cb401e828c3d" +checksum = "f1174fb0b6ec23863f8b971027804a42614e347eafb0a95bf0b12cdae21fc4d0" dependencies = [ "jobserver", + "libc", ] [[package]] @@ -469,9 +466,9 @@ dependencies = [ [[package]] name = "clang-sys" -version = "1.4.0" +version = "1.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fa2e27ae6ab525c3d369ded447057bca5438d86dc3a68f6faafb8269ba82ebf3" +checksum = "c688fc74432808e3eb684cae8830a86be1d66a2bd58e1f248ed0960a590baf6f" dependencies = [ "glob", "libc", @@ -480,15 +477,15 @@ dependencies = [ [[package]] name = "clap" -version = "3.2.23" +version = "3.2.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "71655c45cb9845d3270c9d6df84ebe72b4dad3c2ba3f7023ad47c144e4e473a5" +checksum = "4ea181bf566f71cb9a5d17a59e1871af638180a18fb0035c92ae62b705207123" dependencies = [ "atty", "bitflags 1.3.2", "clap_derive", "clap_lex", - "indexmap 1.9.2", + "indexmap 1.9.3", "once_cell", "strsim", "termcolor", @@ -497,15 +494,15 @@ dependencies = [ [[package]] name = "clap_derive" -version = "3.2.18" +version = "3.2.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ea0c8bce528c4be4da13ea6fead8965e95b6073585a2f05204bd8f4119f82a65" +checksum = "ae6371b8bdc8b7d3959e9cf7b22d4435ef3e79e138688421ec654acf8c81b008" dependencies = [ "heck", "proc-macro-error", "proc-macro2", "quote", - "syn 1.0.107", + "syn 1.0.109", ] [[package]] @@ -519,9 +516,9 @@ dependencies = [ [[package]] name = "cmake" -version = "0.1.49" +version = "0.1.50" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "db34956e100b30725f2eb215f90d4871051239535632f84fea3bc92722c66b7c" +checksum = "a31c789563b815f77f4250caee12365734369f942439b7defd71e18a48197130" dependencies = [ "cc", ] @@ -537,14 +534,14 @@ dependencies = [ "memchr", "pin-project-lite", "tokio", - "tokio-util 0.7.4", + "tokio-util 0.7.9", ] [[package]] name = "concurrent-queue" -version = "2.2.0" +version = "2.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62ec6771ecfa0762d24683ee5a32ad78487a3d3afdc0fb8cae19d2c5deb50b7c" +checksum = "f057a694a54f12365049b0958a1685bb52d567f5593b355fbf685838e873d400" dependencies = [ "crossbeam-utils", ] @@ -579,9 +576,9 @@ dependencies = [ [[package]] name = "core-foundation-sys" -version = "0.8.3" +version = "0.8.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5827cebf4670468b8772dd191856768aedcb1b0278a04f989f7766351917b9dc" +checksum = "e496a50fda8aacccc86d7529e2c1e0892dbd0f898a6b5645b5561b89c3210efa" [[package]] name = "cpp_demangle" @@ -594,27 +591,25 @@ dependencies = [ [[package]] name = "cpufeatures" -version = "0.2.5" +version = "0.2.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "28d997bd5e24a5928dd43e46dc529867e207907fe0b239c3477d924f7f2ca320" +checksum = "a17b76ff3a4162b0b27f354a0c87015ddad39d35f9c0c36607a3bdd175dde1f1" dependencies = [ "libc", ] [[package]] name = "cranelift-bforest" -version = "0.100.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "03b9d1a9e776c27ad55d7792a380785d1fe8c2d7b099eed8dbd8f4af2b598192" +version = "0.102.0" +source = "git+https://github.com/bytecodealliance/wasmtime?rev=4c34504efb258a0c51c6a5f3f8a5b24d987993b9#4c34504efb258a0c51c6a5f3f8a5b24d987993b9" dependencies = [ "cranelift-entity", ] [[package]] name = "cranelift-codegen" -version = "0.100.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5528483314c2dd5da438576cd8a9d0b3cedad66fb8a4727f90cd319a81950038" +version = "0.102.0" +source = "git+https://github.com/bytecodealliance/wasmtime?rev=4c34504efb258a0c51c6a5f3f8a5b24d987993b9#4c34504efb258a0c51c6a5f3f8a5b24d987993b9" dependencies = [ "bumpalo", "cranelift-bforest", @@ -624,7 +619,7 @@ dependencies = [ "cranelift-entity", "cranelift-isle", "gimli", - "hashbrown 0.14.0", + "hashbrown 0.14.1", "log", "regalloc2", "smallvec", @@ -633,33 +628,29 @@ dependencies = [ [[package]] name = "cranelift-codegen-meta" -version = "0.100.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f46a8318163f7682e35b8730ba93c1b586a2da8ce12a0ed545efc1218550f70" +version = "0.102.0" +source = "git+https://github.com/bytecodealliance/wasmtime?rev=4c34504efb258a0c51c6a5f3f8a5b24d987993b9#4c34504efb258a0c51c6a5f3f8a5b24d987993b9" dependencies = [ "cranelift-codegen-shared", ] [[package]] name = "cranelift-codegen-shared" -version = "0.100.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "37d1239cfd50eecfaed468d46943f8650e32969591868ad50111613704da6c70" +version = "0.102.0" +source = "git+https://github.com/bytecodealliance/wasmtime?rev=4c34504efb258a0c51c6a5f3f8a5b24d987993b9#4c34504efb258a0c51c6a5f3f8a5b24d987993b9" [[package]] name = "cranelift-control" -version = "0.100.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bcc530560c8f16cc1d4dd7ea000c56f519c60d1a914977abe849ce555c35a61d" +version = "0.102.0" +source = "git+https://github.com/bytecodealliance/wasmtime?rev=4c34504efb258a0c51c6a5f3f8a5b24d987993b9#4c34504efb258a0c51c6a5f3f8a5b24d987993b9" dependencies = [ "arbitrary", ] [[package]] name = "cranelift-entity" -version = "0.100.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f333fa641a9ad2bff0b107767dcb972c18c2bfab7969805a1d7e42449ccb0408" +version = "0.102.0" +source = "git+https://github.com/bytecodealliance/wasmtime?rev=4c34504efb258a0c51c6a5f3f8a5b24d987993b9#4c34504efb258a0c51c6a5f3f8a5b24d987993b9" dependencies = [ "serde", "serde_derive", @@ -667,9 +658,8 @@ dependencies = [ [[package]] name = "cranelift-frontend" -version = "0.100.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "06abf6563015a80f03f8bc4df307d0a81363f4eb73108df3a34f6e66fb6d5307" +version = "0.102.0" +source = "git+https://github.com/bytecodealliance/wasmtime?rev=4c34504efb258a0c51c6a5f3f8a5b24d987993b9#4c34504efb258a0c51c6a5f3f8a5b24d987993b9" dependencies = [ "cranelift-codegen", "log", @@ -679,15 +669,13 @@ dependencies = [ [[package]] name = "cranelift-isle" -version = "0.100.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0eb29d0edc8a5c029ed0f7ca77501f272738e3c410020b4a00f42ffe8ad2a8aa" +version = "0.102.0" +source = "git+https://github.com/bytecodealliance/wasmtime?rev=4c34504efb258a0c51c6a5f3f8a5b24d987993b9#4c34504efb258a0c51c6a5f3f8a5b24d987993b9" [[package]] name = "cranelift-native" -version = "0.100.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "006056a7fa920870bad06bf8e1b3033d70cbb7ee625b035efa9d90882a931868" +version = "0.102.0" +source = "git+https://github.com/bytecodealliance/wasmtime?rev=4c34504efb258a0c51c6a5f3f8a5b24d987993b9#4c34504efb258a0c51c6a5f3f8a5b24d987993b9" dependencies = [ "cranelift-codegen", "libc", @@ -696,9 +684,8 @@ dependencies = [ [[package]] name = "cranelift-wasm" -version = "0.100.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7b3d08c05f82903a1f6a04d89c4b9ecb47a4035710f89a39a21a147a80214672" +version = "0.102.0" +source = "git+https://github.com/bytecodealliance/wasmtime?rev=4c34504efb258a0c51c6a5f3f8a5b24d987993b9#4c34504efb258a0c51c6a5f3f8a5b24d987993b9" dependencies = [ "cranelift-codegen", "cranelift-entity", @@ -735,9 +722,9 @@ dependencies = [ [[package]] name = "crossbeam-channel" -version = "0.5.6" +version = "0.5.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c2dd04ddaf88237dc3b8d8f9a3c1004b506b54b3313403944054d23c0870c521" +checksum = "a33c2bf77f2df06183c3aa30d1e96c0695a313d4f9c453cc3762a6db39f99200" dependencies = [ "cfg-if", "crossbeam-utils", @@ -745,9 +732,9 @@ dependencies = [ [[package]] name = "crossbeam-deque" -version = "0.8.2" +version = "0.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "715e8152b692bba2d374b53d4875445368fdf21a94751410af607a5ac677d1fc" +checksum = "ce6fd6f855243022dcecf8702fef0c297d4338e226845fe067f6341ad9fa0cef" dependencies = [ "cfg-if", "crossbeam-epoch", @@ -756,14 +743,14 @@ dependencies = [ [[package]] name = "crossbeam-epoch" -version = "0.9.13" +version = "0.9.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "01a9af1f4c2ef74bb8aa1f7e19706bc72d03598c8a570bb5de72243c7a9d9d5a" +checksum = "ae211234986c545741a7dc064309f67ee1e5ad243d0e48335adc0484d960bcc7" dependencies = [ "autocfg", "cfg-if", "crossbeam-utils", - "memoffset 0.7.1", + "memoffset", "scopeguard", ] @@ -779,9 +766,9 @@ dependencies = [ [[package]] name = "crossbeam-utils" -version = "0.8.14" +version = "0.8.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4fb766fa798726286dbbb842f174001dab8abc7b627a1dd86e0b7222a95d929f" +checksum = "5a22b2d63d4d1dc0b7f1b6b2747dd0088008a9be28b6ddf0b1e7d335e3037294" dependencies = [ "cfg-if", ] @@ -804,19 +791,19 @@ dependencies = [ [[package]] name = "ctrlc" -version = "3.2.4" +version = "3.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1631ca6e3c59112501a9d87fd86f21591ff77acd31331e8a73f8d80a65bbdd71" +checksum = "82e95fbd621905b854affdc67943b043a0fbb6ed7385fd5a25650d19a8a6cfdf" dependencies = [ "nix", - "windows-sys 0.42.0", + "windows-sys 0.48.0", ] [[package]] name = "darling" -version = "0.14.2" +version = "0.14.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b0dd3cd20dc6b5a876612a6e5accfe7f3dd883db6d07acfbf14c128f61550dfa" +checksum = "7b750cb3417fd1b327431a470f388520309479ab0bf5e323505daf0290cd3850" dependencies = [ "darling_core", "darling_macro", @@ -824,27 +811,27 @@ dependencies = [ [[package]] name = "darling_core" -version = "0.14.2" +version = "0.14.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a784d2ccaf7c98501746bf0be29b2022ba41fd62a2e622af997a03e9f972859f" +checksum = "109c1ca6e6b7f82cc233a97004ea8ed7ca123a9af07a8230878fcfda9b158bf0" dependencies = [ "fnv", "ident_case", "proc-macro2", "quote", "strsim", - "syn 1.0.107", + "syn 1.0.109", ] [[package]] name = "darling_macro" -version = "0.14.2" +version = "0.14.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7618812407e9402654622dd402b0a89dff9ba93badd6540781526117b92aab7e" +checksum = "a4aab4dbc9f7611d8b55048a3a16d2d010c2c8334e46304b40ac1cc14bf3b48e" dependencies = [ "darling_core", "quote", - "syn 1.0.107", + "syn 1.0.109", ] [[package]] @@ -856,6 +843,15 @@ dependencies = [ "uuid", ] +[[package]] +name = "deranged" +version = "0.3.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f2696e8a945f658fd14dc3b87242e6b80cd0f36ff04ea560fa39082368847946" +dependencies = [ + "serde", +] + [[package]] name = "derive_builder" version = "0.11.2" @@ -883,7 +879,7 @@ dependencies = [ "darling", "proc-macro2", "quote", - "syn 1.0.107", + "syn 1.0.109", ] [[package]] @@ -895,7 +891,7 @@ dependencies = [ "darling", "proc-macro2", "quote", - "syn 1.0.107", + "syn 1.0.109", ] [[package]] @@ -905,7 +901,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8f0314b72bed045f3a68671b3c86328386762c93f82d98c65c3cb5e5f573dd68" dependencies = [ "derive_builder_core 0.11.2", - "syn 1.0.107", + "syn 1.0.109", ] [[package]] @@ -915,14 +911,14 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ebcda35c7a396850a55ffeac740804b40ffec779b98fffbb1738f4033f0ee79e" dependencies = [ "derive_builder_core 0.12.0", - "syn 1.0.107", + "syn 1.0.109", ] [[package]] name = "digest" -version = "0.10.6" +version = "0.10.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8168378f4e5023e7218c89c891c0fd8ecdb5e5e4f18cb78f38cf245dd021e76f" +checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292" dependencies = [ "block-buffer", "crypto-common", @@ -945,7 +941,16 @@ version = "4.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ca3aa72a6f96ea37bbc5aa912f6788242832f75369bdfdadcb0e38423f100059" dependencies = [ - "dirs-sys", + "dirs-sys 0.3.7", +] + +[[package]] +name = "dirs" +version = "5.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "44c45a9d03d6676652bcb5e724c7e988de1acad23a711b5217ab9cbecbec2225" +dependencies = [ + "dirs-sys 0.4.1", ] [[package]] @@ -959,6 +964,18 @@ dependencies = [ "winapi", ] +[[package]] +name = "dirs-sys" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "520f05a5cbd335fae5a99ff7a6ab8627577660ee5cfd6a94a6a929b52ff0321c" +dependencies = [ + "libc", + "option-ext", + "redox_users", + "windows-sys 0.48.0", +] + [[package]] name = "dirs-sys-next" version = "0.1.2" @@ -972,27 +989,27 @@ dependencies = [ [[package]] name = "dotenvy" -version = "0.15.6" +version = "0.15.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "03d8c417d7a8cb362e0c37e5d815f5eb7c37f79ff93707329d5a194e42e54ca0" +checksum = "1aaf95b3e5c8f23aa320147307562d361db0ae0d51242340f558153b4eb2439b" [[package]] name = "dunce" -version = "1.0.3" +version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0bd4b30a6560bbd9b4620f4de34c3f14f60848e58a9b7216801afcb4c7b31c3c" +checksum = "56ce8c6da7551ec6c462cbaf3bfbc75131ebbfa1c944aeaa9dab51ca1c5f0c3b" [[package]] name = "dyn-clone" -version = "1.0.11" +version = "1.0.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "68b0cf012f1230e43cd00ebb729c6bb58707ecfa8ad08b52ef3a4ccd2697fc30" +checksum = "23d2f3407d9a573d666de4b5bdf10569d73ca9478087346697dcbae6244bfbcd" [[package]] name = "either" -version = "1.8.0" +version = "1.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "90e5c1c8368803113bf0c9584fc495a58b86dc8a29edbf8fe877d21d9507e797" +checksum = "a26ae43d7bcc3b814de94796a5e736d4029efb0ee900c12e2d54c993ad1a1e07" [[package]] name = "encode_unicode" @@ -1002,9 +1019,9 @@ checksum = "a357d28ed41a50f9c765dbfe56cbc04a64e53e5fc58ba79fbc34c10ef3df831f" [[package]] name = "encoding_rs" -version = "0.8.31" +version = "0.8.33" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9852635589dc9f9ea1b6fe9f05b50ef208c85c834a562f0c6abb1c475736ec2b" +checksum = "7268b386296a025e474d5140678f75d6de9493ae55a5d709eeb9dd08149945e1" dependencies = [ "cfg-if", ] @@ -1017,41 +1034,19 @@ checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" [[package]] name = "errno" -version = "0.2.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f639046355ee4f37944e44f60642c6f3a7efa3cf6b78c78a0d989a8ce6c396a1" -dependencies = [ - "errno-dragonfly", - "libc", - "winapi", -] - -[[package]] -name = "errno" -version = "0.3.1" +version = "0.3.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4bcfec3a70f97c962c307b2d2c56e358cf1d00b558d74262b5f929ee8cc7e73a" +checksum = "ac3e13f66a2f95e32a39eaa81f6b95d42878ca0e1db0c7543723dfe12557e860" dependencies = [ - "errno-dragonfly", "libc", "windows-sys 0.48.0", ] -[[package]] -name = "errno-dragonfly" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aa68f1b12764fab894d2755d2518754e71b4fd80ecfb822714a1206c2aab39bf" -dependencies = [ - "cc", - "libc", -] - [[package]] name = "esaxx-rs" -version = "0.1.8" +version = "0.1.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1f748b253ceca9fed5f42f8b5ceb3851e93102199bc25b64b65369f76e5c0a35" +checksum = "d817e038c30374a4bcb22f94d0a8a0e216958d4c3dcde369b1439fec4bdda6e6" [[package]] name = "event-listener" @@ -1079,13 +1074,19 @@ checksum = "7360491ce676a36bf9bb3c56c1aa791658183a54d2744120f27285738d90465a" [[package]] name = "fastrand" -version = "1.8.0" +version = "1.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a7a407cfaa3385c4ae6b23e84623d48c2798d06e3e6a1878f7f59f17b3f86499" +checksum = "e51093e27b0797c359783294ca4f0a911c270184cb10f85783b118614a1501be" dependencies = [ "instant", ] +[[package]] +name = "fastrand" +version = "2.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "25cbce373ec4653f1a01a31e8a5e5ec0c622dc27ff9c4e6606eefef5cbbed4a5" + [[package]] name = "fd-lock" version = "4.0.0" @@ -1093,30 +1094,36 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0b0377f1edc77dbd1118507bc7a66e4ab64d2b90c66f90726dc801e73a8c68f9" dependencies = [ "cfg-if", - "rustix 0.38.13", + "rustix 0.38.18", "windows-sys 0.48.0", ] [[package]] name = "filetime" -version = "0.2.19" +version = "0.2.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4e884668cd0c7480504233e951174ddc3b382f7c2666e3b7310b5c4e7b0c37f9" +checksum = "d4029edd3e734da6fe05b6cd7bd2960760a616bd2ddd0d59a0124746d6272af0" dependencies = [ "cfg-if", "libc", - "redox_syscall", - "windows-sys 0.42.0", + "redox_syscall 0.3.5", + "windows-sys 0.48.0", ] +[[package]] +name = "finl_unicode" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8fcfdc7a0362c9f4444381a9e697c79d435fe65b52a37466fc2c1184cee9edc6" + [[package]] name = "flate2" -version = "1.0.25" +version = "1.0.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a8a2db397cb1c8772f31494cb8917e48cd1e64f0fa7efac59fbd741a0a8ce841" +checksum = "c6c98ee8095e9d1dcbf2fcc6d95acccb90d1c81db1e44725c6a984b1dbdfb010" dependencies = [ "crc32fast", - "miniz_oxide 0.6.2", + "miniz_oxide", ] [[package]] @@ -1142,9 +1149,9 @@ checksum = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b" [[package]] name = "form_urlencoded" -version = "1.1.0" +version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a9c384f161156f5260c24a097c56119f9be8c798586aecc13afbcbe7b7e26bf8" +checksum = "a62bc1cf6f830c2ec14a513a9fb124d0a213a629668a4186f329db21fe045652" dependencies = [ "percent-encoding", ] @@ -1156,7 +1163,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "dd738b84894214045e8414eaded76359b4a5773f0a0a56b16575110739cdcf39" dependencies = [ "io-lifetimes 2.0.2", - "rustix 0.38.13", + "rustix 0.38.18", "windows-sys 0.48.0", ] @@ -1230,7 +1237,7 @@ version = "1.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "49a9d51ce47660b1e808d3c990b4709f2f415d928835a17dfd16991515c46bce" dependencies = [ - "fastrand", + "fastrand 1.9.0", "futures-core", "futures-io", "memchr", @@ -1247,7 +1254,7 @@ checksum = "89ca545a94061b6365f2c7355b4b32bd20df3ff95f02da9329b34ccc3bd6ee72" dependencies = [ "proc-macro2", "quote", - "syn 2.0.31", + "syn 2.0.38", ] [[package]] @@ -1304,9 +1311,9 @@ dependencies = [ [[package]] name = "generic-array" -version = "0.14.6" +version = "0.14.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bff49e947297f3312447abdca79f45f4738097cc82b06e72054d2223f601f1b9" +checksum = "85649ca51fd72272d7821adaf274ad91c288277713d9c18820d8499a7ff69e9a" dependencies = [ "typenum", "version_check", @@ -1325,9 +1332,9 @@ dependencies = [ [[package]] name = "getrandom" -version = "0.2.8" +version = "0.2.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c05aeb6a22b8f62540c194aac980f2115af067bfe15a0734d7277a768d396b31" +checksum = "be4136b2a15dd319360be1c07d9933517ccf0be8f16bf62a3bee4f0d618df427" dependencies = [ "cfg-if", "js-sys", @@ -1361,7 +1368,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6fb8d784f27acf97159b40fc4db5ecd8aa23b9ad5ef69cdd136d3bc80665f0c0" dependencies = [ "fallible-iterator 0.3.0", - "indexmap 2.0.0", + "indexmap 2.0.2", "stable_deref_trait", ] @@ -1373,9 +1380,9 @@ checksum = "d2fabcfbdc87f4758337ca535fb41a6d701b65693ce38287d856d1674551ec9b" [[package]] name = "h2" -version = "0.3.15" +version = "0.3.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f9f29bc9dda355256b2916cf526ab02ce0aeaaaf2bad60d65ef3f12f11dd0f4" +checksum = "91fc23aa11be92976ef4729127f1a74adf36d8436f7816b185d18df956790833" dependencies = [ "bytes", "fnv", @@ -1383,10 +1390,10 @@ dependencies = [ "futures-sink", "futures-util", "http", - "indexmap 1.9.2", + "indexmap 1.9.3", "slab", "tokio", - "tokio-util 0.7.4", + "tokio-util 0.7.9", "tracing", ] @@ -1405,9 +1412,6 @@ name = "hashbrown" version = "0.12.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" -dependencies = [ - "ahash 0.7.6", -] [[package]] name = "hashbrown" @@ -1415,25 +1419,26 @@ version = "0.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "43a3c133739dddd0d2990f9a4bdf8eb4b21ef50e4851ca85ab661199821d510e" dependencies = [ - "ahash 0.8.3", + "ahash", ] [[package]] name = "hashbrown" -version = "0.14.0" +version = "0.14.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2c6201b9ff9fd90a5a3bac2e56a830d0caa509576f0e503818ee82c181b3437a" +checksum = "7dfda62a12f55daeae5015f81b0baea145391cb4520f86c248fc615d72640d12" dependencies = [ - "ahash 0.8.3", + "ahash", + "allocator-api2", ] [[package]] name = "hashlink" -version = "0.8.1" +version = "0.8.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "69fe1fcf8b4278d860ad0548329f892a3631fb63f82574df68275f34cdbe0ffa" +checksum = "e8094feaf31ff591f651a2664fb9cfd92bba7a60ce3197265e9482ebe753c8f7" dependencies = [ - "hashbrown 0.12.3", + "hashbrown 0.14.1", ] [[package]] @@ -1453,18 +1458,9 @@ dependencies = [ [[package]] name = "hermit-abi" -version = "0.2.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ee512640fe35acbfb4bb779db6f0d80704c2cacfa2e39b601ef3e3f47d1ae4c7" -dependencies = [ - "libc", -] - -[[package]] -name = "hermit-abi" -version = "0.3.1" +version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fed44880c466736ef9a5c5b5facefb5ed0785676d0c02d612db14e54f0d84286" +checksum = "d77f7ec81a6d05a3abb01ab6eb7590f6083d08449fe5a1c8b1e620283546ccb7" [[package]] name = "hmac" @@ -1489,9 +1485,9 @@ dependencies = [ [[package]] name = "http" -version = "0.2.8" +version = "0.2.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "75f43d41e26995c17e71ee126451dd3941010b0514a81a9d11f3b341debc2399" +checksum = "bd6effc99afb63425aff9b05836f029929e345a6148a14b7ecd5ab67af944482" dependencies = [ "bytes", "fnv", @@ -1537,15 +1533,15 @@ checksum = "d897f394bad6a705d5f4104762e116a75639e470d80901eed05a860a95cb1904" [[package]] name = "httpdate" -version = "1.0.2" +version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c4a1e36c821dbe04574f602848a19f742f4fb3c98d40449f11bcad18d6b17421" +checksum = "df3b46402a9d5adb4c86a0cf463f42e19994e3ee891101b1841f30a545cb49a9" [[package]] name = "hyper" -version = "0.14.23" +version = "0.14.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "034711faac9d2166cb1baf1a2fb0b60b1f277f8492fd72176c17f3515e1abd3c" +checksum = "ffb1cfd654a8219eaef89881fdb3bb3b1cdc5fa75ded05d6933b2b382e395468" dependencies = [ "bytes", "futures-channel", @@ -1558,7 +1554,7 @@ dependencies = [ "httpdate", "itoa", "pin-project-lite", - "socket2 0.4.7", + "socket2 0.4.9", "tokio", "tower-service", "tracing", @@ -1567,10 +1563,11 @@ dependencies = [ [[package]] name = "hyper-rustls" -version = "0.23.2" +version = "0.24.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1788965e61b367cd03a62950836d5cd41560c3577d90e40e0819373194d1661c" +checksum = "8d78e1e73ec14cf7375674f74d7dde185c8206fd9dea6fb6295e8a98098aaa97" dependencies = [ + "futures-util", "http", "hyper", "rustls", @@ -1605,9 +1602,9 @@ checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" [[package]] name = "idna" -version = "0.3.0" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e14ddfc70884202db2244c223200c204c2bda1bc6e0998d11b5e024d657209e6" +checksum = "7d20d6b07bfbc108882d88ed8e37d39636dcc260e15e30c45e6ba089610b917c" dependencies = [ "unicode-bidi", "unicode-normalization", @@ -1615,9 +1612,9 @@ dependencies = [ [[package]] name = "indexmap" -version = "1.9.2" +version = "1.9.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1885e79c1fc4b10f0e172c475f458b7f7b93061064d98c3293e98c5ba0c8b399" +checksum = "bd070e393353796e801d209ad339e89596eb4c8d430d18ede6a1cced8fafbd99" dependencies = [ "autocfg", "hashbrown 0.12.3", @@ -1625,12 +1622,12 @@ dependencies = [ [[package]] name = "indexmap" -version = "2.0.0" +version = "2.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d5477fe2230a79769d8dc68e0eabf5437907c0457a5614a9e8dddb67f65eb65d" +checksum = "8adf3ddd720272c6ea8bf59463c04e0f93d0bbf7c5439b691bca2987e0270897" dependencies = [ "equivalent", - "hashbrown 0.14.0", + "hashbrown 0.14.1", "serde", ] @@ -1686,7 +1683,7 @@ version = "1.0.11" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "eae7b9aee968036d54dce06cebaefd919e4472e753296daccd6d344e3e2df0c2" dependencies = [ - "hermit-abi 0.3.1", + "hermit-abi 0.3.3", "libc", "windows-sys 0.48.0", ] @@ -1699,21 +1696,9 @@ checksum = "bffb4def18c48926ccac55c1223e02865ce1a821751a95920448662696e7472c" [[package]] name = "ipnet" -version = "2.7.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "30e22bd8629359895450b59ea7a776c850561b96a3b1d31321c1949d9e6c9146" - -[[package]] -name = "is-terminal" -version = "0.4.2" +version = "2.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "28dfb6c8100ccc63462345b67d1bbc3679177c75ee4bf59bf29c8b1d110b8189" -dependencies = [ - "hermit-abi 0.2.6", - "io-lifetimes 1.0.11", - "rustix 0.36.7", - "windows-sys 0.42.0", -] +checksum = "28b29a3cd74f0f4598934efe3aeba42bae0eb4680554128851ebbecb02af14e6" [[package]] name = "itertools" @@ -1753,15 +1738,15 @@ dependencies = [ [[package]] name = "itoa" -version = "1.0.5" +version = "1.0.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fad582f4b9e86b6caa621cabeb0963332d92eea04729ab12892c2533951e6440" +checksum = "af150ab688ff2122fcef229be89cb50dd66af9e01a4ff320cc137eecc9bacc38" [[package]] name = "ittapi" -version = "0.3.3" +version = "0.3.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2e648c437172ce7d3ac35ca11a068755072054826fa455a916b43524fa4a62a7" +checksum = "25a5c0b993601cad796222ea076565c5d9f337d35592f8622c753724f06d7271" dependencies = [ "anyhow", "ittapi-sys", @@ -1770,27 +1755,27 @@ dependencies = [ [[package]] name = "ittapi-sys" -version = "0.3.3" +version = "0.3.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a9b32a4d23f72548178dde54f3c12c6b6a08598e25575c0d0fa5bd861e0dc1a5" +checksum = "cb7b5e473765060536a660eed127f758cf1a810c73e49063264959c60d1727d9" dependencies = [ "cc", ] [[package]] name = "jobserver" -version = "0.1.25" +version = "0.1.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "068b1ee6743e4d11fb9c6a1e6064b3693a1b600e7f5f5988047d98b3dc9fb90b" +checksum = "8c37f63953c4c63420ed5fd3d6d398c719489b9f872b9fa683262f8edd363c7d" dependencies = [ "libc", ] [[package]] name = "js-sys" -version = "0.3.60" +version = "0.3.64" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49409df3e3bf0856b916e2ceaca09ee28e6871cf7d9ce97a692cacfdb2a25a47" +checksum = "c5f195fe497f702db0f318b07fdd68edb16955aed830df8363d837542f8f935a" dependencies = [ "wasm-bindgen", ] @@ -1888,9 +1873,9 @@ dependencies = [ [[package]] name = "libc" -version = "0.2.148" +version = "0.2.149" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9cdc71e17332e86d2e1d38c1f99edcb6288ee11b815fb1a4b049eaa2114d369b" +checksum = "a08173bc88b7955d1b3145aa561539096c421ac8debde8cbc3612ec635fee29b" [[package]] name = "libloading" @@ -1904,9 +1889,9 @@ dependencies = [ [[package]] name = "libsql-client" -version = "0.31.8" +version = "0.31.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e119ff2e259fe776a1340d2cb40baf4d44c32e5a9fd2755e756fc46802c79c70" +checksum = "9ad36885b1e43534f5015a8c45a0be4e8a6e9a829bbb3c5704a1c5e0c0fad848" dependencies = [ "anyhow", "base64 0.21.4", @@ -1933,12 +1918,6 @@ dependencies = [ "vcpkg", ] -[[package]] -name = "linux-raw-sys" -version = "0.1.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f051f77a7c8e6957c0696eac88f26b0117e54f52d3fc682ab19397a8812846a4" - [[package]] name = "linux-raw-sys" version = "0.3.8" @@ -1947,9 +1926,9 @@ checksum = "ef53942eb7bf7ff43a617b3e2c1c4a5ecf5944a7c1bc12d7ee39bbb15e5c1519" [[package]] name = "linux-raw-sys" -version = "0.4.7" +version = "0.4.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a9bad9f94746442c783ca431b22403b519cd7fbeed0533fdd6328b2f2212128" +checksum = "da2479e8c062e40bf0066ffa0bc823de0a9368974af99c9f6df941d2c231e03f" [[package]] name = "llm" @@ -1957,7 +1936,12 @@ version = "0.2.0-dev" source = "git+https://github.com/rustformers/llm?rev=2f6ffd4435799ceaa1d1bcb5a8790e5b3e0c5663#2f6ffd4435799ceaa1d1bcb5a8790e5b3e0c5663" dependencies = [ "llm-base", + "llm-bloom", + "llm-gpt2", + "llm-gptj", + "llm-gptneox", "llm-llama", + "llm-mpt", "serde", "tracing", ] @@ -1982,6 +1966,39 @@ dependencies = [ "tracing", ] +[[package]] +name = "llm-bloom" +version = "0.2.0-dev" +source = "git+https://github.com/rustformers/llm?rev=2f6ffd4435799ceaa1d1bcb5a8790e5b3e0c5663#2f6ffd4435799ceaa1d1bcb5a8790e5b3e0c5663" +dependencies = [ + "llm-base", +] + +[[package]] +name = "llm-gpt2" +version = "0.2.0-dev" +source = "git+https://github.com/rustformers/llm?rev=2f6ffd4435799ceaa1d1bcb5a8790e5b3e0c5663#2f6ffd4435799ceaa1d1bcb5a8790e5b3e0c5663" +dependencies = [ + "bytemuck", + "llm-base", +] + +[[package]] +name = "llm-gptj" +version = "0.2.0-dev" +source = "git+https://github.com/rustformers/llm?rev=2f6ffd4435799ceaa1d1bcb5a8790e5b3e0c5663#2f6ffd4435799ceaa1d1bcb5a8790e5b3e0c5663" +dependencies = [ + "llm-base", +] + +[[package]] +name = "llm-gptneox" +version = "0.2.0-dev" +source = "git+https://github.com/rustformers/llm?rev=2f6ffd4435799ceaa1d1bcb5a8790e5b3e0c5663#2f6ffd4435799ceaa1d1bcb5a8790e5b3e0c5663" +dependencies = [ + "llm-base", +] + [[package]] name = "llm-llama" version = "0.2.0-dev" @@ -1991,6 +2008,14 @@ dependencies = [ "tracing", ] +[[package]] +name = "llm-mpt" +version = "0.2.0-dev" +source = "git+https://github.com/rustformers/llm?rev=2f6ffd4435799ceaa1d1bcb5a8790e5b3e0c5663#2f6ffd4435799ceaa1d1bcb5a8790e5b3e0c5663" +dependencies = [ + "llm-base", +] + [[package]] name = "llm-samplers" version = "0.0.6" @@ -2005,9 +2030,9 @@ dependencies = [ [[package]] name = "lock_api" -version = "0.4.9" +version = "0.4.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "435011366fe56583b16cf956f9df0095b405b82d76425bc8981c0e22e60ec4df" +checksum = "c1cc9717a20b1bb222f333e6a92fd32f7d8a18ddc5a3191a11af45dcbf4dcd16" dependencies = [ "autocfg", "scopeguard", @@ -2015,12 +2040,9 @@ dependencies = [ [[package]] name = "log" -version = "0.4.17" +version = "0.4.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "abb12e687cfb44aa40f41fc3978ef76448f9b6038cad6aef4259d3c095a2382e" -dependencies = [ - "cfg-if", -] +checksum = "b5e6163cb8c49088c2c36f57875e58ccd8c87c7427f7fbd50ea6710b2f3f2e8f" [[package]] name = "lru" @@ -2073,26 +2095,27 @@ checksum = "4facc753ae494aeb6e3c22f839b158aebd4f9270f55cd3c79906c45476c47ab4" [[package]] name = "md-5" -version = "0.10.5" +version = "0.10.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6365506850d44bff6e2fbcb5176cf63650e48bd45ef2fe2665ae1570e0f4b9ca" +checksum = "d89e7ee0cfbedfc4da3340218492196241d89eefb6dab27de5df917a6d2e78cf" dependencies = [ + "cfg-if", "digest", ] [[package]] name = "memchr" -version = "2.5.0" +version = "2.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2dffe52ecf27772e601905b7522cb4ef790d2cc203488bbd0e2fe85fcb74566d" +checksum = "f665ee40bc4a3c5590afb1e9677db74a508659dfd71e126420da8274909a0167" [[package]] name = "memfd" -version = "0.6.2" +version = "0.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b20a59d985586e4a5aef64564ac77299f8586d8be6cf9106a5a40207e8908efb" +checksum = "b2cffa4ad52c6f791f4f8b15f0c05f9824b2ced1160e88cc393d64fff9a8ac64" dependencies = [ - "rustix 0.36.7", + "rustix 0.38.18", ] [[package]] @@ -2104,15 +2127,6 @@ dependencies = [ "libc", ] -[[package]] -name = "memoffset" -version = "0.7.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5de893c32cde5f383baa4c04c5d6dbdd735cfd4a794b0debdb2bb1b421da5ff4" -dependencies = [ - "autocfg", -] - [[package]] name = "memoffset" version = "0.9.0" @@ -2124,9 +2138,9 @@ dependencies = [ [[package]] name = "mime" -version = "0.3.16" +version = "0.3.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2a60c7ce501c71e03a9c9c0d35b861413ae925bd979cc7a4e30d060069aaac8d" +checksum = "6877bb514081ee2a7ff5ef9de3281f14a4dd4bceac4c09388074a6b5df8a139a" [[package]] name = "mime_guess" @@ -2144,15 +2158,6 @@ version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" -[[package]] -name = "miniz_oxide" -version = "0.6.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b275950c28b37e794e8c55d88aeb5e139d0ce23fdbbeda68f8d7174abdf9e8fa" -dependencies = [ - "adler", -] - [[package]] name = "miniz_oxide" version = "0.7.1" @@ -2192,7 +2197,7 @@ checksum = "371717c0a5543d6a800cac822eac735aa7d2d2fbb41002e9856a4089532dbdce" dependencies = [ "proc-macro2", "quote", - "syn 2.0.31", + "syn 2.0.38", ] [[package]] @@ -2219,11 +2224,11 @@ dependencies = [ "priority-queue", "serde", "serde_json", - "socket2 0.5.3", + "socket2 0.5.4", "thiserror", "tokio", "tokio-native-tls", - "tokio-util 0.7.4", + "tokio-util 0.7.9", "twox-hash", "url", ] @@ -2253,7 +2258,7 @@ dependencies = [ "saturating", "serde", "serde_json", - "sha1 0.10.5", + "sha1 0.10.6", "sha2", "smallvec", "subprocess", @@ -2281,14 +2286,13 @@ dependencies = [ [[package]] name = "nix" -version = "0.26.2" +version = "0.27.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bfdda3d196821d6af13126e40375cdf7da646a96114af134d5f417a9a1dc8e1a" +checksum = "2eb04e9c688eff1c89d72b407f168cf79bb9e867a9d3323ed6c01519eb9cc053" dependencies = [ - "bitflags 1.3.2", + "bitflags 2.4.0", "cfg-if", "libc", - "static_assertions", ] [[package]] @@ -2303,9 +2307,9 @@ dependencies = [ [[package]] name = "num-bigint" -version = "0.4.3" +version = "0.4.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f93ab6289c7b344a8a9f60f88d80aa20032336fe78da341afc91c8a2341fc75f" +checksum = "608e7659b5c3d7cba262d894801b9ec9d00de989e8a82bd4bef91d08da45cdc0" dependencies = [ "autocfg", "num-integer", @@ -2324,20 +2328,20 @@ dependencies = [ [[package]] name = "num-traits" -version = "0.2.15" +version = "0.2.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "578ede34cf02f8924ab9447f50c28075b4d3e5b269972345e7e0372b38c6cdcd" +checksum = "39e3200413f237f41ab11ad6d161bc7239c84dcb631773ccd7de3dfe4b5c267c" dependencies = [ "autocfg", ] [[package]] name = "num_cpus" -version = "1.15.0" +version = "1.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0fac9e2da13b5eb447a6ce3d392f23a29d8694bff781bf03a16cd9ac8697593b" +checksum = "4161fcb6d602d4d2081af7c3a45852d875a03dd337a6bfdd6e06407b61342a43" dependencies = [ - "hermit-abi 0.2.6", + "hermit-abi 0.3.3", "libc", ] @@ -2363,16 +2367,16 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9cf5f9dd3933bd50a9e1f149ec995f39ae2c496d31fd772c1fd45ebc27e902b0" dependencies = [ "crc32fast", - "hashbrown 0.14.0", - "indexmap 2.0.0", + "hashbrown 0.14.1", + "indexmap 2.0.2", "memchr", ] [[package]] name = "once_cell" -version = "1.17.0" +version = "1.18.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6f61fba1741ea2b3d6a1e3178721804bb716a68a6aeba1149b5d52e3d464ea66" +checksum = "dd8b5dd2ae5ed71462c540258bedcb51965123ad7e7ccf4b9a8cafaa4a63576d" [[package]] name = "onig" @@ -2398,11 +2402,11 @@ dependencies = [ [[package]] name = "openssl" -version = "0.10.45" +version = "0.10.57" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b102428fd03bc5edf97f62620f7298614c45cedf287c271e7ed450bbaf83f2e1" +checksum = "bac25ee399abb46215765b1cb35bc0212377e58a061560d8b29b024fd0430e7c" dependencies = [ - "bitflags 1.3.2", + "bitflags 2.4.0", "cfg-if", "foreign-types", "libc", @@ -2413,13 +2417,13 @@ dependencies = [ [[package]] name = "openssl-macros" -version = "0.1.0" +version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b501e44f11665960c7e7fcf062c7d96a14ade4aa98116c004b2e37b5be7d736c" +checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" dependencies = [ "proc-macro2", "quote", - "syn 1.0.107", + "syn 2.0.38", ] [[package]] @@ -2430,22 +2434,27 @@ checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" [[package]] name = "openssl-sys" -version = "0.9.80" +version = "0.9.93" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "23bbbf7854cd45b83958ebe919f0e8e516793727652e27fda10a8384cfc790b7" +checksum = "db4d56a4c0478783083cfafcc42493dd4a981d41669da64b4572a2a089b51b1d" dependencies = [ - "autocfg", "cc", "libc", "pkg-config", "vcpkg", ] +[[package]] +name = "option-ext" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "04744f49eae99ab78e0d5c0b603ab218f515ea8cfe5a456d7629ad883a3b6e7d" + [[package]] name = "os_str_bytes" -version = "6.4.1" +version = "6.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b7820b9daea5457c9f21c69448905d723fbd21136ccf521748f23fd49e723ee" +checksum = "4d5d9eb14b174ee9aa2ef96dc2b94637a2d4b6e7cb873c7e171f0c20c6cf3eac" [[package]] name = "ouroboros" @@ -2469,7 +2478,7 @@ dependencies = [ "proc-macro-error", "proc-macro2", "quote", - "syn 2.0.31", + "syn 2.0.38", ] [[package]] @@ -2482,6 +2491,7 @@ dependencies = [ "spin-app", "spin-core", "spin-world", + "terminal", "tracing", "url", ] @@ -2529,9 +2539,9 @@ dependencies = [ [[package]] name = "parking" -version = "2.1.0" +version = "2.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "14f2252c834a40ed9bb5422029649578e63aa341ac401f74e719dd1afda8394e" +checksum = "e52c774a4c39359c1d1c52e43f73dd91a75a614652c825408eec30c95a9b2067" [[package]] name = "parking_lot" @@ -2545,15 +2555,15 @@ dependencies = [ [[package]] name = "parking_lot_core" -version = "0.9.6" +version = "0.9.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba1ef8814b5c993410bb3adfad7a5ed269563e4a2f90c41f5d85be7fb47133bf" +checksum = "93f00c865fe7cabf650081affecd3871070f26767e7b2070a3ffae14c654b447" dependencies = [ "cfg-if", "libc", - "redox_syscall", + "redox_syscall 0.3.5", "smallvec", - "windows-sys 0.42.0", + "windows-targets 0.48.5", ] [[package]] @@ -2575,24 +2585,24 @@ dependencies = [ [[package]] name = "paste" -version = "1.0.11" +version = "1.0.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d01a5bd0424d00070b0098dd17ebca6f961a959dead1dbcbbbc1d1cd8d3deeba" +checksum = "de3145af08024dea9fa9914f381a17b8fc6034dfb00f3a84013f7ff43f29ed4c" [[package]] name = "path-absolutize" -version = "3.0.14" +version = "3.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f1d4993b16f7325d90c18c3c6a3327db7808752db8d208cea0acee0abd52c52" +checksum = "e4af381fe79fa195b4909485d99f73a80792331df0625188e707854f0b3383f5" dependencies = [ "path-dedot", ] [[package]] name = "path-dedot" -version = "3.0.18" +version = "3.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9a81540d94551664b72b72829b12bd167c73c9d25fbac0e04fafa8023f7e4901" +checksum = "07ba0ad7e047712414213ff67533e6dd477af0a4e1d14fb52343e53d30ea9397" dependencies = [ "once_cell", ] @@ -2627,15 +2637,15 @@ dependencies = [ [[package]] name = "percent-encoding" -version = "2.2.0" +version = "2.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "478c572c3d73181ff3c2539045f6eb99e5491218eae919370993b890cdbdd98e" +checksum = "9b2a4787296e9989611394c33f193f676704af1686e70b8f8033ab5ba9a35a94" [[package]] name = "phf" -version = "0.11.1" +version = "0.11.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "928c6535de93548188ef63bb7c4036bd415cd8f36ad25af44b9789b2ee72a48c" +checksum = "ade2d8b8f33c7333b51bcf0428d37e217e9f32192ae4772156f65063b8ce03dc" dependencies = [ "phf_shared", ] @@ -2652,9 +2662,9 @@ dependencies = [ [[package]] name = "phf_generator" -version = "0.11.1" +version = "0.11.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b1181c94580fa345f50f19d738aaa39c0ed30a600d95cb2d3e23f94266f14fbf" +checksum = "48e4cc64c2ad9ebe670cb8fd69dd50ae301650392e81c05f9bfcb2d5bdbc24b0" dependencies = [ "phf_shared", "rand 0.8.5", @@ -2662,9 +2672,9 @@ dependencies = [ [[package]] name = "phf_shared" -version = "0.11.1" +version = "0.11.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e1fb5f6f826b772a8d4c0394209441e7d37cbbb967ae9c7e0e8134365c9ee676" +checksum = "90fcb95eef784c2ac79119d1dd819e162b5da872ce6f3c3abe1e8ca1c082f72b" dependencies = [ "siphasher", "uncased", @@ -2672,22 +2682,22 @@ dependencies = [ [[package]] name = "pin-project" -version = "1.0.12" +version = "1.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ad29a609b6bcd67fee905812e544992d216af9d755757c05ed2d0e15a74c6ecc" +checksum = "fda4ed1c6c173e3fc7a83629421152e01d7b1f9b7f65fb301e490e8cfc656422" dependencies = [ "pin-project-internal", ] [[package]] name = "pin-project-internal" -version = "1.0.12" +version = "1.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "069bdb1e05adc7a8990dce9cc75370895fbe4e3d58b9b73bf1aee56359344a55" +checksum = "4359fd9c9171ec6e8c62926d6faaf553a8dc3f64e1507e76da7911b4f6a04405" dependencies = [ "proc-macro2", "quote", - "syn 1.0.107", + "syn 2.0.38", ] [[package]] @@ -2704,9 +2714,9 @@ checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" [[package]] name = "pkg-config" -version = "0.3.26" +version = "0.3.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ac9a59f73473f1b8d852421e59e64809f025994837ef743615c6d0c5b305160" +checksum = "26072860ba924cbfa98ea39c8c19b4dd6a4a25423dbdf219c1eca91aa0cf6964" [[package]] name = "postgres-native-tls" @@ -2723,11 +2733,11 @@ dependencies = [ [[package]] name = "postgres-protocol" -version = "0.6.4" +version = "0.6.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "878c6cbf956e03af9aa8204b407b9cbf47c072164800aa918c516cd4b056c50c" +checksum = "49b6c5ef183cd3ab4ba005f1ca64c21e8bd97ce4699cfea9e8d9a2c4958ca520" dependencies = [ - "base64 0.13.1", + "base64 0.21.4", "byteorder", "bytes", "fallible-iterator 0.2.0", @@ -2741,9 +2751,9 @@ dependencies = [ [[package]] name = "postgres-types" -version = "0.2.4" +version = "0.2.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "73d946ec7d256b04dfadc4e6a3292324e6f417124750fc5c0950f981b703a0f1" +checksum = "8d2234cdee9408b523530a9b6d2d6b373d1db34f6a8e51dc03ded1828d7fb67c" dependencies = [ "bytes", "fallible-iterator 0.2.0", @@ -2763,7 +2773,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fff39edfcaec0d64e8d0da38564fad195d2d51b680940295fcc307366e101e61" dependencies = [ "autocfg", - "indexmap 1.9.2", + "indexmap 1.9.3", ] [[package]] @@ -2775,7 +2785,7 @@ dependencies = [ "proc-macro-error-attr", "proc-macro2", "quote", - "syn 1.0.107", + "syn 1.0.109", "version_check", ] @@ -2792,9 +2802,9 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.66" +version = "1.0.69" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "18fb31db3f9bddb2ea821cde30a9f70117e3f119938b5ee630b7403aa6e2ead9" +checksum = "134c189feb4956b20f6f547d2cf727d4c0fe06722b20a0eec87ed445a97f92da" dependencies = [ "unicode-ident", ] @@ -2893,7 +2903,7 @@ version = "0.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" dependencies = [ - "getrandom 0.2.8", + "getrandom 0.2.10", ] [[package]] @@ -2907,9 +2917,9 @@ dependencies = [ [[package]] name = "rayon" -version = "1.7.0" +version = "1.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1d2df5196e37bcc87abebc0053e20787d73847bb33134a69841207dd0a47f03b" +checksum = "9c27db03db7734835b3f53954b534c91069375ce6ccaa2e065441e07d9b6cdb1" dependencies = [ "either", "rayon-core", @@ -2928,14 +2938,12 @@ dependencies = [ [[package]] name = "rayon-core" -version = "1.11.0" +version = "1.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4b8f95bd6966f5c87776639160a66bd8ab9895d9d4ab01ddba9fc60661aebe8d" +checksum = "5ce3fb6ad83f861aac485e76e1985cd109d9a3713802152be56c3b1f0e0658ed" dependencies = [ - "crossbeam-channel", "crossbeam-deque", "crossbeam-utils", - "num_cpus", ] [[package]] @@ -2956,7 +2964,7 @@ dependencies = [ "sha1 0.6.1", "tokio", "tokio-native-tls", - "tokio-util 0.7.4", + "tokio-util 0.7.9", "url", ] @@ -2969,22 +2977,31 @@ dependencies = [ "bitflags 1.3.2", ] +[[package]] +name = "redox_syscall" +version = "0.3.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "567664f262709473930a4bf9e51bf2ebf3348f2e748ccc50dea20646858f8f29" +dependencies = [ + "bitflags 1.3.2", +] + [[package]] name = "redox_users" version = "0.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b033d837a7cf162d7993aded9304e30a83213c648b6e389db233191f891e5c2b" dependencies = [ - "getrandom 0.2.8", - "redox_syscall", + "getrandom 0.2.10", + "redox_syscall 0.2.16", "thiserror", ] [[package]] name = "regalloc2" -version = "0.9.2" +version = "0.9.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b4dcbd3a2ae7fb94b5813fa0e957c6ab51bf5d0a8ee1b69e0c2d0f1e6eb8485" +checksum = "ad156d539c879b7a24a363a2016d77961786e71f48f2e2fc8302a92abd2429a6" dependencies = [ "hashbrown 0.13.2", "log", @@ -2995,25 +3012,25 @@ dependencies = [ [[package]] name = "regex" -version = "1.9.4" +version = "1.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "12de2eff854e5fa4b1295edd650e227e9d8fb0c9e90b12e7f36d6a6811791a29" +checksum = "d119d7c7ca818f8a53c300863d4f87566aac09943aef5b355bb83969dae75d87" dependencies = [ - "aho-corasick 1.0.5", + "aho-corasick 1.1.2", "memchr", "regex-automata", - "regex-syntax", + "regex-syntax 0.8.0", ] [[package]] name = "regex-automata" -version = "0.3.7" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49530408a136e16e5b486e883fbb6ba058e8e4e8ae6621a77b048b314336e629" +checksum = "465c6fc0621e4abc4187a2bda0937bfd4f722c2730b29562e19689ea796c9a4b" dependencies = [ - "aho-corasick 1.0.5", + "aho-corasick 1.1.2", "memchr", - "regex-syntax", + "regex-syntax 0.8.0", ] [[package]] @@ -3023,19 +3040,16 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "dbb5fb1acd8a1a18b3dd5be62d25485eb770e05afb408a9627d14d451bae12da" [[package]] -name = "remove_dir_all" -version = "0.5.3" +name = "regex-syntax" +version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3acd125665422973a33ac9d3dd2df85edad0f4ae9b00dafb1a05e43a9f5ef8e7" -dependencies = [ - "winapi", -] +checksum = "c3cbb081b9784b07cceb8824c8583f86db4814d172ab043f3c23f7dc600bf83d" [[package]] name = "reqwest" -version = "0.11.14" +version = "0.11.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "21eed90ec8570952d53b772ecf8f206aa1ec9a3d76b2521c56c42973f2d91ee9" +checksum = "046cd98826c46c2ac8ddecae268eb5c2e58628688a5fc7a2643704a73faba95b" dependencies = [ "async-compression", "base64 0.21.4", @@ -3062,10 +3076,11 @@ dependencies = [ "serde", "serde_json", "serde_urlencoded", + "system-configuration", "tokio", "tokio-native-tls", "tokio-rustls", - "tokio-util 0.7.4", + "tokio-util 0.7.9", "tower-service", "url", "wasm-bindgen", @@ -3107,9 +3122,9 @@ dependencies = [ [[package]] name = "rustc-demangle" -version = "0.1.21" +version = "0.1.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ef03e0a2b150c7a90d01faf6254c9c48a41e95fb2a8c2ac1c6f0d2b9aefc342" +checksum = "d626bb9dae77e28219937af045c257c28bfd3f69333c512553507f5f9798cb76" [[package]] name = "rustc-hash" @@ -3156,32 +3171,18 @@ dependencies = [ "quote", "regex", "serde_urlencoded", - "syn 1.0.107", + "syn 1.0.109", "synstructure", ] [[package]] name = "rustix" -version = "0.36.7" +version = "0.37.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d4fdebc4b395b7fbb9ab11e462e20ed9051e7b16e42d24042c776eca0ac81b03" +checksum = "4279d76516df406a8bd37e7dff53fd37d1a093f997a3c34a5c21658c126db06d" dependencies = [ "bitflags 1.3.2", - "errno 0.2.8", - "io-lifetimes 1.0.11", - "libc", - "linux-raw-sys 0.1.4", - "windows-sys 0.42.0", -] - -[[package]] -name = "rustix" -version = "0.37.20" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b96e891d04aa506a6d1f318d2771bcb1c7dfda84e126660ace067c9b474bb2c0" -dependencies = [ - "bitflags 1.3.2", - "errno 0.3.1", + "errno", "io-lifetimes 1.0.11", "libc", "linux-raw-sys 0.3.8", @@ -3190,45 +3191,55 @@ dependencies = [ [[package]] name = "rustix" -version = "0.38.13" +version = "0.38.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d7db8590df6dfcd144d22afd1b83b36c21a18d7cbc1dc4bb5295a8712e9eb662" +checksum = "5a74ee2d7c2581cd139b42447d7d9389b889bdaad3a73f1ebb16f2a3237bb19c" dependencies = [ "bitflags 2.4.0", - "errno 0.3.1", + "errno", "itoa", "libc", - "linux-raw-sys 0.4.7", + "linux-raw-sys 0.4.10", "once_cell", "windows-sys 0.48.0", ] [[package]] name = "rustls" -version = "0.20.8" +version = "0.21.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fff78fc74d175294f4e83b28343315ffcfb114b156f0185e9741cb5570f50e2f" +checksum = "cd8d6c9f025a446bc4d18ad9632e69aec8f287aa84499ee335599fabd20c3fd8" dependencies = [ "log", "ring", + "rustls-webpki", "sct", - "webpki", ] [[package]] name = "rustls-pemfile" -version = "1.0.2" +version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d194b56d58803a43635bdc398cd17e383d6f71f9182b9a192c127ca42494a59b" +checksum = "2d3987094b1d07b653b7dfdc3f70ce9a1da9c51ac18c1b06b662e4f9a0e9f4b2" dependencies = [ "base64 0.21.4", ] +[[package]] +name = "rustls-webpki" +version = "0.101.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3c7d5dece342910d9ba34d259310cae3e0154b873b35408b787b59bce53d34fe" +dependencies = [ + "ring", + "untrusted", +] + [[package]] name = "ryu" -version = "1.0.12" +version = "1.0.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7b4b9743ed687d4b4bcedf9ff5eaa7398495ae14e61cba0a295704edbc7decde" +checksum = "1ad4cc8da4ef723ed60bced201181d83791ad433213d8c24efffda1eec85d741" [[package]] name = "same-file" @@ -3257,18 +3268,18 @@ checksum = "ece8e78b2f38ec51c51f5d475df0a7187ba5111b2a28bdc761ee05b075d40a71" [[package]] name = "schannel" -version = "0.1.21" +version = "0.1.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "713cfb06c7059f3588fb8044c0fad1d09e3c01d225e25b9220dbfdcf16dbb1b3" +checksum = "0c3733bf4cf7ea0880754e19cb5a462007c4a8c1914bff372ccc95b464f1df88" dependencies = [ - "windows-sys 0.42.0", + "windows-sys 0.48.0", ] [[package]] name = "scopeguard" -version = "1.1.0" +version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd" +checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" [[package]] name = "sct" @@ -3282,9 +3293,9 @@ dependencies = [ [[package]] name = "security-framework" -version = "2.8.0" +version = "2.9.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "645926f31b250a2dca3c232496c2d898d91036e45ca0e97e0e2390c54e11be36" +checksum = "05b64fb303737d99b81884b2c63433e9ae28abebe5eb5045dcdd175dc2ecf4de" dependencies = [ "bitflags 1.3.2", "core-foundation", @@ -3295,9 +3306,9 @@ dependencies = [ [[package]] name = "security-framework-sys" -version = "2.8.0" +version = "2.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "31c9bb296072e961fcbd8853511dd39c2d8be2deb1e17c6860b1d30732b323b4" +checksum = "e932934257d3b408ed8f30db49d85ea163bfe74961f017f405b025af298f0c7a" dependencies = [ "core-foundation-sys", "libc", @@ -3305,9 +3316,9 @@ dependencies = [ [[package]] name = "semver" -version = "1.0.16" +version = "1.0.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "58bc9567378fc7690d6b2addae4e60ac2eeea07becb2c64b9f218b53865cba2a" +checksum = "836fa6a3e1e547f9a2c4040802ec865b5d85f4014efe00555d7090a3dcaa1090" [[package]] name = "serde" @@ -3335,14 +3346,14 @@ checksum = "4eca7ac642d82aa35b60049a6eccb4be6be75e599bd2e9adb5f875a737654af2" dependencies = [ "proc-macro2", "quote", - "syn 2.0.31", + "syn 2.0.38", ] [[package]] name = "serde_json" -version = "1.0.96" +version = "1.0.107" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "057d394a50403bcac12672b2b18fb387ab6d289d957dab67dd201875391e52f1" +checksum = "6b420ce6e3d8bd882e9b243c6eed35dbc9a6110c9769e74b584e0d68d1f20c65" dependencies = [ "itoa", "ryu", @@ -3383,9 +3394,9 @@ dependencies = [ [[package]] name = "sha1" -version = "0.10.5" +version = "0.10.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f04293dc80c3993519f2d7f6f511707ee7094fe0c6d3406feb330cdb3540eba3" +checksum = "e3bf829a2d51ab4a5ddf1352d8470c140cadc8301b2ae1789db023f01cedd6ba" dependencies = [ "cfg-if", "cpufeatures", @@ -3400,9 +3411,9 @@ checksum = "ae1a47186c03a32177042e55dbc5fd5aee900b8e0069a8d70fba96a9375cd012" [[package]] name = "sha2" -version = "0.10.6" +version = "0.10.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "82e6b795fe2e3b1e845bafcb27aa35405c4d47cdfc92af5fc8d3002f76cebdc0" +checksum = "793db75ad2bcafc3ffa7c68b215fee268f537982cd901d132f89c6343f3a3dc8" dependencies = [ "cfg-if", "cpufeatures", @@ -3415,7 +3426,7 @@ version = "2.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7ccc8076840c4da029af4f87e4e8daeb0fca6b87bbb02e10cb60b791450e11e4" dependencies = [ - "dirs", + "dirs 4.0.0", ] [[package]] @@ -3424,56 +3435,56 @@ version = "3.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "da03fa3b94cc19e3ebfc88c4229c49d8f08cdbd1228870a45f0ffdf84988e14b" dependencies = [ - "dirs", + "dirs 5.0.1", ] [[package]] name = "shlex" -version = "1.1.0" +version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "43b2853a4d09f215c24cc5489c992ce46052d359b5109343cbafbf26bc62f8a3" +checksum = "a7cee0529a6d40f580e7a5e6c495c8fbfe21b7b52795ed4bb5e62cdf92bc6380" [[package]] name = "signal-hook-registry" -version = "1.4.0" +version = "1.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e51e73328dc4ac0c7ccbda3a494dfa03df1de2f46018127f60c693f2648455b0" +checksum = "d8229b473baa5980ac72ef434c4415e70c4b5e71b423043adb4ba059f89c99a1" dependencies = [ "libc", ] [[package]] name = "siphasher" -version = "0.3.10" +version = "0.3.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7bd3e3206899af3f8b12af284fafc038cc1dc2b41d1b89dd17297221c5d225de" +checksum = "38b58827f4464d87d377d175e90bf58eb00fd8716ff0a62f80356b5e61555d0d" [[package]] name = "slab" -version = "0.4.7" +version = "0.4.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4614a76b2a8be0058caa9dbbaf66d988527d86d003c11a94fbd335d7661edcef" +checksum = "8f92a496fb766b417c996b9c5e57daf2f7ad3b0bebe1ccfca4856390e3d3bb67" dependencies = [ "autocfg", ] [[package]] name = "slice-group-by" -version = "0.3.0" +version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "03b634d87b960ab1a38c4fe143b508576f075e7c978bfad18217645ebfdfa2ec" +checksum = "826167069c09b99d56f31e9ae5c99049e932a98c9dc2dac47645b08dbbf76ba7" [[package]] name = "smallvec" -version = "1.10.0" +version = "1.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a507befe795404456341dfab10cef66ead4c041f62b8b11bbb92bffe5d0953e0" +checksum = "942b4a808e05215192e39f4ab80813e599068285906cc91aa64f923db842bd5a" [[package]] name = "socket2" -version = "0.4.7" +version = "0.4.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "02e2d2db9033d13a1567121ddd7a095ee144db4e1ca1b1bda3419bc0da294ebd" +checksum = "64a4a911eed85daf18834cfaa86a79b7d266ff93ff5ba14005426219480ed662" dependencies = [ "libc", "winapi", @@ -3481,9 +3492,9 @@ dependencies = [ [[package]] name = "socket2" -version = "0.5.3" +version = "0.5.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2538b18701741680e0322a2302176d3253a35388e2e62f172f64f4f16605f877" +checksum = "4031e820eb552adee9295814c0ced9e5cf38ddf1e8b7d566d6de8e2538ea989e" dependencies = [ "libc", "windows-sys 0.48.0", @@ -3523,7 +3534,7 @@ name = "spin-common" version = "2.0.0-pre0" dependencies = [ "anyhow", - "dirs", + "dirs 4.0.0", "sha2", "tokio", ] @@ -3531,7 +3542,7 @@ dependencies = [ [[package]] name = "spin-componentize" version = "0.1.0" -source = "git+https://github.com/fermyon/spin-componentize?rev=0fa79bfc60f20c172213e2a2c34bd0b3168960b0#0fa79bfc60f20c172213e2a2c34bd0b3168960b0" +source = "git+https://github.com/fermyon/spin-componentize?rev=84286054d632ccb8ae06c6419940b5d328229e59#84286054d632ccb8ae06c6419940b5d328229e59" dependencies = [ "anyhow", "wasm-encoder", @@ -3567,7 +3578,7 @@ dependencies = [ "cap-std", "crossbeam-channel", "io-extras", - "rustix 0.37.20", + "rustix 0.37.24", "system-interface", "tokio", "tracing", @@ -3654,6 +3665,7 @@ dependencies = [ "spin-core", "spin-llm", "spin-world", + "tracing", ] [[package]] @@ -3663,7 +3675,7 @@ dependencies = [ "anyhow", "async-trait", "bytes", - "dirs", + "dirs 4.0.0", "dunce", "futures", "glob", @@ -3694,7 +3706,7 @@ dependencies = [ name = "spin-manifest" version = "2.0.0-pre0" dependencies = [ - "indexmap 1.9.2", + "indexmap 1.9.3", "serde", "thiserror", "toml", @@ -3749,9 +3761,9 @@ dependencies = [ "async-trait", "clap", "ctrlc", - "dirs", + "dirs 4.0.0", "futures", - "indexmap 1.9.2", + "indexmap 1.9.3", "outbound-http", "outbound-mysql", "outbound-pg", @@ -3818,7 +3830,7 @@ dependencies = [ "bitflags 2.4.0", "cc", "fallible-iterator 0.2.0", - "indexmap 1.9.2", + "indexmap 1.9.3", "log", "memchr", "phf", @@ -3851,10 +3863,11 @@ checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" [[package]] name = "stringprep" -version = "0.1.2" +version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ee348cb74b87454fff4b551cbf727025810a004f88aeacae7f85b87f4e9a1c1" +checksum = "bb41d74e231a107a1b4ee36bd1214b11285b77768d2e3824aedafa988fd36ee6" dependencies = [ + "finl_unicode", "unicode-bidi", "unicode-normalization", ] @@ -3877,15 +3890,15 @@ dependencies = [ [[package]] name = "subtle" -version = "2.4.1" +version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6bdef32e8150c2a081110b42772ffe7d7c9032b606bc226c8260fd97e0976601" +checksum = "81cdd64d312baedb58e21336b31bc043b77e01cc99033ce76ef539f78e965ebc" [[package]] name = "syn" -version = "1.0.107" +version = "1.0.109" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1f4064b5b16e03ae50984a5a8ed5d4f8803e6bc1fd170a3cda91a1be4b18e3f5" +checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237" dependencies = [ "proc-macro2", "quote", @@ -3894,9 +3907,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.31" +version = "2.0.38" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "718fa2415bcb8d8bd775917a1bf12a7931b6dfa890753378538118181e0cb398" +checksum = "e96b79aaa137db8f61e26363a0c9b47d8b4ec75da28b7d1d614c2303e232408b" dependencies = [ "proc-macro2", "quote", @@ -3911,10 +3924,31 @@ checksum = "f36bdaa60a83aca3921b5259d5400cbf5e90fc51931376a9bd4a0eb79aa7210f" dependencies = [ "proc-macro2", "quote", - "syn 1.0.107", + "syn 1.0.109", "unicode-xid", ] +[[package]] +name = "system-configuration" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ba3a3adc5c275d719af8cb4272ea1c4a6d668a777f37e115f6d11ddbc1c8e0e7" +dependencies = [ + "bitflags 1.3.2", + "core-foundation", + "system-configuration-sys", +] + +[[package]] +name = "system-configuration-sys" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a75fb188eb626b924683e3b95e3a48e63551fcfb51949de2f06a9d91dbee93c9" +dependencies = [ + "core-foundation-sys", + "libc", +] + [[package]] name = "system-interface" version = "0.26.0" @@ -3926,7 +3960,7 @@ dependencies = [ "cap-std", "fd-lock", "io-lifetimes 2.0.2", - "rustix 0.38.13", + "rustix 0.38.18", "windows-sys 0.48.0", "winx", ] @@ -3950,29 +3984,28 @@ dependencies = [ [[package]] name = "target-lexicon" -version = "0.12.5" +version = "0.12.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9410d0f6853b1d94f0e519fb95df60f29d2c1eff2d921ffdf01a4c8a3b54f12d" +checksum = "9d0e916b1148c8e263850e1ebcbd046f333e0683c724876bb0da63ea4373dc8a" [[package]] name = "tempfile" -version = "3.3.0" +version = "3.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5cdb1ef4eaeeaddc8fbd371e5017057064af0911902ef36b39801f67cc6d79e4" +checksum = "cb94d2f3cc536af71caac6b6fcebf65860b347e7ce0cc9ebe8f70d3e521054ef" dependencies = [ "cfg-if", - "fastrand", - "libc", - "redox_syscall", - "remove_dir_all", - "winapi", + "fastrand 2.0.1", + "redox_syscall 0.3.5", + "rustix 0.38.18", + "windows-sys 0.48.0", ] [[package]] name = "termcolor" -version = "1.2.0" +version = "1.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "be55cf8942feac5c765c2c993422806843c9a9a45d4d5c407ad6dd2ea95eb9b6" +checksum = "6093bad37da69aab9d123a8091e4be0aa4a03e4d601ec641c327398315f62b64" dependencies = [ "winapi-util", ] @@ -3994,30 +4027,31 @@ checksum = "222a222a5bfe1bba4a77b45ec488a741b3cb8872e5e499451fd7d0129c9c7c3d" [[package]] name = "thiserror" -version = "1.0.48" +version = "1.0.49" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d6d7a740b8a666a7e828dd00da9c0dc290dff53154ea77ac109281de90589b7" +checksum = "1177e8c6d7ede7afde3585fd2513e611227efd6481bd78d2e82ba1ce16557ed4" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.48" +version = "1.0.49" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49922ecae66cc8a249b77e68d1d0623c1b2c514f0060c27cdc68bd62a1219d35" +checksum = "10712f02019e9288794769fba95cd6847df9874d49d871d062172f9dd41bc4cc" dependencies = [ "proc-macro2", "quote", - "syn 2.0.31", + "syn 2.0.38", ] [[package]] name = "time" -version = "0.3.17" +version = "0.3.29" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a561bf4617eebd33bca6434b988f39ed798e527f51a1e797d0ee4f61c0a38376" +checksum = "426f806f4089c493dcac0d24c29c01e2c38baf8e30f1b716ee37e83d200b18fe" dependencies = [ + "deranged", "itoa", "libc", "num_threads", @@ -4028,15 +4062,15 @@ dependencies = [ [[package]] name = "time-core" -version = "0.1.0" +version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2e153e1f1acaef8acc537e68b44906d2db6436e2b35ac2c6b42640fff91f00fd" +checksum = "ef927ca75afb808a4d64dd374f00a2adf8d0fcff8e7b184af886c3c87ec4a3f3" [[package]] name = "time-macros" -version = "0.2.6" +version = "0.2.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d967f99f534ca7e495c575c62638eebc2898a8c84c119b89e250477bc4ba16b2" +checksum = "4ad70d68dba9e1f8aceda7aa6711965dfec1cac869f311a51bd08b3a2ccbce20" dependencies = [ "time-core", ] @@ -4052,9 +4086,9 @@ dependencies = [ [[package]] name = "tinyvec_macros" -version = "0.1.0" +version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cda74da7e1a664f795bb1f8a87ec406fb89a02522cf6e50620d016add6dbbf5c" +checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" [[package]] name = "tokenizers" @@ -4065,9 +4099,9 @@ dependencies = [ "aho-corasick 0.7.20", "cached-path", "derive_builder 0.12.0", - "dirs", + "dirs 4.0.0", "esaxx-rs", - "getrandom 0.2.8", + "getrandom 0.2.10", "itertools 0.9.0", "lazy_static", "log", @@ -4079,7 +4113,7 @@ dependencies = [ "rayon", "rayon-cond", "regex", - "regex-syntax", + "regex-syntax 0.7.5", "reqwest", "serde", "serde_json", @@ -4092,9 +4126,9 @@ dependencies = [ [[package]] name = "tokio" -version = "1.32.0" +version = "1.33.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "17ed6077ed6cd6c74735e21f37eb16dc3935f96878b1fe961074089cc80893f9" +checksum = "4f38200e3ef7995e5ef13baec2f432a6da0aa9ac495b2c0e8f3b7eec2c92d653" dependencies = [ "backtrace", "bytes", @@ -4104,7 +4138,7 @@ dependencies = [ "parking_lot", "pin-project-lite", "signal-hook-registry", - "socket2 0.5.3", + "socket2 0.5.4", "tokio-macros", "windows-sys 0.48.0", ] @@ -4117,14 +4151,14 @@ checksum = "630bdcf245f78637c13ec01ffae6187cca34625e8c63150d424b59e55af2675e" dependencies = [ "proc-macro2", "quote", - "syn 2.0.31", + "syn 2.0.38", ] [[package]] name = "tokio-native-tls" -version = "0.3.0" +version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f7d995660bd2b7f8c1568414c1126076c13fbb725c40112dc0120b78eb9b717b" +checksum = "bbae76ab933c85776efabc971569dd6119c580d8f5d448769dec1764bf796ef2" dependencies = [ "native-tls", "tokio", @@ -4132,9 +4166,9 @@ dependencies = [ [[package]] name = "tokio-postgres" -version = "0.7.7" +version = "0.7.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "29a12c1b3e0704ae7dfc25562629798b29c72e6b1d0a681b6f29ab4ae5e7f7bf" +checksum = "d340244b32d920260ae7448cb72b6e238bddc3d4f7603394e7dd46ed8e48f5b8" dependencies = [ "async-trait", "byteorder", @@ -4149,20 +4183,21 @@ dependencies = [ "pin-project-lite", "postgres-protocol", "postgres-types", - "socket2 0.4.7", + "rand 0.8.5", + "socket2 0.5.4", "tokio", - "tokio-util 0.7.4", + "tokio-util 0.7.9", + "whoami", ] [[package]] name = "tokio-rustls" -version = "0.23.4" +version = "0.24.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c43ee83903113e03984cb9e5cebe6c04a5116269e900e3ddba8f068a62adda59" +checksum = "c28327cf380ac148141087fbfb9de9d7bd4e84ab5d2c28fbc911d753de8a7081" dependencies = [ "rustls", "tokio", - "webpki", ] [[package]] @@ -4177,9 +4212,9 @@ dependencies = [ [[package]] name = "tokio-stream" -version = "0.1.11" +version = "0.1.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d660770404473ccd7bc9f8b28494a811bc18542b915c0855c51e8f419d5223ce" +checksum = "397c988d37662c7dda6d2208364a706264bf3d6138b11d436cbac0ad38832842" dependencies = [ "futures-core", "pin-project-lite", @@ -4202,9 +4237,9 @@ dependencies = [ [[package]] name = "tokio-util" -version = "0.7.4" +version = "0.7.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0bb2e075f03b3d66d8d8785356224ba688d2906a371015e225beeb65ca92c740" +checksum = "1d68074620f57a0b21594d9735eb2e98ab38b17f80d3fcb189fca266771ca60d" dependencies = [ "bytes", "futures-core", @@ -4244,20 +4279,20 @@ dependencies = [ [[package]] name = "tracing-attributes" -version = "0.1.23" +version = "0.1.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4017f8f45139870ca7e672686113917c71c7a6e02d4924eda67186083c03081a" +checksum = "5f4f31f56159e98206da9efd823404b79b6ef3143b4a7ab76e67b1751b25a4ab" dependencies = [ "proc-macro2", "quote", - "syn 1.0.107", + "syn 2.0.38", ] [[package]] name = "tracing-core" -version = "0.1.30" +version = "0.1.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "24eb03ba0eab1fd845050058ce5e616558e8f8d8fca633e6b163fe25c797213a" +checksum = "0955b8137a1df6f1a2e9a37d8a6656291ff0297c1a97c24e0d8425fe2312f79a" dependencies = [ "once_cell", ] @@ -4297,9 +4332,9 @@ dependencies = [ [[package]] name = "typenum" -version = "1.16.0" +version = "1.17.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "497961ef93d974e23eb6f433eb5fe1b7930b659f06d12dec6fc44a8f554c0bba" +checksum = "42ff0bf0c66b8238c6f3b578df37d0b7848e55df8577b3f74f92a69acceeb825" [[package]] name = "uncased" @@ -4312,24 +4347,24 @@ dependencies = [ [[package]] name = "unicase" -version = "2.6.0" +version = "2.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "50f37be617794602aabbeee0be4f259dc1778fabe05e2d67ee8f79326d5cb4f6" +checksum = "f7d2d4dafb69621809a81864c9c1b864479e1235c0dd4e199924b9742439ed89" dependencies = [ "version_check", ] [[package]] name = "unicode-bidi" -version = "0.3.10" +version = "0.3.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d54675592c1dbefd78cbd98db9bacd89886e1ca50692a0692baefffdeb92dd58" +checksum = "92888ba5573ff080736b3648696b70cafad7d250551175acbaa4e0385b3e1460" [[package]] name = "unicode-ident" -version = "1.0.6" +version = "1.0.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "84a22b9f218b40614adcb3f4ff08b703773ad44fa9423e4e0d346d5db86e4ebc" +checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" [[package]] name = "unicode-normalization" @@ -4357,9 +4392,9 @@ checksum = "1dd624098567895118886609431a7c3b8f516e41d30e0643f03d94592a147e36" [[package]] name = "unicode-width" -version = "0.1.10" +version = "0.1.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c0edd1e5b14653f783770bce4a4dabb4a5108a5370a5f5d8cfe8710c361f6c8b" +checksum = "e51733f11c9c4f72aa0c160008246859e340b00807569a0da0e7a1079b27ba85" [[package]] name = "unicode-xid" @@ -4381,9 +4416,9 @@ checksum = "a156c684c91ea7d62626509bce3cb4e1d9ed5c4d978f7b4352658f96a4c26b4a" [[package]] name = "url" -version = "2.3.1" +version = "2.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0d68c799ae75762b8c3fe375feb6600ef5602c883c5d21eb51c09f22b83c4643" +checksum = "143b538f18257fac9cad154828a57c6bf5157e1aa604d4816b5995bf6de87ae5" dependencies = [ "form_urlencoded", "idna", @@ -4397,7 +4432,7 @@ version = "1.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "79daa5ed5740825c40b389c5e50312b9c86df53fccd33f281df655642b43869d" dependencies = [ - "getrandom 0.2.8", + "getrandom 0.2.10", ] [[package]] @@ -4434,28 +4469,26 @@ checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" [[package]] name = "waker-fn" -version = "1.1.0" +version = "1.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d5b2c62b4012a3e1eca5a7e077d13b3bf498c4073e33ccd58626607748ceeca" +checksum = "f3c4517f54858c779bbcbf228f4fca63d121bf85fbecb2dc578cdf4a39395690" [[package]] name = "walkdir" -version = "2.3.2" +version = "2.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "808cf2735cd4b6866113f648b791c6adc5714537bc222d9347bb203386ffda56" +checksum = "d71d857dc86794ca4c280d616f7da00d2dbfd8cd788846559a6813e6aa4b54ee" dependencies = [ "same-file", - "winapi", "winapi-util", ] [[package]] name = "want" -version = "0.3.0" +version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ce8a968cb1cd110d136ff8b819a556d6fb6d919363c61534f6860c7eb172ba0" +checksum = "bfa7760aed19e106de2c7c0b581b509f2f25d3dacaf737cb82ac61bc6d760b0e" dependencies = [ - "log", "try-lock", ] @@ -4473,9 +4506,8 @@ checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" [[package]] name = "wasi-cap-std-sync" -version = "13.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec076cd75f207327f5bfaebb915ef03d82c3a01a6d9b5d0deb6eafffceab3095" +version = "15.0.0" +source = "git+https://github.com/bytecodealliance/wasmtime?rev=4c34504efb258a0c51c6a5f3f8a5b24d987993b9#4c34504efb258a0c51c6a5f3f8a5b24d987993b9" dependencies = [ "anyhow", "async-trait", @@ -4486,9 +4518,8 @@ dependencies = [ "fs-set-times", "io-extras", "io-lifetimes 2.0.2", - "is-terminal", "once_cell", - "rustix 0.38.13", + "rustix 0.38.18", "system-interface", "tracing", "wasi-common", @@ -4497,9 +4528,8 @@ dependencies = [ [[package]] name = "wasi-common" -version = "13.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3f391b334c783c1154369be62c31dc8598ffa1a6c34ea05d7f8cf0b18ce7c272" +version = "15.0.0" +source = "git+https://github.com/bytecodealliance/wasmtime?rev=4c34504efb258a0c51c6a5f3f8a5b24d987993b9#4c34504efb258a0c51c6a5f3f8a5b24d987993b9" dependencies = [ "anyhow", "bitflags 2.4.0", @@ -4507,7 +4537,7 @@ dependencies = [ "cap-std", "io-extras", "log", - "rustix 0.38.13", + "rustix 0.38.18", "thiserror", "tracing", "wasmtime", @@ -4517,15 +4547,14 @@ dependencies = [ [[package]] name = "wasi-tokio" -version = "13.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6de05e4d9f81b8e82672cff04bab4128a170274ed2c44ff4c9e36905aefcaf35" +version = "15.0.0" +source = "git+https://github.com/bytecodealliance/wasmtime?rev=4c34504efb258a0c51c6a5f3f8a5b24d987993b9#4c34504efb258a0c51c6a5f3f8a5b24d987993b9" dependencies = [ "anyhow", "cap-std", "io-extras", "io-lifetimes 2.0.2", - "rustix 0.38.13", + "rustix 0.38.18", "tokio", "wasi-cap-std-sync", "wasi-common", @@ -4534,9 +4563,9 @@ dependencies = [ [[package]] name = "wasm-bindgen" -version = "0.2.83" +version = "0.2.87" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eaf9f5aceeec8be17c128b2e93e031fb8a4d469bb9c4ae2d7dc1888b26887268" +checksum = "7706a72ab36d8cb1f80ffbf0e071533974a60d0a308d01a5d0375bf60499a342" dependencies = [ "cfg-if", "wasm-bindgen-macro", @@ -4544,24 +4573,24 @@ dependencies = [ [[package]] name = "wasm-bindgen-backend" -version = "0.2.83" +version = "0.2.87" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c8ffb332579b0557b52d268b91feab8df3615f265d5270fec2a8c95b17c1142" +checksum = "5ef2b6d3c510e9625e5fe6f509ab07d66a760f0885d858736483c32ed7809abd" dependencies = [ "bumpalo", "log", "once_cell", "proc-macro2", "quote", - "syn 1.0.107", + "syn 2.0.38", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-futures" -version = "0.4.33" +version = "0.4.37" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "23639446165ca5a5de86ae1d8896b737ae80319560fbaa4c2887b7da6e7ebd7d" +checksum = "c02dbc21516f9f1f04f187958890d7e6026df8d16540b7ad9492bc34a67cea03" dependencies = [ "cfg-if", "js-sys", @@ -4571,9 +4600,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro" -version = "0.2.83" +version = "0.2.87" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "052be0f94026e6cbc75cdefc9bae13fd6052cdcaf532fa6c45e7ae33a1e6c810" +checksum = "dee495e55982a3bd48105a7b947fd2a9b4a8ae3010041b9e0faab3f9cd028f1d" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -4581,40 +4610,40 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.83" +version = "0.2.87" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "07bc0c051dc5f23e307b13285f9d75df86bfdf816c5721e573dec1f9b8aa193c" +checksum = "54681b18a46765f095758388f2d0cf16eb8d4169b639ab575a8f5693af210c7b" dependencies = [ "proc-macro2", "quote", - "syn 1.0.107", + "syn 2.0.38", "wasm-bindgen-backend", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-shared" -version = "0.2.83" +version = "0.2.87" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1c38c045535d93ec4f0b4defec448e4291638ee608530863b1e2ba115d4fff7f" +checksum = "ca6ad05a4870b2bf5fe995117d3728437bd27d7cd5f06f13c17443ef369775a1" [[package]] name = "wasm-encoder" -version = "0.32.0" +version = "0.33.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ba64e81215916eaeb48fee292f29401d69235d62d8b8fd92a7b2844ec5ae5f7" +checksum = "34180c89672b3e4825c3a8db4b61a674f1447afd5fe2445b2d22c3d8b6ea086c" dependencies = [ "leb128", ] [[package]] name = "wasm-metadata" -version = "0.10.3" +version = "0.10.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08dc59d1fa569150851542143ca79438ca56845ccb31696c70225c638e063471" +checksum = "4f2c051ef041d348324b01ff0419f6f6593f094b4897d93c9cf52d5d1ac879ba" dependencies = [ "anyhow", - "indexmap 2.0.0", + "indexmap 2.0.2", "serde", "serde_json", "spdx", @@ -4624,9 +4653,9 @@ dependencies = [ [[package]] name = "wasm-streams" -version = "0.2.3" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6bbae3363c08332cadccd13b67db371814cd214c2524020932f0804b8cf7c078" +checksum = "b4609d447824375f43e1ffbc051b50ad8f4b3ae8219680c94452ea05eb240ac7" dependencies = [ "futures-util", "js-sys", @@ -4637,19 +4666,19 @@ dependencies = [ [[package]] name = "wasmparser" -version = "0.112.0" +version = "0.113.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e986b010f47fcce49cf8ea5d5f9e5d2737832f12b53ae8ae785bbe895d0877bf" +checksum = "286049849b5a5bd09a8773171be96824afabffc7cc3df6caaf33a38db6cd07ae" dependencies = [ - "indexmap 2.0.0", + "indexmap 2.0.2", "semver", ] [[package]] name = "wasmprinter" -version = "0.2.64" +version = "0.2.68" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "34ddf5892036cd4b780d505eff1194a0cbc10ed896097656fdcea3744b5e7c2f" +checksum = "537030718ce76e985896e91fe2cac77c1913c8dccd46eaf8ab1a4cd56d824cc3" dependencies = [ "anyhow", "wasmparser", @@ -4657,9 +4686,8 @@ dependencies = [ [[package]] name = "wasmtime" -version = "13.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "16ed7db409c1acf60d33128b2a38bee25aaf38c4bd955ab98a5b623c8294593c" +version = "15.0.0" +source = "git+https://github.com/bytecodealliance/wasmtime?rev=4c34504efb258a0c51c6a5f3f8a5b24d987993b9#4c34504efb258a0c51c6a5f3f8a5b24d987993b9" dependencies = [ "anyhow", "async-trait", @@ -4668,7 +4696,7 @@ dependencies = [ "cfg-if", "encoding_rs", "fxprof-processed-profile", - "indexmap 2.0.0", + "indexmap 2.0.2", "libc", "log", "object", @@ -4697,25 +4725,23 @@ dependencies = [ [[package]] name = "wasmtime-asm-macros" -version = "13.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "53af0f8f6271bd687fe5632c8fe0a0f061d0aa1b99a0cd4e1df8e4cbeb809d2f" +version = "15.0.0" +source = "git+https://github.com/bytecodealliance/wasmtime?rev=4c34504efb258a0c51c6a5f3f8a5b24d987993b9#4c34504efb258a0c51c6a5f3f8a5b24d987993b9" dependencies = [ "cfg-if", ] [[package]] name = "wasmtime-cache" -version = "13.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "41376a7c094335ee08abe6a4eff79a32510cc805a249eff1b5e7adf0a42e7cdf" +version = "15.0.0" +source = "git+https://github.com/bytecodealliance/wasmtime?rev=4c34504efb258a0c51c6a5f3f8a5b24d987993b9#4c34504efb258a0c51c6a5f3f8a5b24d987993b9" dependencies = [ "anyhow", "base64 0.21.4", "bincode", "directories-next", "log", - "rustix 0.38.13", + "rustix 0.38.18", "serde", "serde_derive", "sha2", @@ -4726,14 +4752,13 @@ dependencies = [ [[package]] name = "wasmtime-component-macro" -version = "13.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "74ab5b291f2dad56f1e6929cc61fb7cac68845766ca77c3838b5d05d82c33976" +version = "15.0.0" +source = "git+https://github.com/bytecodealliance/wasmtime?rev=4c34504efb258a0c51c6a5f3f8a5b24d987993b9#4c34504efb258a0c51c6a5f3f8a5b24d987993b9" dependencies = [ "anyhow", "proc-macro2", "quote", - "syn 2.0.31", + "syn 2.0.38", "wasmtime-component-util", "wasmtime-wit-bindgen", "wit-parser", @@ -4741,15 +4766,13 @@ dependencies = [ [[package]] name = "wasmtime-component-util" -version = "13.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "21436177bf19f6b60dc0b83ad5872e849892a4a90c3572785e1a28c0e2e1132c" +version = "15.0.0" +source = "git+https://github.com/bytecodealliance/wasmtime?rev=4c34504efb258a0c51c6a5f3f8a5b24d987993b9#4c34504efb258a0c51c6a5f3f8a5b24d987993b9" [[package]] name = "wasmtime-cranelift" -version = "13.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "920e42058862d1f7a3dd3fca73cb495a20d7506e3ada4bbc0a9780cd636da7ca" +version = "15.0.0" +source = "git+https://github.com/bytecodealliance/wasmtime?rev=4c34504efb258a0c51c6a5f3f8a5b24d987993b9#4c34504efb258a0c51c6a5f3f8a5b24d987993b9" dependencies = [ "anyhow", "cfg-if", @@ -4772,9 +4795,8 @@ dependencies = [ [[package]] name = "wasmtime-cranelift-shared" -version = "13.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "516d63bbe18219e64a9705cf3a2c865afe1fb711454ea03091dc85a1d708194d" +version = "15.0.0" +source = "git+https://github.com/bytecodealliance/wasmtime?rev=4c34504efb258a0c51c6a5f3f8a5b24d987993b9#4c34504efb258a0c51c6a5f3f8a5b24d987993b9" dependencies = [ "anyhow", "cranelift-codegen", @@ -4788,14 +4810,13 @@ dependencies = [ [[package]] name = "wasmtime-environ" -version = "13.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "59cef239d663885f1427f8b8f4fde7be6075249c282580d94b480f11953ca194" +version = "15.0.0" +source = "git+https://github.com/bytecodealliance/wasmtime?rev=4c34504efb258a0c51c6a5f3f8a5b24d987993b9#4c34504efb258a0c51c6a5f3f8a5b24d987993b9" dependencies = [ "anyhow", "cranelift-entity", "gimli", - "indexmap 2.0.0", + "indexmap 2.0.2", "log", "object", "serde", @@ -4811,13 +4832,12 @@ dependencies = [ [[package]] name = "wasmtime-fiber" -version = "13.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2ef118b557df6193cd82cfb45ab57cd12388fedfe2bb76f090b2d77c96c1b56e" +version = "15.0.0" +source = "git+https://github.com/bytecodealliance/wasmtime?rev=4c34504efb258a0c51c6a5f3f8a5b24d987993b9#4c34504efb258a0c51c6a5f3f8a5b24d987993b9" dependencies = [ "cc", "cfg-if", - "rustix 0.38.13", + "rustix 0.38.18", "wasmtime-asm-macros", "wasmtime-versioned-export-macros", "windows-sys 0.48.0", @@ -4825,9 +4845,8 @@ dependencies = [ [[package]] name = "wasmtime-jit" -version = "13.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c8089d5909b8f923aad57702ebaacb7b662aa9e43a3f71e83e025c5379a1205f" +version = "15.0.0" +source = "git+https://github.com/bytecodealliance/wasmtime?rev=4c34504efb258a0c51c6a5f3f8a5b24d987993b9#4c34504efb258a0c51c6a5f3f8a5b24d987993b9" dependencies = [ "addr2line", "anyhow", @@ -4839,7 +4858,7 @@ dependencies = [ "log", "object", "rustc-demangle", - "rustix 0.38.13", + "rustix 0.38.18", "serde", "serde_derive", "target-lexicon", @@ -4852,21 +4871,19 @@ dependencies = [ [[package]] name = "wasmtime-jit-debug" -version = "13.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b13924aedf6799ad66edb25500a20e3226629978b30a958c55285352bad130a" +version = "15.0.0" +source = "git+https://github.com/bytecodealliance/wasmtime?rev=4c34504efb258a0c51c6a5f3f8a5b24d987993b9#4c34504efb258a0c51c6a5f3f8a5b24d987993b9" dependencies = [ "object", "once_cell", - "rustix 0.38.13", + "rustix 0.38.18", "wasmtime-versioned-export-macros", ] [[package]] name = "wasmtime-jit-icache-coherence" -version = "13.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c6ff5f3707a5e3797deeeeac6ac26b2e1dd32dbc06693c0ab52e8ac4d18ec706" +version = "15.0.0" +source = "git+https://github.com/bytecodealliance/wasmtime?rev=4c34504efb258a0c51c6a5f3f8a5b24d987993b9#4c34504efb258a0c51c6a5f3f8a5b24d987993b9" dependencies = [ "cfg-if", "libc", @@ -4875,23 +4892,22 @@ dependencies = [ [[package]] name = "wasmtime-runtime" -version = "13.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "11ab4ce04ac05342edfa7f42895f2a5d8b16ee914330869acb865cd1facf265f" +version = "15.0.0" +source = "git+https://github.com/bytecodealliance/wasmtime?rev=4c34504efb258a0c51c6a5f3f8a5b24d987993b9#4c34504efb258a0c51c6a5f3f8a5b24d987993b9" dependencies = [ "anyhow", "cc", "cfg-if", "encoding_rs", - "indexmap 2.0.0", + "indexmap 2.0.2", "libc", "log", "mach", "memfd", - "memoffset 0.9.0", + "memoffset", "paste", "rand 0.8.5", - "rustix 0.38.13", + "rustix 0.38.18", "sptr", "wasm-encoder", "wasmtime-asm-macros", @@ -4905,9 +4921,8 @@ dependencies = [ [[package]] name = "wasmtime-types" -version = "13.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ecf61e21d5bd95e1ad7fa42b7bdabe21220682d6a6046d376edca29760849222" +version = "15.0.0" +source = "git+https://github.com/bytecodealliance/wasmtime?rev=4c34504efb258a0c51c6a5f3f8a5b24d987993b9#4c34504efb258a0c51c6a5f3f8a5b24d987993b9" dependencies = [ "cranelift-entity", "serde", @@ -4918,20 +4933,18 @@ dependencies = [ [[package]] name = "wasmtime-versioned-export-macros" -version = "13.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fe877472cbdd6d96b4ecdc112af764e3b9d58c2e4175a87828f892ab94c60643" +version = "15.0.0" +source = "git+https://github.com/bytecodealliance/wasmtime?rev=4c34504efb258a0c51c6a5f3f8a5b24d987993b9#4c34504efb258a0c51c6a5f3f8a5b24d987993b9" dependencies = [ "proc-macro2", "quote", - "syn 2.0.31", + "syn 2.0.38", ] [[package]] name = "wasmtime-wasi" -version = "13.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6db393deb775e8bece53a6869be6425e46b28426aa7709df8c529a19759f4be" +version = "15.0.0" +source = "git+https://github.com/bytecodealliance/wasmtime?rev=4c34504efb258a0c51c6a5f3f8a5b24d987993b9#4c34504efb258a0c51c6a5f3f8a5b24d987993b9" dependencies = [ "anyhow", "async-trait", @@ -4946,14 +4959,15 @@ dependencies = [ "futures", "io-extras", "io-lifetimes 2.0.2", - "is-terminal", "libc", + "log", "once_cell", - "rustix 0.38.13", + "rustix 0.38.18", "system-interface", "thiserror", "tokio", "tracing", + "url", "wasi-cap-std-sync", "wasi-common", "wasi-tokio", @@ -4964,9 +4978,8 @@ dependencies = [ [[package]] name = "wasmtime-winch" -version = "13.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0bc5a770003807c55f2187a0092dea01722b0e24151e35816bd5091538bb8e88" +version = "15.0.0" +source = "git+https://github.com/bytecodealliance/wasmtime?rev=4c34504efb258a0c51c6a5f3f8a5b24d987993b9#4c34504efb258a0c51c6a5f3f8a5b24d987993b9" dependencies = [ "anyhow", "cranelift-codegen", @@ -4981,21 +4994,19 @@ dependencies = [ [[package]] name = "wasmtime-wit-bindgen" -version = "13.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62003d48822f89cc393e93643366ddbee1766779c0874353b8ba2ede4679fbf9" +version = "15.0.0" +source = "git+https://github.com/bytecodealliance/wasmtime?rev=4c34504efb258a0c51c6a5f3f8a5b24d987993b9#4c34504efb258a0c51c6a5f3f8a5b24d987993b9" dependencies = [ "anyhow", "heck", - "indexmap 2.0.0", + "indexmap 2.0.2", "wit-parser", ] [[package]] name = "wasmtime-wmemcheck" -version = "13.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5412bb464066d64c3398c96e6974348f90fa2a55110ad7da3f9295438cd4de84" +version = "15.0.0" +source = "git+https://github.com/bytecodealliance/wasmtime?rev=4c34504efb258a0c51c6a5f3f8a5b24d987993b9#4c34504efb258a0c51c6a5f3f8a5b24d987993b9" [[package]] name = "wast" @@ -5008,9 +5019,9 @@ dependencies = [ [[package]] name = "wast" -version = "64.0.0" +version = "66.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a259b226fd6910225aa7baeba82f9d9933b6d00f2ce1b49b80fa4214328237cc" +checksum = "0da7529bb848d58ab8bf32230fc065b363baee2bd338d5e58c589a1e7d83ad07" dependencies = [ "leb128", "memchr", @@ -5020,47 +5031,43 @@ dependencies = [ [[package]] name = "wat" -version = "1.0.71" +version = "1.0.75" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "53253d920ab413fca1c7dc2161d601c79b4fdf631d0ba51dd4343bf9b556c3f6" +checksum = "4780374047c65b6b6e86019093fe80c18b66825eb684df778a4e068282a780e7" dependencies = [ - "wast 64.0.0", + "wast 66.0.0", ] [[package]] name = "web-sys" -version = "0.3.60" +version = "0.3.64" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bcda906d8be16e728fd5adc5b729afad4e444e106ab28cd1c7256e54fa61510f" +checksum = "9b85cbef8c220a6abc02aefd892dfc0fc23afb1c6a426316ec33253a3877249b" dependencies = [ "js-sys", "wasm-bindgen", ] [[package]] -name = "webpki" -version = "0.22.0" +name = "webpki-roots" +version = "0.25.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f095d78192e208183081cc07bc5515ef55216397af48b873e5edcd72637fa1bd" -dependencies = [ - "ring", - "untrusted", -] +checksum = "14247bb57be4f377dfb94c72830b8ce8fc6beac03cf4bf7b9732eadd414123fc" [[package]] -name = "webpki-roots" -version = "0.22.6" +name = "whoami" +version = "1.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6c71e40d7d2c34a5106301fb632274ca37242cd0c9d3e64dbece371a40a2d87" +checksum = "22fc3756b8a9133049b26c7f61ab35416c130e8c09b660f5b3958b446f52cc50" dependencies = [ - "webpki", + "wasm-bindgen", + "web-sys", ] [[package]] name = "wiggle" -version = "13.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da341f21516453768bd115bdc17b186c0a1ab6773c2b2eeab44a062db49bd616" +version = "15.0.0" +source = "git+https://github.com/bytecodealliance/wasmtime?rev=4c34504efb258a0c51c6a5f3f8a5b24d987993b9#4c34504efb258a0c51c6a5f3f8a5b24d987993b9" dependencies = [ "anyhow", "async-trait", @@ -5073,28 +5080,26 @@ dependencies = [ [[package]] name = "wiggle-generate" -version = "13.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e22c6bd943a4bae37052b79d249fb32d7afa22b3f6a147a5f2e7bc2b9f901879" +version = "15.0.0" +source = "git+https://github.com/bytecodealliance/wasmtime?rev=4c34504efb258a0c51c6a5f3f8a5b24d987993b9#4c34504efb258a0c51c6a5f3f8a5b24d987993b9" dependencies = [ "anyhow", "heck", "proc-macro2", "quote", "shellexpand 2.1.2", - "syn 2.0.31", + "syn 2.0.38", "witx", ] [[package]] name = "wiggle-macro" -version = "13.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7d72d838b7c9302b2ca7c44f36d6af5ce1988239a16deba951d99c4630d17caf" +version = "15.0.0" +source = "git+https://github.com/bytecodealliance/wasmtime?rev=4c34504efb258a0c51c6a5f3f8a5b24d987993b9#4c34504efb258a0c51c6a5f3f8a5b24d987993b9" dependencies = [ "proc-macro2", "quote", - "syn 2.0.31", + "syn 2.0.38", "wiggle-generate", ] @@ -5116,9 +5121,9 @@ checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" [[package]] name = "winapi-util" -version = "0.1.5" +version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70ec6ce85bb158151cae5e5c87f95a8e97d2c0c4b001223f33a334e3ce5de178" +checksum = "f29e6f9198ba0d26b4c9f07dbe6f9ed633e1f3d5b8b414090084349e46a52596" dependencies = [ "winapi", ] @@ -5131,9 +5136,8 @@ checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" [[package]] name = "winch-codegen" -version = "0.11.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "50647204d600a2a112eefac0645ba6653809a15bd362c7e4e6a049a5bdff0de9" +version = "0.13.0" +source = "git+https://github.com/bytecodealliance/wasmtime?rev=4c34504efb258a0c51c6a5f3f8a5b24d987993b9#4c34504efb258a0c51c6a5f3f8a5b24d987993b9" dependencies = [ "anyhow", "cranelift-codegen", @@ -5145,21 +5149,6 @@ dependencies = [ "wasmtime-environ", ] -[[package]] -name = "windows-sys" -version = "0.42.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a3e1820f08b8513f676f7ab6c1f99ff312fb97b553d30ff4dd86f9f15728aa7" -dependencies = [ - "windows_aarch64_gnullvm 0.42.2", - "windows_aarch64_msvc 0.42.2", - "windows_i686_gnu 0.42.2", - "windows_i686_msvc 0.42.2", - "windows_x86_64_gnu 0.42.2", - "windows_x86_64_gnullvm 0.42.2", - "windows_x86_64_msvc 0.42.2", -] - [[package]] name = "windows-sys" version = "0.45.0" @@ -5175,7 +5164,7 @@ version = "0.48.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9" dependencies = [ - "windows-targets 0.48.0", + "windows-targets 0.48.5", ] [[package]] @@ -5195,17 +5184,17 @@ dependencies = [ [[package]] name = "windows-targets" -version = "0.48.0" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7b1eb6f0cd7c80c79759c929114ef071b87354ce476d9d94271031c0497adfd5" +checksum = "9a2fa6e2155d7247be68c096456083145c183cbbbc2764150dda45a87197940c" dependencies = [ - "windows_aarch64_gnullvm 0.48.0", - "windows_aarch64_msvc 0.48.0", - "windows_i686_gnu 0.48.0", - "windows_i686_msvc 0.48.0", - "windows_x86_64_gnu 0.48.0", - "windows_x86_64_gnullvm 0.48.0", - "windows_x86_64_msvc 0.48.0", + "windows_aarch64_gnullvm 0.48.5", + "windows_aarch64_msvc 0.48.5", + "windows_i686_gnu 0.48.5", + "windows_i686_msvc 0.48.5", + "windows_x86_64_gnu 0.48.5", + "windows_x86_64_gnullvm 0.48.5", + "windows_x86_64_msvc 0.48.5", ] [[package]] @@ -5216,9 +5205,9 @@ checksum = "597a5118570b68bc08d8d59125332c54f1ba9d9adeedeef5b99b02ba2b0698f8" [[package]] name = "windows_aarch64_gnullvm" -version = "0.48.0" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "91ae572e1b79dba883e0d315474df7305d12f569b400fcf90581b06062f7e1bc" +checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" [[package]] name = "windows_aarch64_msvc" @@ -5228,9 +5217,9 @@ checksum = "e08e8864a60f06ef0d0ff4ba04124db8b0fb3be5776a5cd47641e942e58c4d43" [[package]] name = "windows_aarch64_msvc" -version = "0.48.0" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b2ef27e0d7bdfcfc7b868b317c1d32c641a6fe4629c171b8928c7b08d98d7cf3" +checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" [[package]] name = "windows_i686_gnu" @@ -5240,9 +5229,9 @@ checksum = "c61d927d8da41da96a81f029489353e68739737d3beca43145c8afec9a31a84f" [[package]] name = "windows_i686_gnu" -version = "0.48.0" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "622a1962a7db830d6fd0a69683c80a18fda201879f0f447f065a3b7467daa241" +checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" [[package]] name = "windows_i686_msvc" @@ -5252,9 +5241,9 @@ checksum = "44d840b6ec649f480a41c8d80f9c65108b92d89345dd94027bfe06ac444d1060" [[package]] name = "windows_i686_msvc" -version = "0.48.0" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4542c6e364ce21bf45d69fdd2a8e455fa38d316158cfd43b3ac1c5b1b19f8e00" +checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" [[package]] name = "windows_x86_64_gnu" @@ -5264,9 +5253,9 @@ checksum = "8de912b8b8feb55c064867cf047dda097f92d51efad5b491dfb98f6bbb70cb36" [[package]] name = "windows_x86_64_gnu" -version = "0.48.0" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca2b8a661f7628cbd23440e50b05d705db3686f894fc9580820623656af974b1" +checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" [[package]] name = "windows_x86_64_gnullvm" @@ -5276,9 +5265,9 @@ checksum = "26d41b46a36d453748aedef1486d5c7a85db22e56aff34643984ea85514e94a3" [[package]] name = "windows_x86_64_gnullvm" -version = "0.48.0" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7896dbc1f41e08872e9d5e8f8baa8fdd2677f29468c4e156210174edc7f7b953" +checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" [[package]] name = "windows_x86_64_msvc" @@ -5288,17 +5277,18 @@ checksum = "9aec5da331524158c6d1a4ac0ab1541149c0b9505fde06423b02f5ef0106b9f0" [[package]] name = "windows_x86_64_msvc" -version = "0.48.0" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a515f5799fe4961cb532f983ce2b23082366b898e52ffbce459c86f67c8378a" +checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" [[package]] name = "winreg" -version = "0.10.1" +version = "0.50.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "80d0f4e272c85def139476380b12f9ac60926689dd2e01d4923222f40580869d" +checksum = "524e57b2c537c0f9b1e69f1965311ec12182b4122e45035b1508cd24d2adadb1" dependencies = [ - "winapi", + "cfg-if", + "windows-sys 0.48.0", ] [[package]] @@ -5313,13 +5303,13 @@ dependencies = [ [[package]] name = "wit-component" -version = "0.14.0" +version = "0.14.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "66d9f2d16dd55d1a372dcfd4b7a466ea876682a5a3cb97e71ec9eef04affa876" +checksum = "2e2bf941487fc5afa9e3fc94761f6b80ecef5a2bed6239b959d23d9de69e3448" dependencies = [ "anyhow", "bitflags 2.4.0", - "indexmap 2.0.0", + "indexmap 2.0.2", "log", "serde", "serde_json", @@ -5331,16 +5321,18 @@ dependencies = [ [[package]] name = "wit-parser" -version = "0.11.0" +version = "0.11.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "61e8b849bea13cc2315426b16efe6eb6813466d78f5fde69b0bb150c9c40e0dc" +checksum = "a39edca9abb16309def3843af73b58d47d243fe33a9ceee572446bcc57556b9a" dependencies = [ "anyhow", "id-arena", - "indexmap 2.0.0", + "indexmap 2.0.2", "log", "pulldown-cmark", "semver", + "serde", + "serde_json", "unicode-xid", "url", ] @@ -5348,8 +5340,7 @@ dependencies = [ [[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?rev=4c34504efb258a0c51c6a5f3f8a5b24d987993b9#4c34504efb258a0c51c6a5f3f8a5b24d987993b9" dependencies = [ "anyhow", "log", @@ -5368,9 +5359,9 @@ dependencies = [ [[package]] name = "xattr" -version = "1.0.0" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ea263437ca03c1522846a4ddafbca2542d0ad5ed9b784909d4b27b76f62bc34a" +checksum = "f4686009f71ff3e5c4dbcf1a282d0a44db3f021ba69350cd42086b3e5f1c6985" dependencies = [ "libc", ] @@ -5390,7 +5381,7 @@ dependencies = [ "flate2", "hmac", "pbkdf2", - "sha1 0.10.5", + "sha1 0.10.6", "time", "zstd", ] @@ -5416,9 +5407,9 @@ dependencies = [ [[package]] name = "zstd-sys" -version = "2.0.5+zstd.1.5.2" +version = "2.0.8+zstd.1.5.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "edc50ffce891ad571e9f9afe5039c4837bede781ac4bb13052ed7ae695518596" +checksum = "5556e6ee25d32df2586c098bbfa278803692a20d0ab9565e049480d52707ec8c" dependencies = [ "cc", "libc", diff --git a/examples/spin-timer/Cargo.toml b/examples/spin-timer/Cargo.toml index 2a43e77b4c..c7576a9b66 100644 --- a/examples/spin-timer/Cargo.toml +++ b/examples/spin-timer/Cargo.toml @@ -14,6 +14,8 @@ spin-core = { path = "../../crates/core" } spin-trigger = { path = "../../crates/trigger" } tokio = { version = "1.11", features = ["full"] } tokio-scoped = "0.2.0" -wasmtime = { version = "13.0.0", features = ["component-model"] } +wasmtime = { git = "https://github.com/bytecodealliance/wasmtime", rev = "c796ce7376a57a40605f03e74bd78cefcc9acf3a", features = [ + "component-model", +] } [workspace] diff --git a/examples/spin-timer/app-example/Cargo.lock b/examples/spin-timer/app-example/Cargo.lock index e105091a9d..a05d34ef4a 100644 --- a/examples/spin-timer/app-example/Cargo.lock +++ b/examples/spin-timer/app-example/Cargo.lock @@ -4,15 +4,9 @@ version = 3 [[package]] name = "anyhow" -version = "1.0.71" +version = "1.0.75" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c7d0618f0e0b7e8ff11427422b64564d5fb0be1940354bfe2e0529b18a9d9b8" - -[[package]] -name = "autocfg" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" +checksum = "a4668cab20f66d8d020e1fbc0ebe47217433c1b6c8f2040faf858554e394ace6" [[package]] name = "bitflags" @@ -22,9 +16,9 @@ checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" [[package]] name = "bitflags" -version = "2.2.1" +version = "2.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "24a6904aef64d73cf10ab17ebace7befb918b82164785cb89907993be7f83813" +checksum = "b4682ae6287fcf752ecaabbfcc7b6f9b72aa33933dc23a554d853aea8eea8635" [[package]] name = "cfg-if" @@ -32,6 +26,12 @@ version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" +[[package]] +name = "equivalent" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" + [[package]] name = "form_urlencoded" version = "1.1.0" @@ -43,9 +43,9 @@ dependencies = [ [[package]] name = "hashbrown" -version = "0.12.3" +version = "0.14.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" +checksum = "7dfda62a12f55daeae5015f81b0baea145391cb4520f86c248fc615d72640d12" [[package]] name = "heck" @@ -74,15 +74,21 @@ dependencies = [ [[package]] name = "indexmap" -version = "1.9.3" +version = "2.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bd070e393353796e801d209ad339e89596eb4c8d430d18ede6a1cced8fafbd99" +checksum = "8adf3ddd720272c6ea8bf59463c04e0f93d0bbf7c5439b691bca2987e0270897" dependencies = [ - "autocfg", + "equivalent", "hashbrown", "serde", ] +[[package]] +name = "itoa" +version = "1.0.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "af150ab688ff2122fcef229be89cb50dd66af9e01a4ff320cc137eecc9bacc38" + [[package]] name = "leb128" version = "0.2.5" @@ -112,18 +118,18 @@ checksum = "478c572c3d73181ff3c2539045f6eb99e5491218eae919370993b890cdbdd98e" [[package]] name = "proc-macro2" -version = "1.0.56" +version = "1.0.67" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2b63bdb0cd06f1f4dedf69b254734f9b45af66e4a031e42a7480257d9898b435" +checksum = "3d433d9f1a3e8c1263d9456598b16fec66f4acc9a74dacffd35c7bb09b3a1328" dependencies = [ "unicode-ident", ] [[package]] name = "pulldown-cmark" -version = "0.8.0" +version = "0.9.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ffade02495f22453cd593159ea2f59827aae7f53fa8323f756799b670881dcf8" +checksum = "77a1a2f1f0a7ecff9c31abbe177637be0e97a0aef46cf8738ece09327985d998" dependencies = [ "bitflags 1.3.2", "memchr", @@ -132,13 +138,19 @@ dependencies = [ [[package]] name = "quote" -version = "1.0.26" +version = "1.0.33" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4424af4bf778aae2051a77b60283332f386554255d722233d09fbfc7e30da2fc" +checksum = "5267fca4496028628a95160fc423a33e8b2e6af8a5302579e322e4b520293cae" dependencies = [ "proc-macro2", ] +[[package]] +name = "ryu" +version = "1.0.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1ad4cc8da4ef723ed60bced201181d83791ad433213d8c24efffda1eec85d741" + [[package]] name = "semver" version = "1.0.17" @@ -147,40 +159,55 @@ checksum = "bebd363326d05ec3e2f532ab7660680f3b02130d780c299bca73469d521bc0ed" [[package]] name = "serde" -version = "1.0.147" +version = "1.0.188" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d193d69bae983fc11a79df82342761dfbf28a99fc8d203dca4c3c1b590948965" +checksum = "cf9e0fcba69a370eed61bcf2b728575f726b50b55cba78064753d708ddc7549e" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.147" +version = "1.0.188" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4f1d362ca8fc9c3e3a7484440752472d68a6caa98f1ab81d99b5dfe517cec852" +checksum = "4eca7ac642d82aa35b60049a6eccb4be6be75e599bd2e9adb5f875a737654af2" dependencies = [ "proc-macro2", "quote", - "syn 1.0.103", + "syn", ] [[package]] -name = "syn" -version = "1.0.103" +name = "serde_json" +version = "1.0.107" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a864042229133ada95abf3b54fdc62ef5ccabe9515b64717bcb9a1919e59445d" +checksum = "6b420ce6e3d8bd882e9b243c6eed35dbc9a6110c9769e74b584e0d68d1f20c65" dependencies = [ - "proc-macro2", - "quote", - "unicode-ident", + "itoa", + "ryu", + "serde", +] + +[[package]] +name = "smallvec" +version = "1.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "942b4a808e05215192e39f4ab80813e599068285906cc91aa64f923db842bd5a" + +[[package]] +name = "spdx" +version = "0.10.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b19b32ed6d899ab23174302ff105c1577e45a06b08d4fe0a9dd13ce804bbbf71" +dependencies = [ + "smallvec", ] [[package]] name = "syn" -version = "2.0.15" +version = "2.0.37" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a34fcf3e8b60f57e6a14301a2e916d323af98b0ea63c599441eec8558660c822" +checksum = "7303ef2c05cd654186cb250d29049a24840ca25d2747c25c0381c8d9e2f582e8" dependencies = [ "proc-macro2", "quote", @@ -270,31 +297,33 @@ checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" [[package]] name = "wasm-encoder" -version = "0.29.0" +version = "0.33.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "18c41dbd92eaebf3612a39be316540b8377c871cb9bde6b064af962984912881" +checksum = "34180c89672b3e4825c3a8db4b61a674f1447afd5fe2445b2d22c3d8b6ea086c" dependencies = [ "leb128", ] [[package]] name = "wasm-metadata" -version = "0.8.0" +version = "0.10.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "36e5156581ff4a302405c44ca7c85347563ca431d15f1a773f12c9c7b9a6cdc9" +checksum = "4f2c051ef041d348324b01ff0419f6f6593f094b4897d93c9cf52d5d1ac879ba" dependencies = [ "anyhow", "indexmap", "serde", + "serde_json", + "spdx", "wasm-encoder", "wasmparser", ] [[package]] name = "wasmparser" -version = "0.107.0" +version = "0.113.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "29e3ac9b780c7dda0cac7a52a5d6d2d6707cc6e3451c9db209b6c758f40d7acb" +checksum = "286049849b5a5bd09a8773171be96824afabffc7cc3df6caaf33a38db6cd07ae" dependencies = [ "indexmap", "semver", @@ -302,19 +331,17 @@ dependencies = [ [[package]] name = "wit-bindgen" -version = "0.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "392d16e9e46cc7ca98125bc288dd5e4db469efe8323d3e0dac815ca7f2398522" +version = "0.12.0" +source = "git+https://github.com/bytecodealliance/wit-bindgen?rev=46fba30bb667a3a4962f63b1cc28b84427b49114#46fba30bb667a3a4962f63b1cc28b84427b49114" dependencies = [ - "bitflags 2.2.1", + "bitflags 2.4.0", "wit-bindgen-rust-macro", ] [[package]] name = "wit-bindgen-core" -version = "0.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d422d36cbd78caa0e18c3371628447807c66ee72466b69865ea7e33682598158" +version = "0.12.0" +source = "git+https://github.com/bytecodealliance/wit-bindgen?rev=46fba30bb667a3a4962f63b1cc28b84427b49114#46fba30bb667a3a4962f63b1cc28b84427b49114" dependencies = [ "anyhow", "wit-component", @@ -323,36 +350,25 @@ dependencies = [ [[package]] name = "wit-bindgen-rust" -version = "0.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b76db68264f5d2089dc4652581236d8e75c5b89338de6187716215fd0e68ba3" +version = "0.12.0" +source = "git+https://github.com/bytecodealliance/wit-bindgen?rev=46fba30bb667a3a4962f63b1cc28b84427b49114#46fba30bb667a3a4962f63b1cc28b84427b49114" dependencies = [ + "anyhow", "heck", "wasm-metadata", "wit-bindgen-core", - "wit-bindgen-rust-lib", "wit-component", ] -[[package]] -name = "wit-bindgen-rust-lib" -version = "0.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1c50f334bc08b0903a43387f6eea6ef6aa9eb2a085729f1677b29992ecef20ba" -dependencies = [ - "heck", - "wit-bindgen-core", -] - [[package]] name = "wit-bindgen-rust-macro" -version = "0.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ced38a5e174940c6a41ae587babeadfd2e2c2dc32f3b6488bcdca0e8922cf3f3" +version = "0.12.0" +source = "git+https://github.com/bytecodealliance/wit-bindgen?rev=46fba30bb667a3a4962f63b1cc28b84427b49114#46fba30bb667a3a4962f63b1cc28b84427b49114" dependencies = [ "anyhow", "proc-macro2", - "syn 2.0.15", + "quote", + "syn", "wit-bindgen-core", "wit-bindgen-rust", "wit-component", @@ -360,14 +376,16 @@ dependencies = [ [[package]] name = "wit-component" -version = "0.11.0" +version = "0.14.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7cbd4c7f8f400327c482c88571f373844b7889e61460650d650fc5881bb3575c" +checksum = "2e2bf941487fc5afa9e3fc94761f6b80ecef5a2bed6239b959d23d9de69e3448" dependencies = [ "anyhow", - "bitflags 1.3.2", + "bitflags 2.4.0", "indexmap", "log", + "serde", + "serde_json", "wasm-encoder", "wasm-metadata", "wasmparser", @@ -376,9 +394,9 @@ dependencies = [ [[package]] name = "wit-parser" -version = "0.8.0" +version = "0.11.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6daec9f093dbaea0e94043eeb92ece327bbbe70c86b1f41aca9bbfefd7f050f0" +checksum = "a39edca9abb16309def3843af73b58d47d243fe33a9ceee572446bcc57556b9a" dependencies = [ "anyhow", "id-arena", @@ -386,6 +404,8 @@ dependencies = [ "log", "pulldown-cmark", "semver", + "serde", + "serde_json", "unicode-xid", "url", ] diff --git a/examples/spin-timer/app-example/Cargo.toml b/examples/spin-timer/app-example/Cargo.toml index afc95e1190..42d4484c25 100644 --- a/examples/spin-timer/app-example/Cargo.toml +++ b/examples/spin-timer/app-example/Cargo.toml @@ -6,9 +6,9 @@ version = "0.1.0" edition = "2021" [lib] -crate-type = [ "cdylib" ] +crate-type = ["cdylib"] [dependencies] -wit-bindgen = "0.8.0" +wit-bindgen = { git = "https://github.com/bytecodealliance/wit-bindgen", rev = "46fba30bb667a3a4962f63b1cc28b84427b49114" } [workspace] diff --git a/examples/spin-timer/app-example/src/lib.rs b/examples/spin-timer/app-example/src/lib.rs index 7485a60657..c81e25544c 100644 --- a/examples/spin-timer/app-example/src/lib.rs +++ b/examples/spin-timer/app-example/src/lib.rs @@ -1,17 +1,18 @@ wit_bindgen::generate!({ world: "spin-timer", - path: ".." + path: "..", + exports: { + world: MySpinTimer + } }); use fermyon::spin::config; struct MySpinTimer; -impl SpinTimer for MySpinTimer { +impl Guest for MySpinTimer { fn handle_timer_request() { let text = config::get_config("message").unwrap(); println!("{text}"); } } - -export_spin_timer!(MySpinTimer); diff --git a/sdk/rust/Cargo.toml b/sdk/rust/Cargo.toml index 347d25ab38..78514ad779 100644 --- a/sdk/rust/Cargo.toml +++ b/sdk/rust/Cargo.toml @@ -15,10 +15,10 @@ form_urlencoded = "1.0" http_types = { package = "http", version = "0.2" } spin-macro = { path = "macro" } thiserror = "1.0.37" -wit-bindgen = "0.8" +wit-bindgen = { git = "https://github.com/bytecodealliance/wit-bindgen", rev = "46fba30bb667a3a4962f63b1cc28b84427b49114" } routefinder = "0.5.3" -serde_json = {version = "1.0.96", optional = true} -serde = {version = "1.0.163", optional = true} +serde_json = { version = "1.0.96", optional = true } +serde = { version = "1.0.163", optional = true } [features] default = ["export-sdk-language"] diff --git a/sdk/rust/macro/src/lib.rs b/sdk/rust/macro/src/lib.rs index ee2415fab4..96a79d281d 100644 --- a/sdk/rust/macro/src/lib.rs +++ b/sdk/rust/macro/src/lib.rs @@ -1,22 +1,22 @@ use proc_macro::TokenStream; use quote::quote; +const WIT_PATH: &str = concat!(env!("CARGO_MANIFEST_DIR"), "/wit"); + /// The entrypoint to a Spin HTTP component written in Rust. #[proc_macro_attribute] pub fn http_component(_attr: TokenStream, item: TokenStream) -> TokenStream { let func = syn::parse_macro_input!(item as syn::ItemFn); let func_name = &func.sig.ident; + let preamble = preamble(Export::Http); quote!( #func - mod __spin_http { - struct Spin; - ::spin_sdk::export_reactor!(Spin); - - impl ::spin_sdk::inbound_http::InboundHttp for Spin { + #preamble + impl self::exports::fermyon::spin::inbound_http::Guest for Spin { // Implement the `handler` entrypoint for Spin HTTP components. - fn handle_request(req: ::spin_sdk::inbound_http::Request) -> ::spin_sdk::inbound_http::Response { + fn handle_request(req: self::exports::fermyon::spin::inbound_http::Request) -> self::exports::fermyon::spin::inbound_http::Response { match super::#func_name(req.try_into().expect("cannot convert from Spin HTTP request")) { Ok(resp) => resp.try_into().expect("cannot convert to Spin HTTP response"), Err(error) => { @@ -27,7 +27,7 @@ pub fn http_component(_attr: TokenStream, item: TokenStream) -> TokenStream { eprintln!(" caused by: {}", s); source = s.source(); } - ::spin_sdk::inbound_http::Response { + self::exports::fermyon::spin::inbound_http::Response { status: 500, headers: None, body: Some(body.as_bytes().to_vec()), @@ -37,9 +37,120 @@ pub fn http_component(_attr: TokenStream, item: TokenStream) -> TokenStream { } } - impl ::spin_sdk::inbound_redis::InboundRedis for Spin { - fn handle_message(msg: ::spin_sdk::inbound_redis::Payload) -> Result<(), ::spin_sdk::inbound_redis::Error> { - unimplemented!("No implementation for inbound-redis#handle-message"); + mod inbound_http_helpers { + use super::fermyon::spin::http_types as spin_http_types; + + impl TryFrom for http::Request> { + type Error = anyhow::Error; + + fn try_from(spin_req: spin_http_types::Request) -> Result { + let mut http_req = http::Request::builder() + .method(spin_req.method.clone()) + .uri(&spin_req.uri); + + append_request_headers(&mut http_req, &spin_req)?; + + let body = match spin_req.body { + Some(b) => b.to_vec(), + None => Vec::new(), + }; + + let body = Some(bytes::Bytes::from(body)); + + Ok(http_req.body(body)?) + } + } + + impl From for http::Method { + fn from(spin_method: spin_http_types::Method) -> Self { + match spin_method { + spin_http_types::Method::Get => http::Method::GET, + spin_http_types::Method::Post => http::Method::POST, + spin_http_types::Method::Put => http::Method::PUT, + spin_http_types::Method::Delete => http::Method::DELETE, + spin_http_types::Method::Patch => http::Method::PATCH, + spin_http_types::Method::Head => http::Method::HEAD, + spin_http_types::Method::Options => http::Method::OPTIONS, + } + } + } + + fn append_request_headers( + http_req: &mut http::request::Builder, + spin_req: &spin_http_types::Request, + ) -> anyhow::Result<()> { + let headers = http_req.headers_mut().unwrap(); + for (k, v) in &spin_req.headers { + headers.append( + ::from_str(k)?, + http::header::HeaderValue::from_str(v)?, + ); + } + + Ok(()) + } + + impl TryFrom for http::Response> { + type Error = anyhow::Error; + + fn try_from(spin_res: spin_http_types::Response) -> Result { + let mut http_res = http::Response::builder().status(spin_res.status); + append_response_headers(&mut http_res, spin_res.clone())?; + + let body = match spin_res.body { + Some(b) => b.to_vec(), + None => Vec::new(), + }; + let body = Some(bytes::Bytes::from(body)); + + Ok(http_res.body(body)?) + } + } + + fn append_response_headers( + http_res: &mut http::response::Builder, + spin_res: spin_http_types::Response, + ) -> anyhow::Result<()> { + let headers = http_res.headers_mut().unwrap(); + for (k, v) in spin_res.headers.unwrap() { + headers.append( + ::from_str(&k)?, + http::header::HeaderValue::from_str(&v)?, + ); + } + + Ok(()) + } + + impl TryFrom>> for spin_http_types::Response { + type Error = anyhow::Error; + + fn try_from( + http_res: http::Response>, + ) -> Result { + let status = http_res.status().as_u16(); + let headers = Some(outbound_headers(http_res.headers())?); + let body = http_res.body().as_ref().map(|b| b.to_vec()); + + Ok(spin_http_types::Response { + status, + headers, + body, + }) + } + } + + fn outbound_headers(hm: &http::HeaderMap) -> anyhow::Result> { + let mut res = Vec::new(); + + for (k, v) in hm { + res.push(( + k.as_str().to_string(), + std::str::from_utf8(v.as_bytes())?.to_string(), + )); + } + + Ok(res) } } } @@ -52,31 +163,53 @@ pub fn http_component(_attr: TokenStream, item: TokenStream) -> TokenStream { pub fn redis_component(_attr: TokenStream, item: TokenStream) -> TokenStream { let func = syn::parse_macro_input!(item as syn::ItemFn); let func_name = &func.sig.ident; + let preamble = preamble(Export::Redis); quote!( #func - mod __spin_redis { - struct Spin; - ::spin_sdk::export_reactor!(Spin); - - impl ::spin_sdk::inbound_redis::InboundRedis for Spin { - fn handle_message(msg: ::spin_sdk::inbound_redis::Payload) -> Result<(), ::spin_sdk::redis::Error> { + #preamble + impl self::exports::fermyon::spin::inbound_redis::Guest for Spin { + fn handle_message(msg: self::exports::fermyon::spin::inbound_redis::Payload) -> Result<(), self::fermyon::spin::redis_types::Error> { match super::#func_name(msg.try_into().expect("cannot convert from Spin Redis payload")) { Ok(()) => Ok(()), Err(e) => { eprintln!("{}", e); - Err(::spin_sdk::redis::Error::Error) + Err(self::fermyon::spin::redis_types::Error::Error) }, } } } - impl ::spin_sdk::inbound_http::InboundHttp for Spin { - fn handle_request(req: ::spin_sdk::inbound_http::Request) -> ::spin_sdk::inbound_http::Response { - unimplemented!("No implementation for inbound-http#handle-request"); - } - } } ) .into() } + +#[derive(Copy, Clone)] +enum Export { + Http, + Redis, +} + +fn preamble(export: Export) -> proc_macro2::TokenStream { + let export_decl = match export { + Export::Http => quote!("fermyon:spin/inbound-http": Spin), + Export::Redis => quote!("fermyon:spin/inbound-redis": Spin), + }; + let world = match export { + Export::Http => quote!("http-trigger"), + Export::Redis => quote!("redis-trigger"), + }; + quote! { + #![allow(missing_docs)] + ::spin_sdk::wit_bindgen::generate!({ + world: #world, + path: #WIT_PATH, + runtime_path: "::spin_sdk::wit_bindgen::rt", + exports: { + #export_decl + } + }); + struct Spin; + } +} diff --git a/wit/preview2/http-types.wit b/sdk/rust/macro/wit/http-types.wit similarity index 100% rename from wit/preview2/http-types.wit rename to sdk/rust/macro/wit/http-types.wit diff --git a/wit/preview2/inbound-http.wit b/sdk/rust/macro/wit/inbound-http.wit similarity index 100% rename from wit/preview2/inbound-http.wit rename to sdk/rust/macro/wit/inbound-http.wit diff --git a/wit/preview2/inbound-redis.wit b/sdk/rust/macro/wit/inbound-redis.wit similarity index 100% rename from wit/preview2/inbound-redis.wit rename to sdk/rust/macro/wit/inbound-redis.wit diff --git a/wit/preview2/redis-types.wit b/sdk/rust/macro/wit/redis-types.wit similarity index 100% rename from wit/preview2/redis-types.wit rename to sdk/rust/macro/wit/redis-types.wit diff --git a/sdk/rust/macro/wit/world.wit b/sdk/rust/macro/wit/world.wit new file mode 100644 index 0000000000..abd616d423 --- /dev/null +++ b/sdk/rust/macro/wit/world.wit @@ -0,0 +1,9 @@ +package fermyon:spin + +world http-trigger { + export inbound-http +} + +world redis-trigger { + export inbound-redis +} diff --git a/sdk/rust/src/http/router.rs b/sdk/rust/src/http/router.rs index 2aa8c92c7b..56b17b4812 100644 --- a/sdk/rust/src/http/router.rs +++ b/sdk/rust/src/http/router.rs @@ -117,7 +117,7 @@ impl Router { { self.methods_map .entry(method) - .or_insert_with(MethodRouter::new) + .or_default() .add(path, Box::new(handler)) .unwrap(); } diff --git a/sdk/rust/src/key_value.rs b/sdk/rust/src/key_value.rs index bec3cd0487..23c69e7b2c 100644 --- a/sdk/rust/src/key_value.rs +++ b/sdk/rust/src/key_value.rs @@ -4,66 +4,24 @@ //! ways (e.g. via an in-memory table, a local file, or a remote database). Details such as consistency model and //! durability will depend on the implementation and may vary from one to store to the next. -use super::wit::fermyon::spin::key_value; -use key_value::Store as RawStore; +use super::wit::v2::key_value; #[cfg(feature = "json")] use serde::{de::DeserializeOwned, Serialize}; -/// Errors which may be raised by the methods of `Store` -pub use key_value::Error; - -/// Represents a store in which key value tuples may be placed -#[derive(Debug)] -pub struct Store(RawStore); +#[doc(inline)] +pub use key_value::{Error, Store}; impl Store { - /// Open the specified store. - /// - /// If `name` is empty, open the default store. Other stores may also be available depending on the app - /// configuration. - pub fn open(name: impl AsRef) -> Result { - key_value::open(name.as_ref()).map(Self) - } - /// Open the default store. /// /// This is equivalent to `Store::open("default")`. pub fn open_default() -> Result { Self::open("default") } +} - /// Get the value, if any, associated with the specified key in this store. - /// - /// If no value is found, this will return `Err(Error::NoSuchKey)`. - pub fn get(&self, key: impl AsRef) -> Result, Error> { - key_value::get(self.0, key.as_ref()) - } - - /// Set the value for the specified key. - /// - /// This will overwrite any previous value, if present. - pub fn set(&self, key: impl AsRef, value: impl AsRef<[u8]>) -> Result<(), Error> { - key_value::set(self.0, key.as_ref(), value.as_ref()) - } - - /// Delete the tuple for the specified key, if any. - /// - /// This will have no effect and return `Ok(())` if the tuple was not present. - pub fn delete(&self, key: impl AsRef) -> Result<(), Error> { - key_value::delete(self.0, key.as_ref()) - } - - /// Check whether a tuple exists for the specified key. - pub fn exists(&self, key: impl AsRef) -> Result { - key_value::exists(self.0, key.as_ref()) - } - - /// Get the set of keys in this store. - pub fn get_keys(&self) -> Result, Error> { - key_value::get_keys(self.0) - } - +impl Store { #[cfg(feature = "json")] /// Serialize the given data to JSON, then set it as the value for the specified `key`. pub fn set_json( @@ -71,25 +29,12 @@ impl Store { key: impl AsRef, value: &T, ) -> Result<(), anyhow::Error> { - Ok(key_value::set( - self.0, - key.as_ref(), - &serde_json::to_vec(value)?, - )?) + Ok(self.set(key.as_ref(), &serde_json::to_vec(value)?)?) } #[cfg(feature = "json")] /// Deserialize an instance of type `T` from the value of `key`. pub fn get_json(&self, key: impl AsRef) -> Result { - Ok(serde_json::from_slice(&key_value::get( - self.0, - key.as_ref(), - )?)?) - } -} - -impl Drop for Store { - fn drop(&mut self) { - key_value::close(self.0) + Ok(serde_json::from_slice(&self.get(key.as_ref())?)?) } } diff --git a/sdk/rust/src/lib.rs b/sdk/rust/src/lib.rs index fe601a8601..6af517fb5e 100644 --- a/sdk/rust/src/lib.rs +++ b/sdk/rust/src/lib.rs @@ -24,12 +24,11 @@ pub use spin_macro::*; pub mod wit { #![allow(missing_docs)] wit_bindgen::generate!({ - world: "reactor", + world: "platform", path: "../../wit/preview2", - macro_call_prefix: "::spin_sdk::wit::", - duplicate_if_necessary, - macro_export }); + pub use fermyon::spin as v1; + pub use fermyon::spin2_0_0 as v2; } /// Needed by the export macro @@ -87,14 +86,12 @@ pub mod http { pub mod redis { use std::hash::{Hash, Hasher}; - pub use super::wit::fermyon::spin::redis::{ - del, execute, get, incr, publish, sadd, set, smembers, srem, - }; - pub use super::wit::fermyon::spin::redis_types::*; + pub use super::wit::v1::redis::{del, execute, get, incr, publish, sadd, set, smembers, srem}; + pub use super::wit::v1::redis_types::*; impl PartialEq for RedisResult { fn eq(&self, other: &Self) -> bool { - use super::wit::fermyon::spin::redis_types::RedisResult::*; + use RedisResult::*; match (self, other) { (Nil, Nil) => true, (Status(a), Status(b)) => a == b, @@ -109,7 +106,7 @@ pub mod redis { impl Hash for RedisResult { fn hash(&self, state: &mut H) { - use super::wit::fermyon::spin::redis_types::RedisResult::*; + use RedisResult::*; match self { Nil => (), @@ -131,134 +128,8 @@ pub mod mysql; #[allow(missing_docs)] pub mod config { /// Exports the generated Spin config items. - pub use super::wit::fermyon::spin::config::{get_config as get, Error}; + pub use super::wit::v1::config::{get_config as get, Error}; } -/// Inbound http trigger functionality -// Hide the docs since this is only needed for the macro #[doc(hidden)] -pub mod inbound_http { - use super::wit::exports::fermyon::spin::inbound_http; - use super::wit::fermyon::spin::http_types as spin_http_types; - pub use inbound_http::*; - - impl TryFrom for http_types::Request> { - type Error = anyhow::Error; - - fn try_from(spin_req: inbound_http::Request) -> Result { - let mut http_req = http_types::Request::builder() - .method(spin_req.method) - .uri(&spin_req.uri); - - append_request_headers(&mut http_req, &spin_req)?; - - let body = match spin_req.body { - Some(b) => b.to_vec(), - None => Vec::new(), - }; - - let body = Some(bytes::Bytes::from(body)); - - Ok(http_req.body(body)?) - } - } - - impl From for http_types::Method { - fn from(spin_method: spin_http_types::Method) -> Self { - match spin_method { - spin_http_types::Method::Get => http_types::Method::GET, - spin_http_types::Method::Post => http_types::Method::POST, - spin_http_types::Method::Put => http_types::Method::PUT, - spin_http_types::Method::Delete => http_types::Method::DELETE, - spin_http_types::Method::Patch => http_types::Method::PATCH, - spin_http_types::Method::Head => http_types::Method::HEAD, - spin_http_types::Method::Options => http_types::Method::OPTIONS, - } - } - } - - fn append_request_headers( - http_req: &mut http_types::request::Builder, - spin_req: &inbound_http::Request, - ) -> anyhow::Result<()> { - let headers = http_req.headers_mut().unwrap(); - for (k, v) in &spin_req.headers { - headers.append( - ::from_str(k)?, - http_types::header::HeaderValue::from_str(v)?, - ); - } - - Ok(()) - } - - impl TryFrom for http_types::Response> { - type Error = anyhow::Error; - - fn try_from(spin_res: inbound_http::Response) -> Result { - let mut http_res = http_types::Response::builder().status(spin_res.status); - append_response_headers(&mut http_res, spin_res.clone())?; - - let body = match spin_res.body { - Some(b) => b.to_vec(), - None => Vec::new(), - }; - let body = Some(bytes::Bytes::from(body)); - - Ok(http_res.body(body)?) - } - } - - fn append_response_headers( - http_res: &mut http_types::response::Builder, - spin_res: inbound_http::Response, - ) -> anyhow::Result<()> { - let headers = http_res.headers_mut().unwrap(); - for (k, v) in spin_res.headers.unwrap() { - headers.append( - ::from_str(&k)?, - http_types::header::HeaderValue::from_str(&v)?, - ); - } - - Ok(()) - } - - impl TryFrom>> for inbound_http::Response { - type Error = anyhow::Error; - - fn try_from( - http_res: http_types::Response>, - ) -> Result { - let status = http_res.status().as_u16(); - let headers = Some(outbound_headers(http_res.headers())?); - let body = http_res.body().as_ref().map(|b| b.to_vec()); - - Ok(inbound_http::Response { - status, - headers, - body, - }) - } - } - - fn outbound_headers(hm: &http_types::HeaderMap) -> anyhow::Result> { - let mut res = Vec::new(); - - for (k, v) in hm { - res.push(( - k.as_str().to_string(), - std::str::from_utf8(v.as_bytes())?.to_string(), - )); - } - - Ok(res) - } -} - -/// Inbound redis trigger functionality -// Hide the docs since this is only needed for the macro -#[doc(hidden)] -pub mod inbound_redis { - pub use super::wit::exports::fermyon::spin::inbound_redis::*; -} +pub use wit_bindgen; diff --git a/sdk/rust/src/llm.rs b/sdk/rust/src/llm.rs index 778c3a4682..f53132ec03 100644 --- a/sdk/rust/src/llm.rs +++ b/sdk/rust/src/llm.rs @@ -1,25 +1,25 @@ -use crate::wit::fermyon::spin::llm; - -pub use crate::wit::fermyon::spin::llm::{ - EmbeddingsResult, EmbeddingsUsage, Error, InferencingParams, InferencingResult, +pub use crate::wit::v1::llm::{ + self, EmbeddingsResult, EmbeddingsUsage, Error, InferencingParams, InferencingResult, InferencingUsage, }; /// The model use for inferencing #[allow(missing_docs)] +#[derive(Debug, Clone, Copy)] pub enum InferencingModel<'a> { Llama2Chat, CodellamaInstruct, Other(&'a str), } -impl<'a> InferencingModel<'a> { - fn as_str(&self) -> llm::InferencingModel<'a> { - match self { +impl<'a> std::fmt::Display for InferencingModel<'a> { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + let str = match self { InferencingModel::Llama2Chat => "llama2-chat", InferencingModel::CodellamaInstruct => "codellama-instruct", InferencingModel::Other(s) => s, - } + }; + f.write_str(str) } } @@ -38,7 +38,7 @@ impl Default for InferencingParams { /// Perform inferencing using the provided model and prompt pub fn infer(model: InferencingModel, prompt: &str) -> Result { - llm::infer(model.as_str(), prompt, None) + llm::infer(&model.to_string(), prompt, None) } /// Perform inferencing using the provided model, prompt, and options @@ -47,29 +47,31 @@ pub fn infer_with_options( prompt: &str, options: InferencingParams, ) -> Result { - llm::infer(model.as_str(), prompt, Some(options)) + llm::infer(&model.to_string(), prompt, Some(options)) } /// Model used for generating embeddings #[allow(missing_docs)] +#[derive(Debug, Clone, Copy)] pub enum EmbeddingModel<'a> { AllMiniLmL6V2, Other(&'a str), } -impl<'a> EmbeddingModel<'a> { - fn as_str(&self) -> llm::EmbeddingModel<'a> { - match self { +impl<'a> std::fmt::Display for EmbeddingModel<'a> { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + let str = match self { EmbeddingModel::AllMiniLmL6V2 => "all-minilm-l6-v2", EmbeddingModel::Other(s) => s, - } + }; + f.write_str(str) } } /// Generate embeddings using the provided model and collection of text pub fn generate_embeddings( model: EmbeddingModel, - text: &[&str], + text: &[String], ) -> Result { - llm::generate_embeddings(model.as_str(), text) + llm::generate_embeddings(&model.to_string(), text) } diff --git a/sdk/rust/src/mysql.rs b/sdk/rust/src/mysql.rs index f77ee35c8e..c91a13c563 100644 --- a/sdk/rust/src/mysql.rs +++ b/sdk/rust/src/mysql.rs @@ -18,8 +18,8 @@ //! | `String` | str(string) | VARCHAR, CHAR, TEXT | //! | `Vec` | binary(list\) | VARBINARY, BINARY, BLOB | -pub use super::wit::fermyon::spin::mysql::{execute, query, MysqlError}; -pub use super::wit::fermyon::spin::rdbms_types::*; +pub use super::wit::v1::mysql::{execute, query, MysqlError}; +pub use super::wit::v1::rdbms_types::*; /// A MySQL error #[derive(Debug, thiserror::Error)] diff --git a/sdk/rust/src/outbound_http.rs b/sdk/rust/src/outbound_http.rs index 0f20fcfd29..0e5c5cf838 100644 --- a/sdk/rust/src/outbound_http.rs +++ b/sdk/rust/src/outbound_http.rs @@ -2,13 +2,11 @@ use http_types::{header::HeaderName, HeaderValue}; use super::http::{Request, Response}; -use super::wit::fermyon::spin::http::{ - self as spin_http, Request as OutboundRequest, Response as OutboundResponse, -}; -use super::wit::fermyon::spin::http_types as spin_http_types; +use super::wit::v1::http::{self as spin_http}; +use super::wit::v1::http_types as spin_http_types; /// Error type returned by [`send_request`][crate::outbound_http::send_request] -pub use super::wit::fermyon::spin::http_types::HttpError as OutboundHttpError; +pub use spin_http_types::HttpError as OutboundHttpError; type Result = std::result::Result; @@ -22,27 +20,27 @@ pub fn send_request(req: Request) -> Result { let params = vec![]; - let headers = &req + let headers = req .headers .iter() .map(try_header_to_strs) .collect::>>()?; - let body = body.as_ref().map(|bytes| bytes.as_ref()); + let body = body.map(|bytes| bytes.to_vec()); - let out_req = OutboundRequest { + let out_req = spin_http_types::Request { method, - uri: &uri, - params: ¶ms, + uri, + params, headers, body, }; - let OutboundResponse { + let spin_http_types::Response { status, headers, body, - } = spin_http::send_request(out_req)?; + } = spin_http::send_request(&out_req)?; let resp_builder = http_types::response::Builder::new().status(status); let resp_builder = headers @@ -54,15 +52,15 @@ pub fn send_request(req: Request) -> Result { .map_err(|_| OutboundHttpError::RuntimeError) } -fn try_header_to_strs<'k, 'v>( - header: (&'k HeaderName, &'v HeaderValue), -) -> Result<(&'k str, &'v str)> { +fn try_header_to_strs( + (header_name, header_value): (&HeaderName, &HeaderValue), +) -> Result<(String, String)> { Ok(( - header.0.as_str(), - header - .1 + header_name.to_string(), + header_value .to_str() - .map_err(|_| OutboundHttpError::InvalidUrl)?, + .map_err(|_| OutboundHttpError::InvalidUrl)? + .to_owned(), )) } diff --git a/sdk/rust/src/pg.rs b/sdk/rust/src/pg.rs index 26406833b2..09a8b0fa90 100644 --- a/sdk/rust/src/pg.rs +++ b/sdk/rust/src/pg.rs @@ -13,8 +13,8 @@ //! | `String` | str(string) | VARCHAR, CHAR(N), TEXT | //! | `Vec` | binary(list\) | BYTEA | -pub use super::wit::fermyon::spin::postgres::{execute, query, PgError}; -pub use super::wit::fermyon::spin::rdbms_types::*; +pub use super::wit::v1::postgres::{execute, query, PgError}; +pub use super::wit::v1::rdbms_types::*; /// A pg error #[derive(Debug, thiserror::Error)] diff --git a/sdk/rust/src/sqlite.rs b/sdk/rust/src/sqlite.rs index a60d68b02f..be7021a35b 100644 --- a/sdk/rust/src/sqlite.rs +++ b/sdk/rust/src/sqlite.rs @@ -1,41 +1,12 @@ -#![allow(missing_docs)] - -use super::wit::fermyon::spin::sqlite; -use sqlite::Connection as RawConnection; - -/// Errors which may be raised by the methods of `Store` -pub use sqlite::Error; -/// The result of making a query -pub use sqlite::QueryResult; -/// A row in a QueryResult -pub use sqlite::RowResult; -/// A parameter used when executing a sqlite statement -pub use sqlite::ValueParam; -/// A single column's result from a database query -pub use sqlite::ValueResult; - -/// Represents a store in which key value tuples may be placed -#[derive(Debug)] -pub struct Connection(RawConnection); - -impl Connection { - /// Open a connection to the default database - pub fn open_default() -> Result { - Ok(Self(sqlite::open("default")?)) - } +use super::wit::v2::sqlite; - /// Open a connection - pub fn open(database: &str) -> Result { - Ok(Self(sqlite::open(database)?)) - } +#[doc(inline)] +pub use sqlite::{Connection, Error, QueryResult, RowResult, Value}; - /// Execute a statement against the database - pub fn execute( - &self, - query: &str, - parameters: &[ValueParam<'_>], - ) -> Result { - sqlite::execute(self.0, query, parameters) +impl sqlite::Connection { + /// Open a connection to the default database + pub fn open_default() -> Result { + Self::open("default") } } @@ -57,7 +28,7 @@ pub struct Row<'a> { impl<'a> Row<'a> { /// Get a value by its column name - pub fn get>(&self, column: &str) -> Option { + pub fn get>(&self, column: &str) -> Option { let i = self.columns.iter().position(|c| c == column)?; self.result.get(i) } @@ -65,17 +36,17 @@ impl<'a> Row<'a> { impl sqlite::RowResult { /// Get a value by its index - pub fn get<'a, T: TryFrom<&'a ValueResult>>(&'a self, index: usize) -> Option { + pub fn get<'a, T: TryFrom<&'a Value>>(&'a self, index: usize) -> Option { self.values.get(index).and_then(|c| c.try_into().ok()) } } -impl<'a> TryFrom<&'a ValueResult> for bool { +impl<'a> TryFrom<&'a Value> for bool { type Error = (); - fn try_from(value: &'a ValueResult) -> Result { + fn try_from(value: &'a Value) -> Result { match value { - ValueResult::Integer(i) => Ok(*i != 0), + Value::Integer(i) => Ok(*i != 0), _ => Err(()), } } @@ -83,12 +54,12 @@ impl<'a> TryFrom<&'a ValueResult> for bool { macro_rules! int_conversions { ($($t:ty),*) => { - $(impl<'a> TryFrom<&'a ValueResult> for $t { + $(impl<'a> TryFrom<&'a Value> for $t { type Error = (); - fn try_from(value: &'a ValueResult) -> Result { + fn try_from(value: &'a Value) -> Result { match value { - ValueResult::Integer(i) => (*i).try_into().map_err(|_| ()), + Value::Integer(i) => (*i).try_into().map_err(|_| ()), _ => Err(()), } } @@ -98,36 +69,36 @@ macro_rules! int_conversions { int_conversions!(u8, u16, u32, u64, i8, i16, i32, i64, usize, isize); -impl<'a> TryFrom<&'a ValueResult> for f64 { +impl<'a> TryFrom<&'a Value> for f64 { type Error = (); - fn try_from(value: &'a ValueResult) -> Result { + fn try_from(value: &'a Value) -> Result { match value { - ValueResult::Real(f) => Ok(*f), + Value::Real(f) => Ok(*f), _ => Err(()), } } } -impl<'a> TryFrom<&'a ValueResult> for &'a str { +impl<'a> TryFrom<&'a Value> for &'a str { type Error = (); - fn try_from(value: &'a ValueResult) -> Result { + fn try_from(value: &'a Value) -> Result { match value { - ValueResult::Text(s) => Ok(s.as_str()), - ValueResult::Blob(b) => std::str::from_utf8(b).map_err(|_| ()), + Value::Text(s) => Ok(s.as_str()), + Value::Blob(b) => std::str::from_utf8(b).map_err(|_| ()), _ => Err(()), } } } -impl<'a> TryFrom<&'a ValueResult> for &'a [u8] { +impl<'a> TryFrom<&'a Value> for &'a [u8] { type Error = (); - fn try_from(value: &'a ValueResult) -> Result { + fn try_from(value: &'a Value) -> Result { match value { - ValueResult::Blob(b) => Ok(b.as_slice()), - ValueResult::Text(s) => Ok(s.as_bytes()), + Value::Blob(b) => Ok(b.as_slice()), + Value::Text(s) => Ok(s.as_bytes()), _ => Err(()), } } diff --git a/tests/http/headers-env-routes-test/Cargo.lock b/tests/http/headers-env-routes-test/Cargo.lock index 2cdf65baf1..25eacd0acc 100644 --- a/tests/http/headers-env-routes-test/Cargo.lock +++ b/tests/http/headers-env-routes-test/Cargo.lock @@ -4,9 +4,9 @@ version = 3 [[package]] name = "anyhow" -version = "1.0.71" +version = "1.0.75" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c7d0618f0e0b7e8ff11427422b64564d5fb0be1940354bfe2e0529b18a9d9b8" +checksum = "a4668cab20f66d8d020e1fbc0ebe47217433c1b6c8f2040faf858554e394ace6" [[package]] name = "autocfg" @@ -22,9 +22,9 @@ checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" [[package]] name = "bitflags" -version = "2.3.2" +version = "2.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6dbe3c979c178231552ecba20214a8272df4e09f232a87aef4320cf06539aded" +checksum = "b4682ae6287fcf752ecaabbfcc7b6f9b72aa33933dc23a554d853aea8eea8635" [[package]] name = "bytes" @@ -42,6 +42,12 @@ dependencies = [ "spin-sdk", ] +[[package]] +name = "equivalent" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" + [[package]] name = "fnv" version = "1.0.7" @@ -59,9 +65,9 @@ dependencies = [ [[package]] name = "hashbrown" -version = "0.12.3" +version = "0.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" +checksum = "2c6201b9ff9fd90a5a3bac2e56a830d0caa509576f0e503818ee82c181b3437a" [[package]] name = "heck" @@ -101,11 +107,11 @@ dependencies = [ [[package]] name = "indexmap" -version = "1.9.3" +version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bd070e393353796e801d209ad339e89596eb4c8d430d18ede6a1cced8fafbd99" +checksum = "d5477fe2230a79769d8dc68e0eabf5437907c0457a5614a9e8dddb67f65eb65d" dependencies = [ - "autocfg", + "equivalent", "hashbrown", "serde", ] @@ -130,9 +136,9 @@ checksum = "b06a4cde4c0f271a446782e3eff8de789548ce57dbc8eca9292c27f4a42004b4" [[package]] name = "memchr" -version = "2.4.1" +version = "2.6.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "308cc39be01b73d0d18f82a0e7b2a3df85245f84af96fdddc5d202d27e47b86a" +checksum = "8f232d6ef707e1956a43342693d2a31e72989554d58299d7a88738cc95b0d35c" [[package]] name = "percent-encoding" @@ -142,18 +148,18 @@ checksum = "478c572c3d73181ff3c2539045f6eb99e5491218eae919370993b890cdbdd98e" [[package]] name = "proc-macro2" -version = "1.0.60" +version = "1.0.67" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dec2b086b7a862cf4de201096214fa870344cf922b2b30c167badb3af3195406" +checksum = "3d433d9f1a3e8c1263d9456598b16fec66f4acc9a74dacffd35c7bb09b3a1328" dependencies = [ "unicode-ident", ] [[package]] name = "pulldown-cmark" -version = "0.8.0" +version = "0.9.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ffade02495f22453cd593159ea2f59827aae7f53fa8323f756799b670881dcf8" +checksum = "77a1a2f1f0a7ecff9c31abbe177637be0e97a0aef46cf8738ece09327985d998" dependencies = [ "bitflags 1.3.2", "memchr", @@ -179,6 +185,12 @@ dependencies = [ "smartstring", ] +[[package]] +name = "ryu" +version = "1.0.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1ad4cc8da4ef723ed60bced201181d83791ad433213d8c24efffda1eec85d741" + [[package]] name = "semver" version = "1.0.17" @@ -187,24 +199,41 @@ checksum = "bebd363326d05ec3e2f532ab7660680f3b02130d780c299bca73469d521bc0ed" [[package]] name = "serde" -version = "1.0.164" +version = "1.0.188" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9e8c8cf938e98f769bc164923b06dce91cea1751522f46f8466461af04c9027d" +checksum = "cf9e0fcba69a370eed61bcf2b728575f726b50b55cba78064753d708ddc7549e" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.164" +version = "1.0.188" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d9735b638ccc51c28bf6914d90a2e9725b377144fc612c49a611fddd1b631d68" +checksum = "4eca7ac642d82aa35b60049a6eccb4be6be75e599bd2e9adb5f875a737654af2" dependencies = [ "proc-macro2", "quote", - "syn 2.0.18", + "syn 2.0.37", +] + +[[package]] +name = "serde_json" +version = "1.0.107" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6b420ce6e3d8bd882e9b243c6eed35dbc9a6110c9769e74b584e0d68d1f20c65" +dependencies = [ + "itoa", + "ryu", + "serde", ] +[[package]] +name = "smallvec" +version = "1.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "942b4a808e05215192e39f4ab80813e599068285906cc91aa64f923db842bd5a" + [[package]] name = "smartcow" version = "0.2.1" @@ -225,6 +254,15 @@ dependencies = [ "version_check", ] +[[package]] +name = "spdx" +version = "0.10.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b19b32ed6d899ab23174302ff105c1577e45a06b08d4fe0a9dd13ce804bbbf71" +dependencies = [ + "smallvec", +] + [[package]] name = "spin-macro" version = "0.1.0" @@ -270,9 +308,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.18" +version = "2.0.37" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "32d41677bcbe24c20c52e7c70b0d8db04134c5d1066bf98662e2871ad200ea3e" +checksum = "7303ef2c05cd654186cb250d29049a24840ca25d2747c25c0381c8d9e2f582e8" dependencies = [ "proc-macro2", "quote", @@ -375,31 +413,33 @@ checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" [[package]] name = "wasm-encoder" -version = "0.29.0" +version = "0.33.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "18c41dbd92eaebf3612a39be316540b8377c871cb9bde6b064af962984912881" +checksum = "34180c89672b3e4825c3a8db4b61a674f1447afd5fe2445b2d22c3d8b6ea086c" dependencies = [ "leb128", ] [[package]] name = "wasm-metadata" -version = "0.8.0" +version = "0.10.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "36e5156581ff4a302405c44ca7c85347563ca431d15f1a773f12c9c7b9a6cdc9" +checksum = "4f2c051ef041d348324b01ff0419f6f6593f094b4897d93c9cf52d5d1ac879ba" dependencies = [ "anyhow", "indexmap", "serde", + "serde_json", + "spdx", "wasm-encoder", "wasmparser", ] [[package]] name = "wasmparser" -version = "0.107.0" +version = "0.113.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "29e3ac9b780c7dda0cac7a52a5d6d2d6707cc6e3451c9db209b6c758f40d7acb" +checksum = "286049849b5a5bd09a8773171be96824afabffc7cc3df6caaf33a38db6cd07ae" dependencies = [ "indexmap", "semver", @@ -407,19 +447,17 @@ dependencies = [ [[package]] name = "wit-bindgen" -version = "0.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "392d16e9e46cc7ca98125bc288dd5e4db469efe8323d3e0dac815ca7f2398522" +version = "0.12.0" +source = "git+https://github.com/bytecodealliance/wit-bindgen?rev=46fba30bb667a3a4962f63b1cc28b84427b49114#46fba30bb667a3a4962f63b1cc28b84427b49114" dependencies = [ - "bitflags 2.3.2", + "bitflags 2.4.0", "wit-bindgen-rust-macro", ] [[package]] name = "wit-bindgen-core" -version = "0.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d422d36cbd78caa0e18c3371628447807c66ee72466b69865ea7e33682598158" +version = "0.12.0" +source = "git+https://github.com/bytecodealliance/wit-bindgen?rev=46fba30bb667a3a4962f63b1cc28b84427b49114#46fba30bb667a3a4962f63b1cc28b84427b49114" dependencies = [ "anyhow", "wit-component", @@ -428,36 +466,25 @@ dependencies = [ [[package]] name = "wit-bindgen-rust" -version = "0.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b76db68264f5d2089dc4652581236d8e75c5b89338de6187716215fd0e68ba3" +version = "0.12.0" +source = "git+https://github.com/bytecodealliance/wit-bindgen?rev=46fba30bb667a3a4962f63b1cc28b84427b49114#46fba30bb667a3a4962f63b1cc28b84427b49114" dependencies = [ + "anyhow", "heck", "wasm-metadata", "wit-bindgen-core", - "wit-bindgen-rust-lib", "wit-component", ] -[[package]] -name = "wit-bindgen-rust-lib" -version = "0.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1c50f334bc08b0903a43387f6eea6ef6aa9eb2a085729f1677b29992ecef20ba" -dependencies = [ - "heck", - "wit-bindgen-core", -] - [[package]] name = "wit-bindgen-rust-macro" -version = "0.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ced38a5e174940c6a41ae587babeadfd2e2c2dc32f3b6488bcdca0e8922cf3f3" +version = "0.12.0" +source = "git+https://github.com/bytecodealliance/wit-bindgen?rev=46fba30bb667a3a4962f63b1cc28b84427b49114#46fba30bb667a3a4962f63b1cc28b84427b49114" dependencies = [ "anyhow", "proc-macro2", - "syn 2.0.18", + "quote", + "syn 2.0.37", "wit-bindgen-core", "wit-bindgen-rust", "wit-component", @@ -465,14 +492,16 @@ dependencies = [ [[package]] name = "wit-component" -version = "0.11.0" +version = "0.14.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7cbd4c7f8f400327c482c88571f373844b7889e61460650d650fc5881bb3575c" +checksum = "2e2bf941487fc5afa9e3fc94761f6b80ecef5a2bed6239b959d23d9de69e3448" dependencies = [ "anyhow", - "bitflags 1.3.2", + "bitflags 2.4.0", "indexmap", "log", + "serde", + "serde_json", "wasm-encoder", "wasm-metadata", "wasmparser", @@ -481,9 +510,9 @@ dependencies = [ [[package]] name = "wit-parser" -version = "0.8.0" +version = "0.11.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6daec9f093dbaea0e94043eeb92ece327bbbe70c86b1f41aca9bbfefd7f050f0" +checksum = "a39edca9abb16309def3843af73b58d47d243fe33a9ceee572446bcc57556b9a" dependencies = [ "anyhow", "id-arena", @@ -491,6 +520,8 @@ dependencies = [ "log", "pulldown-cmark", "semver", + "serde", + "serde_json", "unicode-xid", "url", ] diff --git a/tests/http/simple-spin-rust/Cargo.lock b/tests/http/simple-spin-rust/Cargo.lock index 41015ec917..59843450bc 100644 --- a/tests/http/simple-spin-rust/Cargo.lock +++ b/tests/http/simple-spin-rust/Cargo.lock @@ -4,9 +4,9 @@ version = 3 [[package]] name = "anyhow" -version = "1.0.71" +version = "1.0.75" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c7d0618f0e0b7e8ff11427422b64564d5fb0be1940354bfe2e0529b18a9d9b8" +checksum = "a4668cab20f66d8d020e1fbc0ebe47217433c1b6c8f2040faf858554e394ace6" [[package]] name = "autocfg" @@ -22,9 +22,9 @@ checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" [[package]] name = "bitflags" -version = "2.3.2" +version = "2.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6dbe3c979c178231552ecba20214a8272df4e09f232a87aef4320cf06539aded" +checksum = "b4682ae6287fcf752ecaabbfcc7b6f9b72aa33933dc23a554d853aea8eea8635" [[package]] name = "bytes" @@ -32,6 +32,12 @@ version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c4872d67bab6358e59559027aa3b9157c53d9358c51423c17554809a8858e0f8" +[[package]] +name = "equivalent" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" + [[package]] name = "fnv" version = "1.0.7" @@ -50,9 +56,9 @@ dependencies = [ [[package]] name = "hashbrown" -version = "0.12.3" +version = "0.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" +checksum = "2c6201b9ff9fd90a5a3bac2e56a830d0caa509576f0e503818ee82c181b3437a" [[package]] name = "heck" @@ -93,11 +99,11 @@ dependencies = [ [[package]] name = "indexmap" -version = "1.9.3" +version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bd070e393353796e801d209ad339e89596eb4c8d430d18ede6a1cced8fafbd99" +checksum = "d5477fe2230a79769d8dc68e0eabf5437907c0457a5614a9e8dddb67f65eb65d" dependencies = [ - "autocfg", + "equivalent", "hashbrown", "serde", ] @@ -128,9 +134,9 @@ checksum = "a3e378b66a060d48947b590737b30a1be76706c8dd7b8ba0f2fe3989c68a853f" [[package]] name = "memchr" -version = "2.4.1" +version = "2.6.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "308cc39be01b73d0d18f82a0e7b2a3df85245f84af96fdddc5d202d27e47b86a" +checksum = "8f232d6ef707e1956a43342693d2a31e72989554d58299d7a88738cc95b0d35c" [[package]] name = "percent-encoding" @@ -140,18 +146,18 @@ checksum = "d4fd5641d01c8f18a23da7b6fe29298ff4b55afcccdf78973b24cf3175fee32e" [[package]] name = "proc-macro2" -version = "1.0.60" +version = "1.0.67" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dec2b086b7a862cf4de201096214fa870344cf922b2b30c167badb3af3195406" +checksum = "3d433d9f1a3e8c1263d9456598b16fec66f4acc9a74dacffd35c7bb09b3a1328" dependencies = [ "unicode-ident", ] [[package]] name = "pulldown-cmark" -version = "0.8.0" +version = "0.9.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ffade02495f22453cd593159ea2f59827aae7f53fa8323f756799b670881dcf8" +checksum = "77a1a2f1f0a7ecff9c31abbe177637be0e97a0aef46cf8738ece09327985d998" dependencies = [ "bitflags 1.3.2", "memchr", @@ -177,6 +183,12 @@ dependencies = [ "smartstring", ] +[[package]] +name = "ryu" +version = "1.0.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1ad4cc8da4ef723ed60bced201181d83791ad433213d8c24efffda1eec85d741" + [[package]] name = "semver" version = "1.0.17" @@ -185,22 +197,33 @@ checksum = "bebd363326d05ec3e2f532ab7660680f3b02130d780c299bca73469d521bc0ed" [[package]] name = "serde" -version = "1.0.164" +version = "1.0.188" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9e8c8cf938e98f769bc164923b06dce91cea1751522f46f8466461af04c9027d" +checksum = "cf9e0fcba69a370eed61bcf2b728575f726b50b55cba78064753d708ddc7549e" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.164" +version = "1.0.188" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d9735b638ccc51c28bf6914d90a2e9725b377144fc612c49a611fddd1b631d68" +checksum = "4eca7ac642d82aa35b60049a6eccb4be6be75e599bd2e9adb5f875a737654af2" dependencies = [ "proc-macro2", "quote", - "syn 2.0.18", + "syn 2.0.37", +] + +[[package]] +name = "serde_json" +version = "1.0.107" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6b420ce6e3d8bd882e9b243c6eed35dbc9a6110c9769e74b584e0d68d1f20c65" +dependencies = [ + "itoa", + "ryu", + "serde", ] [[package]] @@ -213,6 +236,12 @@ dependencies = [ "spin-sdk", ] +[[package]] +name = "smallvec" +version = "1.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "62bb4feee49fdd9f707ef802e22365a35de4b7b299de4763d44bfea899442ff9" + [[package]] name = "smartcow" version = "0.2.1" @@ -233,6 +262,15 @@ dependencies = [ "version_check", ] +[[package]] +name = "spdx" +version = "0.10.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b19b32ed6d899ab23174302ff105c1577e45a06b08d4fe0a9dd13ce804bbbf71" +dependencies = [ + "smallvec", +] + [[package]] name = "spin-macro" version = "0.1.0" @@ -278,9 +316,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.18" +version = "2.0.37" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "32d41677bcbe24c20c52e7c70b0d8db04134c5d1066bf98662e2871ad200ea3e" +checksum = "7303ef2c05cd654186cb250d29049a24840ca25d2747c25c0381c8d9e2f582e8" dependencies = [ "proc-macro2", "quote", @@ -383,31 +421,33 @@ checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" [[package]] name = "wasm-encoder" -version = "0.29.0" +version = "0.33.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "18c41dbd92eaebf3612a39be316540b8377c871cb9bde6b064af962984912881" +checksum = "34180c89672b3e4825c3a8db4b61a674f1447afd5fe2445b2d22c3d8b6ea086c" dependencies = [ "leb128", ] [[package]] name = "wasm-metadata" -version = "0.8.0" +version = "0.10.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "36e5156581ff4a302405c44ca7c85347563ca431d15f1a773f12c9c7b9a6cdc9" +checksum = "4f2c051ef041d348324b01ff0419f6f6593f094b4897d93c9cf52d5d1ac879ba" dependencies = [ "anyhow", "indexmap", "serde", + "serde_json", + "spdx", "wasm-encoder", "wasmparser", ] [[package]] name = "wasmparser" -version = "0.107.0" +version = "0.113.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "29e3ac9b780c7dda0cac7a52a5d6d2d6707cc6e3451c9db209b6c758f40d7acb" +checksum = "286049849b5a5bd09a8773171be96824afabffc7cc3df6caaf33a38db6cd07ae" dependencies = [ "indexmap", "semver", @@ -415,19 +455,17 @@ dependencies = [ [[package]] name = "wit-bindgen" -version = "0.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "392d16e9e46cc7ca98125bc288dd5e4db469efe8323d3e0dac815ca7f2398522" +version = "0.12.0" +source = "git+https://github.com/bytecodealliance/wit-bindgen?rev=46fba30bb667a3a4962f63b1cc28b84427b49114#46fba30bb667a3a4962f63b1cc28b84427b49114" dependencies = [ - "bitflags 2.3.2", + "bitflags 2.4.0", "wit-bindgen-rust-macro", ] [[package]] name = "wit-bindgen-core" -version = "0.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d422d36cbd78caa0e18c3371628447807c66ee72466b69865ea7e33682598158" +version = "0.12.0" +source = "git+https://github.com/bytecodealliance/wit-bindgen?rev=46fba30bb667a3a4962f63b1cc28b84427b49114#46fba30bb667a3a4962f63b1cc28b84427b49114" dependencies = [ "anyhow", "wit-component", @@ -436,36 +474,25 @@ dependencies = [ [[package]] name = "wit-bindgen-rust" -version = "0.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b76db68264f5d2089dc4652581236d8e75c5b89338de6187716215fd0e68ba3" +version = "0.12.0" +source = "git+https://github.com/bytecodealliance/wit-bindgen?rev=46fba30bb667a3a4962f63b1cc28b84427b49114#46fba30bb667a3a4962f63b1cc28b84427b49114" dependencies = [ + "anyhow", "heck", "wasm-metadata", "wit-bindgen-core", - "wit-bindgen-rust-lib", "wit-component", ] -[[package]] -name = "wit-bindgen-rust-lib" -version = "0.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1c50f334bc08b0903a43387f6eea6ef6aa9eb2a085729f1677b29992ecef20ba" -dependencies = [ - "heck", - "wit-bindgen-core", -] - [[package]] name = "wit-bindgen-rust-macro" -version = "0.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ced38a5e174940c6a41ae587babeadfd2e2c2dc32f3b6488bcdca0e8922cf3f3" +version = "0.12.0" +source = "git+https://github.com/bytecodealliance/wit-bindgen?rev=46fba30bb667a3a4962f63b1cc28b84427b49114#46fba30bb667a3a4962f63b1cc28b84427b49114" dependencies = [ "anyhow", "proc-macro2", - "syn 2.0.18", + "quote", + "syn 2.0.37", "wit-bindgen-core", "wit-bindgen-rust", "wit-component", @@ -473,14 +500,16 @@ dependencies = [ [[package]] name = "wit-component" -version = "0.11.0" +version = "0.14.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7cbd4c7f8f400327c482c88571f373844b7889e61460650d650fc5881bb3575c" +checksum = "2e2bf941487fc5afa9e3fc94761f6b80ecef5a2bed6239b959d23d9de69e3448" dependencies = [ "anyhow", - "bitflags 1.3.2", + "bitflags 2.4.0", "indexmap", "log", + "serde", + "serde_json", "wasm-encoder", "wasm-metadata", "wasmparser", @@ -489,9 +518,9 @@ dependencies = [ [[package]] name = "wit-parser" -version = "0.8.0" +version = "0.11.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6daec9f093dbaea0e94043eeb92ece327bbbe70c86b1f41aca9bbfefd7f050f0" +checksum = "a39edca9abb16309def3843af73b58d47d243fe33a9ceee572446bcc57556b9a" dependencies = [ "anyhow", "id-arena", @@ -499,6 +528,8 @@ dependencies = [ "log", "pulldown-cmark", "semver", + "serde", + "serde_json", "unicode-xid", "url", ] diff --git a/tests/outbound-redis/http-rust-outbound-redis/src/lib.rs b/tests/outbound-redis/http-rust-outbound-redis/src/lib.rs index 94bc84baf3..ccc19f8aee 100644 --- a/tests/outbound-redis/http-rust-outbound-redis/src/lib.rs +++ b/tests/outbound-redis/http-rust-outbound-redis/src/lib.rs @@ -12,7 +12,7 @@ const REDIS_ADDRESS_ENV: &str = "REDIS_ADDRESS"; fn test(_req: Request) -> Result { let address = std::env::var(REDIS_ADDRESS_ENV)?; - redis::set(&address, "spin-example-get-set", b"Eureka!") + redis::set(&address, "spin-example-get-set", &b"Eureka!".to_vec()) .map_err(|_| anyhow!("Error executing Redis set command"))?; let payload = redis::get(&address, "spin-example-get-set") @@ -20,7 +20,7 @@ fn test(_req: Request) -> Result { assert_eq!(std::str::from_utf8(&payload).unwrap(), "Eureka!"); - redis::set(&address, "spin-example-incr", b"0") + redis::set(&address, "spin-example-incr", &b"0".to_vec()) .map_err(|_| anyhow!("Error querying Redis set command"))?; let int_value = redis::incr(&address, "spin-example-incr") @@ -28,7 +28,7 @@ fn test(_req: Request) -> Result { assert_eq!(int_value, 1); - let keys = vec!["spin-example-get-set", "spin-example-incr"]; + let keys = vec!["spin-example-get-set".into(), "spin-example-incr".into()]; let del_keys = redis::del(&address, &keys).map_err(|_| anyhow!("Error executing Redis incr command"))?; @@ -39,8 +39,8 @@ fn test(_req: Request) -> Result { &address, "set", &[ - RedisParameter::Binary(b"spin-example"), - RedisParameter::Binary(b"Eureka!"), + RedisParameter::Binary(b"spin-example".to_vec()), + RedisParameter::Binary(b"Eureka!".to_vec()), ], ) .map_err(|_| anyhow!("Error executing Redis set command"))?; @@ -49,14 +49,18 @@ fn test(_req: Request) -> Result { &address, "append", &[ - RedisParameter::Binary(b"spin-example"), - RedisParameter::Binary(b" I've got it!"), + RedisParameter::Binary(b"spin-example".to_vec()), + RedisParameter::Binary(b" I've got it!".to_vec()), ], ) .map_err(|_| anyhow!("Error executing Redis append command via `execute`"))?; - let values = redis::execute(&address, "get", &[RedisParameter::Binary(b"spin-example")]) - .map_err(|_| anyhow!("Error executing Redis get command via `execute`"))?; + let values = redis::execute( + &address, + "get", + &[RedisParameter::Binary(b"spin-example".to_vec())], + ) + .map_err(|_| anyhow!("Error executing Redis get command via `execute`"))?; assert_eq!( values, @@ -66,36 +70,51 @@ fn test(_req: Request) -> Result { redis::execute( &address, "set", - &[RedisParameter::Binary(b"int-key"), RedisParameter::Int64(0)], + &[ + RedisParameter::Binary(b"int-key".to_vec()), + RedisParameter::Int64(0), + ], ) .map_err(|_| anyhow!("Error executing Redis set command via `execute`"))?; - let values = redis::execute(&address, "incr", &[RedisParameter::Binary(b"int-key")]) - .map_err(|_| anyhow!("Error executing Redis incr command via `execute`"))?; + let values = redis::execute( + &address, + "incr", + &[RedisParameter::Binary(b"int-key".to_vec())], + ) + .map_err(|_| anyhow!("Error executing Redis incr command via `execute`"))?; assert_eq!(values, &[RedisResult::Int64(1)]); - let values = redis::execute(&address, "get", &[RedisParameter::Binary(b"int-key")]) - .map_err(|_| anyhow!("Error executing Redis get command via `execute`"))?; + let values = redis::execute( + &address, + "get", + &[RedisParameter::Binary(b"int-key".to_vec())], + ) + .map_err(|_| anyhow!("Error executing Redis get command via `execute`"))?; assert_eq!(values, &[RedisResult::Binary(b"1".to_vec())]); - redis::execute(&address, "del", &[RedisParameter::Binary(b"foo")]) + redis::execute(&address, "del", &[RedisParameter::Binary(b"foo".to_vec())]) .map_err(|_| anyhow!("Error executing Redis del command via `execute`"))?; redis::execute( &address, "sadd", &[ - RedisParameter::Binary(b"foo"), - RedisParameter::Binary(b"bar"), - RedisParameter::Binary(b"baz"), + RedisParameter::Binary(b"foo".to_vec()), + RedisParameter::Binary(b"bar".to_vec()), + RedisParameter::Binary(b"baz".to_vec()), ], ) .map_err(|_| anyhow!("Error executing Redis sadd command via `execute`"))?; - let values = redis::execute(&address, "smembers", &[RedisParameter::Binary(b"foo")]) - .map_err(|_| anyhow!("Error executing Redis smembers command via `execute`"))?; + let values = redis::execute( + &address, + "smembers", + &[RedisParameter::Binary(b"foo".to_vec())], + ) + .map_err(|_| anyhow!("Error executing Redis smembers command via `execute`"))?; assert_eq!( values.into_iter().collect::>(), @@ -111,14 +130,18 @@ fn test(_req: Request) -> Result { &address, "srem", &[ - RedisParameter::Binary(b"foo"), - RedisParameter::Binary(b"baz"), + RedisParameter::Binary(b"foo".to_vec()), + RedisParameter::Binary(b"baz".to_vec()), ], ) .map_err(|_| anyhow!("Error executing Redis srem command via `execute`"))?; - let values = redis::execute(&address, "smembers", &[RedisParameter::Binary(b"foo")]) - .map_err(|_| anyhow!("Error executing Redis smembers command via `execute`"))?; + let values = redis::execute( + &address, + "smembers", + &[RedisParameter::Binary(b"foo".to_vec())], + ) + .map_err(|_| anyhow!("Error executing Redis smembers command via `execute`"))?; assert_eq!( values.into_iter().collect::>(), diff --git a/tests/testcases/key-value/src/lib.rs b/tests/testcases/key-value/src/lib.rs index 2ccc5dde18..70de89c252 100644 --- a/tests/testcases/key-value/src/lib.rs +++ b/tests/testcases/key-value/src/lib.rs @@ -12,10 +12,17 @@ fn handle_request(req: Request) -> Result { // an allowed-but-non-existent one returns Error::NoSuchStore ensure!(matches!(Store::open("forbidden"), Err(Error::AccessDenied))); - let query = req.uri().query().expect("Should have a testkey query string"); - let query: std::collections::HashMap:: = serde_qs::from_str(query)?; - let init_key = query.get("testkey").expect("Should have a testkey query string"); - let init_val = query.get("testval").expect("Should have a testval query string"); + let query = req + .uri() + .query() + .expect("Should have a testkey query string"); + let query: std::collections::HashMap = serde_qs::from_str(query)?; + let init_key = query + .get("testkey") + .expect("Should have a testkey query string"); + let init_val = query + .get("testval") + .expect("Should have a testval query string"); let store = Store::open_default()?; @@ -42,7 +49,8 @@ fn handle_request(req: Request) -> Result { ); ensure!( - sorted(vec!["bar".to_owned(), init_key.to_owned()]).collect::>() == sorted(store.get_keys()?).collect::>(), + sorted(vec!["bar".to_owned(), init_key.to_owned()]).collect::>() + == sorted(store.get_keys()?).collect::>(), "Expected exectly keys 'bar' and '{}' but got '{:?}'", init_key, &store.get_keys()? diff --git a/tests/testcases/mod.rs b/tests/testcases/mod.rs index 1c7ba6c2bd..5d73472b04 100644 --- a/tests/testcases/mod.rs +++ b/tests/testcases/mod.rs @@ -225,7 +225,7 @@ pub async fn sqlite_works(controller: &dyn Controller) { .template(None) .deploy_args(vec![ "--sqlite".to_string(), - "\"CREATE TABLE testdata(key TEXT, value TEXT)\"".to_string(), + "\"CREATE TABLE IF NOT EXISTS testdata(key TEXT, value TEXT)\"".to_string(), "--sqlite".to_string(), format!("\"INSERT INTO testdata(key, value) VALUES ('{init_key}', '{init_value}')\""), ]) diff --git a/tests/testcases/sqlite/src/lib.rs b/tests/testcases/sqlite/src/lib.rs index 293598e210..6224beffb5 100644 --- a/tests/testcases/sqlite/src/lib.rs +++ b/tests/testcases/sqlite/src/lib.rs @@ -2,21 +2,34 @@ use anyhow::{ensure, Result}; use spin_sdk::{ http::{Request, Response}, http_component, - sqlite::{Connection, Error, ValueParam}, + sqlite::{Connection, Error, Value}, }; #[http_component] fn handle_request(req: Request) -> Result { - ensure!(matches!(Connection::open("forbidden"), Err(Error::AccessDenied))); - - let query = req.uri().query().expect("Should have a testkey query string"); - let query: std::collections::HashMap:: = serde_qs::from_str(query)?; - let init_key = query.get("testkey").expect("Should have a testkey query string"); - let init_val = query.get("testval").expect("Should have a testval query string"); + ensure!(matches!( + Connection::open("forbidden"), + Err(Error::AccessDenied) + )); + + let query = req + .uri() + .query() + .expect("Should have a testkey query string"); + let query: std::collections::HashMap = serde_qs::from_str(query)?; + let init_key = query + .get("testkey") + .expect("Should have a testkey query string"); + let init_val = query + .get("testval") + .expect("Should have a testval query string"); let conn = Connection::open_default()?; - let results = conn.execute("SELECT * FROM testdata WHERE key = ?", &[ValueParam::Text(init_key)])?; + let results = conn.execute( + "SELECT * FROM testdata WHERE key = ?", + &[Value::Text(init_key.to_owned())], + )?; assert_eq!(1, results.rows.len()); assert_eq!(2, results.columns.len()); diff --git a/wit/preview2/config.wit b/wit/preview2/deps/spin@1.0.0/config.wit similarity index 100% rename from wit/preview2/config.wit rename to wit/preview2/deps/spin@1.0.0/config.wit diff --git a/wit/preview2/deps/spin@1.0.0/http-types.wit b/wit/preview2/deps/spin@1.0.0/http-types.wit new file mode 100644 index 0000000000..5d156046bd --- /dev/null +++ b/wit/preview2/deps/spin@1.0.0/http-types.wit @@ -0,0 +1,44 @@ +interface http-types { + type http-status = u16 + + type body = list + + type headers = list> + + type params = list> + + type uri = string + + enum method { + get, + post, + put, + delete, + patch, + head, + options, + } + + record request { + method: method, + uri: uri, + headers: headers, + params: params, + body: option, + } + + record response { + status: http-status, + headers: option, + body: option, + } + + enum http-error { + success, + destination-not-allowed, + invalid-url, + request-error, + runtime-error, + too-many-requests, + } +} diff --git a/wit/preview2/http.wit b/wit/preview2/deps/spin@1.0.0/http.wit similarity index 100% rename from wit/preview2/http.wit rename to wit/preview2/deps/spin@1.0.0/http.wit diff --git a/wit/preview2/deps/spin@1.0.0/inbound-http.wit b/wit/preview2/deps/spin@1.0.0/inbound-http.wit new file mode 100644 index 0000000000..0fef7f58dd --- /dev/null +++ b/wit/preview2/deps/spin@1.0.0/inbound-http.wit @@ -0,0 +1,5 @@ +interface inbound-http { + use http-types.{request, response} + + handle-request: func(req: request) -> response +} diff --git a/wit/preview2/deps/spin@1.0.0/inbound-redis.wit b/wit/preview2/deps/spin@1.0.0/inbound-redis.wit new file mode 100644 index 0000000000..2a027c5467 --- /dev/null +++ b/wit/preview2/deps/spin@1.0.0/inbound-redis.wit @@ -0,0 +1,6 @@ +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/deps/spin@1.0.0/key-value.wit b/wit/preview2/deps/spin@1.0.0/key-value.wit new file mode 100644 index 0000000000..09b0709e7d --- /dev/null +++ b/wit/preview2/deps/spin@1.0.0/key-value.wit @@ -0,0 +1,80 @@ +interface key-value { + // A handle to an open key-value store + type store = u32 + + // The set of errors which may be raised by functions in this interface + variant error { + // Too many stores have been opened simultaneously. Closing one or more + // stores prior to retrying may address this. + store-table-full, + + // The host does not recognize the store name requested. Defining and + // configuring a store with that name in a runtime configuration file + // may address this. + no-such-store, + + // The requesting component does not have access to the specified store + // (which may or may not exist). + access-denied, + + // The store handle provided is not recognized, i.e. it was either never + // opened or has been closed. + invalid-store, + + // No key-value tuple exists for the specified key in the specified + // store. + no-such-key, + + // Some implementation-specific error has occurred (e.g. I/O) + io(string) + } + + // Open the store with the specified name. + // + // If `name` is "default", the default store is opened. Otherwise, + // `name` must refer to a store defined and configured in a runtime + // configuration file supplied with the application. + // + // `error::no-such-store` will be raised if the `name` is not recognized. + open: func(name: string) -> result + + // Get the value associated with the specified `key` from the specified + // `store`. + // + // `error::invalid-store` will be raised if `store` is not a valid handle + // to an open store, and `error::no-such-key` will be raised if there is no + // tuple for `key` in `store`. + get: func(store: store, key: string) -> result, error> + + // Set the `value` associated with the specified `key` in the specified + // `store`, overwriting any existing value. + // + // `error::invalid-store` will be raised if `store` is not a valid handle + // to an open store. + set: func(store: store, key: string, value: list) -> result<_, error> + + // Delete the tuple with the specified `key` from the specified `store`. + // + // `error::invalid-store` will be raised if `store` is not a valid handle + // to an open store. No error is raised if a tuple did not previously + // exist for `key`. + delete: func(store: store, key: string) -> result<_, error> + + // Return whether a tuple exists for the specified `key` in the specified + // `store`. + // + // `error::invalid-store` will be raised if `store` is not a valid handle + // to an open store. + exists: func(store: store, key: string) -> result + + // Return a list of all the keys in the specified `store`. + // + // `error::invalid-store` will be raised if `store` is not a valid handle + // to an open store. + get-keys: func(store: store) -> result, error> + + // Close the specified `store`. + // + // This has no effect if `store` is not a valid handle to an open store. + close: func(store: store) +} \ No newline at end of file diff --git a/wit/preview2/llm.wit b/wit/preview2/deps/spin@1.0.0/llm.wit similarity index 100% rename from wit/preview2/llm.wit rename to wit/preview2/deps/spin@1.0.0/llm.wit diff --git a/wit/preview2/mysql.wit b/wit/preview2/deps/spin@1.0.0/mysql.wit similarity index 100% rename from wit/preview2/mysql.wit rename to wit/preview2/deps/spin@1.0.0/mysql.wit diff --git a/wit/preview2/postgres.wit b/wit/preview2/deps/spin@1.0.0/postgres.wit similarity index 100% rename from wit/preview2/postgres.wit rename to wit/preview2/deps/spin@1.0.0/postgres.wit diff --git a/wit/preview2/rdbms-types.wit b/wit/preview2/deps/spin@1.0.0/rdbms-types.wit similarity index 100% rename from wit/preview2/rdbms-types.wit rename to wit/preview2/deps/spin@1.0.0/rdbms-types.wit diff --git a/wit/preview2/deps/spin@1.0.0/redis-types.wit b/wit/preview2/deps/spin@1.0.0/redis-types.wit new file mode 100644 index 0000000000..e08d593dd5 --- /dev/null +++ b/wit/preview2/deps/spin@1.0.0/redis-types.wit @@ -0,0 +1,24 @@ +interface redis-types { + // General purpose error. + enum error { + success, + error, + } + + // The message payload. + type payload = list + + // A parameter type for the general-purpose `execute` function. + variant redis-parameter { + int64(s64), + binary(payload) + } + + // A return type for the general-purpose `execute` function. + variant redis-result { + nil, + status(string), + int64(s64), + binary(payload) + } +} diff --git a/wit/preview2/redis.wit b/wit/preview2/deps/spin@1.0.0/redis.wit similarity index 100% rename from wit/preview2/redis.wit rename to wit/preview2/deps/spin@1.0.0/redis.wit diff --git a/wit/preview2/deps/spin@1.0.0/sqlite.wit b/wit/preview2/deps/spin@1.0.0/sqlite.wit new file mode 100644 index 0000000000..83a5eadabb --- /dev/null +++ b/wit/preview2/deps/spin@1.0.0/sqlite.wit @@ -0,0 +1,52 @@ +interface sqlite { + // A handle to an open sqlite instance + type connection = u32 + + // The set of errors which may be raised by functions in this interface + variant error { + // The host does not recognize the database name requested. + no-such-database, + // The requesting component does not have access to the specified database (which may or may not exist). + access-denied, + // The provided connection is not valid + invalid-connection, + // The database has reached its capacity + database-full, + // Some implementation-specific error has occurred (e.g. I/O) + io(string) + } + + // Open a connection to a named database instance. + // + // If `database` is "default", the default instance is opened. + // + // `error::no-such-database` will be raised if the `name` is not recognized. + open: func(database: string) -> result + + // Execute a statement returning back data if there is any + execute: func(conn: connection, statement: string, parameters: list) -> result + + // Close the specified `connection`. + close: func(conn: connection) + + // A result of a query + record query-result { + // The names of the columns retrieved in the query + columns: list, + // the row results each containing the values for all the columns for a given row + rows: list, + } + + // A set of values for each of the columns in a query-result + record row-result { + values: list + } + + variant value { + integer(s64), + real(float64), + text(string), + blob(list), + null + } +} \ No newline at end of file diff --git a/wit/preview2/reactor.wit b/wit/preview2/deps/spin@1.0.0/world.wit similarity index 51% rename from wit/preview2/reactor.wit rename to wit/preview2/deps/spin@1.0.0/world.wit index 1627fe404f..e881baf8a5 100644 --- a/wit/preview2/reactor.wit +++ b/wit/preview2/deps/spin@1.0.0/world.wit @@ -1,38 +1,29 @@ package fermyon:spin -world reactor { - import config - import postgres - import mysql - import sqlite - import redis - import key-value - import http - import llm +world host { + include platform + export inbound-http export inbound-redis } world redis-trigger { - import config - import postgres - import mysql - import sqlite - import redis - import key-value - import http - import llm + include platform export inbound-redis } world http-trigger { + include platform + export inbound-http +} + +world platform { import config + import http import postgres import mysql import sqlite import redis import key-value - import http import llm - export inbound-http } diff --git a/wit/preview2/key-value.wit b/wit/preview2/key-value.wit index 29218f5871..6ff1770632 100644 --- a/wit/preview2/key-value.wit +++ b/wit/preview2/key-value.wit @@ -1,80 +1,75 @@ interface key-value { - // A handle to an open key-value store - type store = u32 + /// An open key-value store + resource store { + /// Open the store with the specified name. + /// + /// If `name` is "default", the default store is opened. Otherwise, + /// `name` must refer to a store defined and configured in a runtime + /// configuration file supplied with the application. + /// + /// `error::no-such-store` will be raised if the `name` is not recognized. + open: static func(name: string) -> result - // The set of errors which may be raised by functions in this interface + /// Get the value associated with the specified `key` from the specified + /// `store`. + /// + /// `error::invalid-store` will be raised if `store` is not a valid handle + /// to an open store, and `error::no-such-key` will be raised if there is no + /// tuple for `key` in `store`. + get: func(key: string) -> result, error> + + /// Set the `value` associated with the specified `key` in the specified + /// `store`, overwriting any existing value. + /// + /// `error::invalid-store` will be raised if `store` is not a valid handle + /// to an open store. + set: func(key: string, value: list) -> result<_, error> + + /// Delete the tuple with the specified `key` from the specified `store`. + /// + /// `error::invalid-store` will be raised if `store` is not a valid handle + /// to an open store. No error is raised if a tuple did not previously + /// exist for `key`. + delete: func(key: string) -> result<_, error> + + /// Return whether a tuple exists for the specified `key` in the specified + /// `store`. + /// + /// `error::invalid-store` will be raised if `store` is not a valid handle + /// to an open store. + exists: func(key: string) -> result + + /// Return a list of all the keys in the specified `store`. + /// + /// `error::invalid-store` will be raised if `store` is not a valid handle + /// to an open store. + get-keys: func() -> result, error> + } + + /// The set of errors which may be raised by functions in this interface variant error { - // Too many stores have been opened simultaneously. Closing one or more - // stores prior to retrying may address this. + /// Too many stores have been opened simultaneously. Closing one or more + /// stores prior to retrying may address this. store-table-full, - // The host does not recognize the store name requested. Defining and - // configuring a store with that name in a runtime configuration file - // may address this. + /// The host does not recognize the store name requested. Defining and + /// configuring a store with that name in a runtime configuration file + /// may address this. no-such-store, - // The requesting component does not have access to the specified store - // (which may or may not exist). + /// The requesting component does not have access to the specified store + /// (which may or may not exist). access-denied, - // The store handle provided is not recognized, i.e. it was either never - // opened or has been closed. + /// The store handle provided is not recognized, i.e. it was either never + /// opened or has been closed. invalid-store, - // No key-value tuple exists for the specified key in the specified - // store. + /// No key-value tuple exists for the specified key in the specified + /// store. no-such-key, - // Some implementation-specific error has occurred (e.g. I/O) + /// Some implementation-specific error has occurred (e.g. I/O) io(string) } - - // Open the store with the specified name. - // - // If `name` is "default", the default store is opened. Otherwise, - // `name` must refer to a store defined and configured in a runtime - // configuration file supplied with the application. - // - // `error::no-such-store` will be raised if the `name` is not recognized. - open: func(name: string) -> result - - // Get the value associated with the specified `key` from the specified - // `store`. - // - // `error::invalid-store` will be raised if `store` is not a valid handle - // to an open store, and `error::no-such-key` will be raised if there is no - // tuple for `key` in `store`. - get: func(store: store, key: string) -> result, error> - - // Set the `value` associated with the specified `key` in the specified - // `store`, overwriting any existing value. - // - // `error::invalid-store` will be raised if `store` is not a valid handle - // to an open store. - set: func(store: store, key: string, value: list) -> result<_, error> - - // Delete the tuple with the specified `key` from the specified `store`. - // - // `error::invalid-store` will be raised if `store` is not a valid handle - // to an open store. No error is raised if a tuple did not previously - // exist for `key`. - delete: func(store: store, key: string) -> result<_, error> - - // Return whether a tuple exists for the specified `key` in the specified - // `store`. - // - // `error::invalid-store` will be raised if `store` is not a valid handle - // to an open store. - exists: func(store: store, key: string) -> result - - // Return a list of all the keys in the specified `store`. - // - // `error::invalid-store` will be raised if `store` is not a valid handle - // to an open store. - get-keys: func(store: store) -> result, error> - - // Close the specified `store`. - // - // This has no effect if `store` is not a valid handle to an open store. - close: func(store: store) } diff --git a/wit/preview2/sqlite.wit b/wit/preview2/sqlite.wit index 8d802edf81..5d7badcb99 100644 --- a/wit/preview2/sqlite.wit +++ b/wit/preview2/sqlite.wit @@ -1,47 +1,45 @@ interface sqlite { - // A handle to an open sqlite instance - type connection = u32 + /// A handle to an open sqlite instance + resource connection { + /// Open a connection to a named database instance. + /// + /// If `database` is "default", the default instance is opened. + /// + /// `error::no-such-database` will be raised if the `name` is not recognized. + open: static func(database: string) -> result - // The set of errors which may be raised by functions in this interface + /// Execute a statement returning back data if there is any + execute: func(statement: string, parameters: list) -> result + } + + /// The set of errors which may be raised by functions in this interface variant error { - // The host does not recognize the database name requested. + /// The host does not recognize the database name requested. no-such-database, - // The requesting component does not have access to the specified database (which may or may not exist). + /// The requesting component does not have access to the specified database (which may or may not exist). access-denied, - // The provided connection is not valid + /// The provided connection is not valid invalid-connection, - // The database has reached its capacity + /// The database has reached its capacity database-full, - // Some implementation-specific error has occurred (e.g. I/O) + /// Some implementation-specific error has occurred (e.g. I/O) io(string) } - // Open a connection to a named database instance. - // - // If `database` is "default", the default instance is opened. - // - // `error::no-such-database` will be raised if the `name` is not recognized. - open: func(database: string) -> result - - // Execute a statement returning back data if there is any - execute: func(conn: connection, statement: string, parameters: list) -> result - - // Close the specified `connection`. - close: func(conn: connection) - - // A result of a query + /// A result of a query record query-result { - // The names of the columns retrieved in the query + /// The names of the columns retrieved in the query columns: list, - // the row results each containing the values for all the columns for a given row + /// the row results each containing the values for all the columns for a given row rows: list, } - // A set of values for each of the columns in a query-result + /// A set of values for each of the columns in a query-result record row-result { values: list } + /// A single column's result from a database query variant value { integer(s64), real(float64), diff --git a/wit/preview2/world.wit b/wit/preview2/world.wit new file mode 100644 index 0000000000..4fd991ab92 --- /dev/null +++ b/wit/preview2/world.wit @@ -0,0 +1,30 @@ +package fermyon:spin@2.0.0 + +world host { + include fermyon:spin/host + + import sqlite + import key-value +} + +world redis-trigger { + include platform + export fermyon:spin/inbound-redis +} + +world http-trigger { + include platform + export fermyon:spin/inbound-http +} + +world platform { + import fermyon:spin/config + import fermyon:spin/http + import fermyon:spin/postgres + import fermyon:spin/mysql + import fermyon:spin/redis + import fermyon:spin/llm + + import sqlite + import key-value +}