From a540c71b27fec48a3f23f21d8cc0b76dbe807237 Mon Sep 17 00:00:00 2001 From: Ryan Levick Date: Thu, 5 Oct 2023 14:49:41 +0200 Subject: [PATCH] Update more examples to wit-bindgen 0.12 Signed-off-by: Ryan Levick --- crates/core/tests/core-wasi-test/Cargo.toml | 4 +- examples/spin-timer/app-example/Cargo.lock | 149 ++++++++++++-------- examples/spin-timer/app-example/Cargo.toml | 2 +- examples/spin-timer/app-example/src/lib.rs | 9 +- 4 files changed, 100 insertions(+), 64 deletions(-) diff --git a/crates/core/tests/core-wasi-test/Cargo.toml b/crates/core/tests/core-wasi-test/Cargo.toml index 675b7ccfa..5be599ae5 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 = "0.12" [workspace] diff --git a/examples/spin-timer/app-example/Cargo.lock b/examples/spin-timer/app-example/Cargo.lock index e105091a9..f33f14edb 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,19 @@ dependencies = [ [[package]] name = "wit-bindgen" -version = "0.8.0" +version = "0.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "392d16e9e46cc7ca98125bc288dd5e4db469efe8323d3e0dac815ca7f2398522" +checksum = "b4f7c5d6f59ae013fc4c013c76eab667844a46e86b51987acb71b1e32953211a" dependencies = [ - "bitflags 2.2.1", + "bitflags 2.4.0", "wit-bindgen-rust-macro", ] [[package]] name = "wit-bindgen-core" -version = "0.8.0" +version = "0.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d422d36cbd78caa0e18c3371628447807c66ee72466b69865ea7e33682598158" +checksum = "7f0371c47784e7559efb422f74473e395b49f7101725584e2673657e0b4fc104" dependencies = [ "anyhow", "wit-component", @@ -323,10 +352,11 @@ dependencies = [ [[package]] name = "wit-bindgen-rust" -version = "0.8.0" +version = "0.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b76db68264f5d2089dc4652581236d8e75c5b89338de6187716215fd0e68ba3" +checksum = "eeab5a09a85b1641690922ce05d79d868a2f2e78e9415a5302f58b9846fab8f1" dependencies = [ + "anyhow", "heck", "wasm-metadata", "wit-bindgen-core", @@ -336,9 +366,9 @@ dependencies = [ [[package]] name = "wit-bindgen-rust-lib" -version = "0.8.0" +version = "0.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1c50f334bc08b0903a43387f6eea6ef6aa9eb2a085729f1677b29992ecef20ba" +checksum = "a13c89c9c1a93e164318745841026f63f889376f38664f86a7f678930280e728" dependencies = [ "heck", "wit-bindgen-core", @@ -346,28 +376,31 @@ dependencies = [ [[package]] name = "wit-bindgen-rust-macro" -version = "0.8.0" +version = "0.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ced38a5e174940c6a41ae587babeadfd2e2c2dc32f3b6488bcdca0e8922cf3f3" +checksum = "a70c97e09751a9a95a592bd8ef84e953e5cdce6ebbfdb35ceefa5cc511da3b71" dependencies = [ "anyhow", "proc-macro2", - "syn 2.0.15", + "syn", "wit-bindgen-core", "wit-bindgen-rust", + "wit-bindgen-rust-lib", "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" +checksum = "2e2bf941487fc5afa9e3fc94761f6b80ecef5a2bed6239b959d23d9de69e3448" dependencies = [ "anyhow", - "bitflags 1.3.2", + "bitflags 2.4.0", "indexmap", "log", + "serde", + "serde_json", "wasm-encoder", "wasm-metadata", "wasmparser", @@ -376,9 +409,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 +419,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 92de91994..42968671a 100644 --- a/examples/spin-timer/app-example/Cargo.toml +++ b/examples/spin-timer/app-example/Cargo.toml @@ -9,6 +9,6 @@ edition = "2021" crate-type = ["cdylib"] [dependencies] -wit-bindgen = "0.8.0" +wit-bindgen = "0.12" [workspace] diff --git a/examples/spin-timer/app-example/src/lib.rs b/examples/spin-timer/app-example/src/lib.rs index 7485a6065..c81e25544 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);