From 64ebcbc1e4730696fcf8384cf40ca8952fcfc0cf Mon Sep 17 00:00:00 2001 From: Chris Dickinson Date: Tue, 3 Oct 2023 17:06:49 -0700 Subject: [PATCH] feat(component): wip component model support - upgrade to wasmtime>=13, wasmtime_wasi>=13 - the component model necessitated splitting the adapter setup into two parts: first creating the adapter so it can be associated with the state, then telling the linker how to get from the incoming state to the adapter. WASI also has this split. - change the c bindings in observe-api: 1. "_" is an illegal character! switch to "-". 2. change the module name from "dylibso_observe" to "dylibso:observe/api" --- Cargo.lock | 683 +++++++++--------- Cargo.toml | 3 +- corpus/00-component-instr-reactor/Cargo.lock | 471 ++++++++++++ corpus/00-component-instr-reactor/Cargo.toml | 24 + corpus/00-component-instr-reactor/src/lib.rs | 15 + corpus/00-component-instr-reactor/src/main.rs | 22 + .../wit/example.wit | 6 + justfile | 11 + observe-api/rust/src/lib.rs | 32 +- rust/Cargo.toml | 3 + rust/examples/otel-stdout-components.rs | 92 +++ rust/src/adapter/mod.rs | 23 + rust/src/context.rs | 105 ++- wit/observe.wasm | Bin 0 -> 874 bytes wit/observe.wit | 32 + 15 files changed, 1162 insertions(+), 360 deletions(-) create mode 100644 corpus/00-component-instr-reactor/Cargo.lock create mode 100644 corpus/00-component-instr-reactor/Cargo.toml create mode 100644 corpus/00-component-instr-reactor/src/lib.rs create mode 100644 corpus/00-component-instr-reactor/src/main.rs create mode 100644 corpus/00-component-instr-reactor/wit/example.wit create mode 100644 justfile create mode 100644 rust/examples/otel-stdout-components.rs create mode 100644 wit/observe.wasm create mode 100644 wit/observe.wit diff --git a/Cargo.lock b/Cargo.lock index ea8669d4..e85ef8d6 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4,9 +4,9 @@ version = 3 [[package]] name = "addr2line" -version = "0.20.0" +version = "0.21.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f4fa78e18c64fce05e902adecd7a5eed15a5e0a3439f7b0e169f0252214865e3" +checksum = "8a30b2e23b9e17a9f90641c7ab1549cd9b44f296d3ccbf309d2863cfe398a0cb" dependencies = [ "gimli", ] @@ -30,9 +30,9 @@ dependencies = [ [[package]] name = "aho-corasick" -version = "1.0.2" +version = "1.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "43f6cb1bf222025340178f382c426f13757b2960e89779dfcb319c32542a5a41" +checksum = "ea5d730647d4fadd988536d06fecce94b7b4f2a7efdae548f1cf4b63205518ab" dependencies = [ "memchr", ] @@ -45,9 +45,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" @@ -63,7 +63,7 @@ checksum = "bc00ceb34980c03614e35a3a4e218276a0a824e911d07651cd0d858a51e8c0f0" dependencies = [ "proc-macro2", "quote", - "syn 2.0.29", + "syn 2.0.37", ] [[package]] @@ -72,11 +72,26 @@ version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" +[[package]] +name = "backtrace" +version = "0.3.69" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2089b7e3f35b9dd2d0ed921ead4f6d318c27680d4a5bd167b3ee120edb105837" +dependencies = [ + "addr2line", + "cc", + "cfg-if", + "libc", + "miniz_oxide", + "object", + "rustc-demangle", +] + [[package]] name = "base64" -version = "0.21.2" +version = "0.21.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "604178f6c5c21f02dc555784810edfb88d34ac2c73b2eae109655649ee73ce3d" +checksum = "9ba43ea6f343b788c8764558649e08df62f86c6ef251fdaeb1ffd010a9ae50a2" [[package]] name = "bincode" @@ -110,9 +125,9 @@ dependencies = [ [[package]] name = "bumpalo" -version = "3.13.0" +version = "3.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a3e2c3daef883ecc1b5d58c15adae93470a91d425f3532ba1695849656af3fc1" +checksum = "7f30e7476521f6f8af1a1c4c0b8cc94f0bee37d91763d0ca2665f299b6cd8aec" [[package]] name = "byteorder" @@ -122,9 +137,9 @@ checksum = "14c189c53d098945499cdfa7ecc63567cf3886b3332b312a5b4585d8d3a6a610" [[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 = "cap-fs-ext" @@ -138,6 +153,18 @@ dependencies = [ "windows-sys", ] +[[package]] +name = "cap-net-ext" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6ffc30dee200c20b4dcb80572226f42658e1d9c4b668656d7cc59c33d50e396e" +dependencies = [ + "cap-primitives", + "cap-std", + "rustix 0.38.15", + "smallvec", +] + [[package]] name = "cap-primitives" version = "2.0.0" @@ -150,7 +177,7 @@ dependencies = [ "io-lifetimes 2.0.2", "ipnet", "maybe-owned", - "rustix 0.38.8", + "rustix 0.38.15", "windows-sys", "winx", ] @@ -174,7 +201,7 @@ dependencies = [ "cap-primitives", "io-extras", "io-lifetimes 2.0.2", - "rustix 0.38.8", + "rustix 0.38.15", ] [[package]] @@ -185,17 +212,18 @@ checksum = "f8f52b3c8f4abfe3252fd0a071f3004aaa3b18936ec97bdbd8763ce03aff6247" dependencies = [ "cap-primitives", "once_cell", - "rustix 0.38.8", + "rustix 0.38.15", "winx", ] [[package]] name = "cc" -version = "1.0.79" +version = "1.0.83" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "50d30906286121d95be3d479533b458f87493b30a4b5f79a607db8f5d11aa91f" +checksum = "f1174fb0b6ec23863f8b971027804a42614e347eafb0a95bf0b12cdae21fc4d0" dependencies = [ "jobserver", + "libc", ] [[package]] @@ -224,27 +252,27 @@ dependencies = [ [[package]] name = "cpufeatures" -version = "0.2.7" +version = "0.2.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3e4c1eaa2012c47becbbad2ab175484c2a84d1185b566fb2cc5b8707343dfe58" +checksum = "a17b76ff3a4162b0b27f354a0c87015ddad39d35f9c0c36607a3bdd175dde1f1" dependencies = [ "libc", ] [[package]] name = "cranelift-bforest" -version = "0.99.2" +version = "0.100.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a91a1ccf6fb772808742db2f51e2179f25b1ec559cbe39ea080c72ff61caf8f" +checksum = "03b9d1a9e776c27ad55d7792a380785d1fe8c2d7b099eed8dbd8f4af2b598192" dependencies = [ "cranelift-entity", ] [[package]] name = "cranelift-codegen" -version = "0.99.2" +version = "0.100.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "169db1a457791bff4fd1fc585bb5cc515609647e0420a7d5c98d7700c59c2d00" +checksum = "5528483314c2dd5da438576cd8a9d0b3cedad66fb8a4727f90cd319a81950038" dependencies = [ "bumpalo", "cranelift-bforest", @@ -254,7 +282,7 @@ dependencies = [ "cranelift-entity", "cranelift-isle", "gimli", - "hashbrown 0.13.2", + "hashbrown 0.14.1", "log", "regalloc2", "smallvec", @@ -263,42 +291,43 @@ dependencies = [ [[package]] name = "cranelift-codegen-meta" -version = "0.99.2" +version = "0.100.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3486b93751ef19e6d6eef66d2c0e83ed3d2ba01da1919ed2747f2f7bd8ba3419" +checksum = "0f46a8318163f7682e35b8730ba93c1b586a2da8ce12a0ed545efc1218550f70" dependencies = [ "cranelift-codegen-shared", ] [[package]] name = "cranelift-codegen-shared" -version = "0.99.2" +version = "0.100.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "86a1205ab18e7cd25dc4eca5246e56b506ced3feb8d95a8d776195e48d2cd4ef" +checksum = "37d1239cfd50eecfaed468d46943f8650e32969591868ad50111613704da6c70" [[package]] name = "cranelift-control" -version = "0.99.2" +version = "0.100.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1b108cae0f724ddfdec1871a0dc193a607e0c2d960f083cfefaae8ccf655eff2" +checksum = "bcc530560c8f16cc1d4dd7ea000c56f519c60d1a914977abe849ce555c35a61d" dependencies = [ "arbitrary", ] [[package]] name = "cranelift-entity" -version = "0.99.2" +version = "0.100.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "720444006240622798665bfc6aa8178e2eed556da342fda62f659c5267c3c659" +checksum = "f333fa641a9ad2bff0b107767dcb972c18c2bfab7969805a1d7e42449ccb0408" dependencies = [ "serde", + "serde_derive", ] [[package]] name = "cranelift-frontend" -version = "0.99.2" +version = "0.100.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b7a94c4c5508b7407e125af9d5320694b7423322e59a4ac0d07919ae254347ca" +checksum = "06abf6563015a80f03f8bc4df307d0a81363f4eb73108df3a34f6e66fb6d5307" dependencies = [ "cranelift-codegen", "log", @@ -308,15 +337,15 @@ dependencies = [ [[package]] name = "cranelift-isle" -version = "0.99.2" +version = "0.100.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ef1f888d0845dcd6be4d625b91d9d8308f3d95bed5c5d4072ce38e1917faa505" +checksum = "0eb29d0edc8a5c029ed0f7ca77501f272738e3c410020b4a00f42ffe8ad2a8aa" [[package]] name = "cranelift-native" -version = "0.99.2" +version = "0.100.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ad5966da08f1e96a3ae63be49966a85c9b249fa465f8cf1b66469a82b1004a0" +checksum = "006056a7fa920870bad06bf8e1b3033d70cbb7ee625b035efa9d90882a931868" dependencies = [ "cranelift-codegen", "libc", @@ -325,9 +354,9 @@ dependencies = [ [[package]] name = "cranelift-wasm" -version = "0.99.2" +version = "0.100.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0d8635c88b424f1d232436f683a301143b36953cd98fc6f86f7bac862dfeb6f5" +checksum = "7b3d08c05f82903a1f6a04d89c4b9ecb47a4035710f89a39a21a147a80214672" dependencies = [ "cranelift-codegen", "cranelift-entity", @@ -335,7 +364,7 @@ dependencies = [ "itertools", "log", "smallvec", - "wasmparser 0.110.0", + "wasmparser 0.112.0", "wasmtime-types", ] @@ -348,16 +377,6 @@ dependencies = [ "cfg-if", ] -[[package]] -name = "crossbeam-channel" -version = "0.5.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a33c2bf77f2df06183c3aa30d1e96c0695a313d4f9c453cc3762a6db39f99200" -dependencies = [ - "cfg-if", - "crossbeam-utils", -] - [[package]] name = "crossbeam-deque" version = "0.8.3" @@ -484,9 +503,9 @@ dependencies = [ [[package]] name = "either" -version = "1.8.1" +version = "1.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7fcaabb2fef8c910e7f4c7ce9f67a1283a1715879a7c230ca9d6d1ae31f16d91" +checksum = "a26ae43d7bcc3b814de94796a5e736d4029efb0ee900c12e2d54c993ad1a1e07" [[package]] name = "encoding_rs" @@ -497,19 +516,6 @@ dependencies = [ "cfg-if", ] -[[package]] -name = "env_logger" -version = "0.10.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "85cdab6a89accf66733ad5a1693a4dcced6aeff64602b634530dd73c1f3ee9f0" -dependencies = [ - "humantime", - "is-terminal", - "log", - "regex", - "termcolor", -] - [[package]] name = "equivalent" version = "1.0.1" @@ -518,9 +524,9 @@ checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" [[package]] name = "errno" -version = "0.3.1" +version = "0.3.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4bcfec3a70f97c962c307b2d2c56e358cf1d00b558d74262b5f929ee8cc7e73a" +checksum = "add4f07d43996f76ef320709726a556a9d4f965d9410d8d0271132d2f8293480" dependencies = [ "errno-dragonfly", "libc", @@ -539,9 +545,9 @@ dependencies = [ [[package]] name = "fallible-iterator" -version = "0.2.0" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4443176a9f2c162692bd3d352d745ef9413eec5782a80d8fd6f8a1ac692a07f7" +checksum = "2acce4a10f12dc2fb14a218589d4f1f62ef011b2d0cc4b3cb1bba8e94da14649" [[package]] name = "fastrand" @@ -559,20 +565,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0b0377f1edc77dbd1118507bc7a66e4ab64d2b90c66f90726dc801e73a8c68f9" dependencies = [ "cfg-if", - "rustix 0.38.8", + "rustix 0.38.15", "windows-sys", ] -[[package]] -name = "file-per-thread-logger" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a3cc21c33af89af0930c8cae4ade5e6fdc17b5d2c97b3d2e2edb67a1cf683f3" -dependencies = [ - "env_logger", - "log", -] - [[package]] name = "fixedbitset" version = "0.4.2" @@ -605,7 +601,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "dd738b84894214045e8414eaded76359b4a5773f0a0a56b16575110739cdcf39" dependencies = [ "io-lifetimes 2.0.2", - "rustix 0.38.8", + "rustix 0.38.15", "windows-sys", ] @@ -715,12 +711,12 @@ dependencies = [ [[package]] name = "gimli" -version = "0.27.2" +version = "0.28.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ad0a93d233ebf96623465aad4046a8d3aa4da22d4f4beba5388838c8a434bbb4" +checksum = "6fb8d784f27acf97159b40fc4db5ecd8aa23b9ad5ef69cdd136d3bc80665f0c0" dependencies = [ "fallible-iterator", - "indexmap 1.9.3", + "indexmap 2.0.2", "stable_deref_trait", ] @@ -741,9 +737,12 @@ dependencies = [ [[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", +] [[package]] name = "heck" @@ -753,24 +752,9 @@ checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8" [[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" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fed44880c466736ef9a5c5b5facefb5ed0785676d0c02d612db14e54f0d84286" - -[[package]] -name = "humantime" -version = "2.1.0" +version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9a3a5bfb195931eeb336b2a7b4d761daec841b97f947d34394601737a7bba5e4" +checksum = "d77f7ec81a6d05a3abb01ab6eb7590f6083d08449fe5a1c8b1e620283546ccb7" [[package]] name = "id-arena" @@ -800,12 +784,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", ] @@ -834,7 +818,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", "libc", "windows-sys", ] @@ -847,19 +831,18 @@ checksum = "bffb4def18c48926ccac55c1223e02865ce1a821751a95920448662696e7472c" [[package]] name = "ipnet" -version = "2.7.2" +version = "2.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "12b6ee2129af8d4fb011108c73d99a1b83a85977f23b82460c0ae2e25bb4b57f" +checksum = "28b29a3cd74f0f4598934efe3aeba42bae0eb4680554128851ebbecb02af14e6" [[package]] name = "is-terminal" -version = "0.4.7" +version = "0.4.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "adcf93614601c8129ddf72e2d5633df827ba6551541c6d8c59520a371475be1f" +checksum = "cb0889898416213fab133e1d33a0e5858a48177452750691bde3666d0fdbaf8b" dependencies = [ - "hermit-abi 0.3.1", - "io-lifetimes 1.0.11", - "rustix 0.37.20", + "hermit-abi", + "rustix 0.38.15", "windows-sys", ] @@ -874,15 +857,15 @@ dependencies = [ [[package]] name = "itoa" -version = "1.0.6" +version = "1.0.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "453ad9f582a441959e5f0d088b02ce04cfe8d51a8eaf077f12ac6d3e94164ca6" +checksum = "af150ab688ff2122fcef229be89cb50dd66af9e01a4ff320cc137eecc9bacc38" [[package]] name = "ittapi" -version = "0.3.3" +version = "0.3.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2e648c437172ce7d3ac35ca11a068755072054826fa455a916b43524fa4a62a7" +checksum = "41e0d0b7b3b53d92a7e8b80ede3400112a6b8b4c98d1f5b8b16bb787c780582c" dependencies = [ "anyhow", "ittapi-sys", @@ -891,9 +874,9 @@ dependencies = [ [[package]] name = "ittapi-sys" -version = "0.3.3" +version = "0.3.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a9b32a4d23f72548178dde54f3c12c6b6a08598e25575c0d0fa5bd861e0dc1a5" +checksum = "f2f8763c96e54e6d6a0dccc2990d8b5e33e3313aaeae6185921a3f4c1614a77c" dependencies = [ "cc", ] @@ -930,9 +913,9 @@ checksum = "884e2677b40cc8c339eaefcb701c32ef1fd2493d71118dc0ca4b6a736c93bd67" [[package]] name = "libc" -version = "0.2.147" +version = "0.2.148" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b4668fb0ea861c1df094127ac5f1da3409a82116a4ba74fca2e58ef927159bb3" +checksum = "9cdc71e17332e86d2e1d38c1f99edcb6288ee11b815fb1a4b049eaa2114d369b" [[package]] name = "linux-raw-sys" @@ -942,15 +925,15 @@ checksum = "ef53942eb7bf7ff43a617b3e2c1c4a5ecf5944a7c1bc12d7ee39bbb15e5c1519" [[package]] name = "linux-raw-sys" -version = "0.4.5" +version = "0.4.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "57bcfdad1b858c2db7c38303a6d2ad4dfaf5eb53dfeb0910128b2c26d6158503" +checksum = "3852614a3bd9ca9804678ba6be5e3b8ce76dfc902cae004e3e0c44051b6e88db" [[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 = "mach" @@ -969,17 +952,17 @@ checksum = "4facc753ae494aeb6e3c22f839b158aebd4f9270f55cd3c79906c45476c47ab4" [[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.3" +version = "0.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ffc89ccdc6e10d6907450f753537ebc5c5d3460d2e4e62ea74bd571db62c0f9e" +checksum = "b2cffa4ad52c6f791f4f8b15f0c05f9824b2ced1160e88cc393d64fff9a8ac64" dependencies = [ - "rustix 0.37.20", + "rustix 0.38.15", ] [[package]] @@ -1028,23 +1011,23 @@ checksum = "e5ce46fe64a9d73be07dcbe690a38ce1b293be448fd8ce1e6c1b8062c9f72c6a" [[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", "libc", ] [[package]] name = "object" -version = "0.31.1" +version = "0.32.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8bda667d9f2b5051b8833f59f3bf748b28ef54f850f4fcb389a252aa383866d1" +checksum = "9cf5f9dd3933bd50a9e1f149ec995f39ae2c496d31fd772c1fd45ebc27e902b0" dependencies = [ "crc32fast", - "hashbrown 0.13.2", - "indexmap 1.9.3", + "hashbrown 0.14.1", + "indexmap 2.0.2", "memchr", ] @@ -1056,9 +1039,9 @@ checksum = "dd8b5dd2ae5ed71462c540258bedcb51965123ad7e7ccf4b9a8cafaa4a63576d" [[package]] name = "paste" -version = "1.0.12" +version = "1.0.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9f746c4065a8fa3fe23974dd82f15431cc8d40779821001404d10d2e79ca7d79" +checksum = "de3145af08024dea9fa9914f381a17b8fc6034dfb00f3a84013f7ff43f29ed4c" [[package]] name = "percent-encoding" @@ -1078,9 +1061,9 @@ dependencies = [ [[package]] name = "pin-project-lite" -version = "0.2.9" +version = "0.2.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e0a7ae3ac2f1173085d398531c705756c94a4c56843785df85a60c1a0afac116" +checksum = "8afb450f006bf6385ca15ef45d71d2288452bc3683ce2e2cacc0d18e4be60b58" [[package]] name = "pin-utils" @@ -1112,9 +1095,9 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.66" +version = "1.0.67" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "18fb31db3f9bddb2ea821cde30a9f70117e3f119938b5ee630b7403aa6e2ead9" +checksum = "3d433d9f1a3e8c1263d9456598b16fec66f4acc9a74dacffd35c7bb09b3a1328" dependencies = [ "unicode-ident", ] @@ -1234,9 +1217,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", @@ -1244,14 +1227,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]] @@ -1298,9 +1279,21 @@ dependencies = [ [[package]] name = "regex" -version = "1.8.4" +version = "1.9.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d0ab3ca65655bb1e41f2a8c8cd662eb4fb035e67c3f78da1d61dffe89d07300f" +checksum = "ebee201405406dbf528b8b672104ae6d6d63e6d118cb10e4d51abbc7b58044ff" +dependencies = [ + "aho-corasick", + "memchr", + "regex-automata", + "regex-syntax", +] + +[[package]] +name = "regex-automata" +version = "0.3.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "59b23e92ee4318893fa3fe3e6fb365258efbfe6ac6ab30f090cdcbb7aa37efa9" dependencies = [ "aho-corasick", "memchr", @@ -1309,9 +1302,9 @@ dependencies = [ [[package]] name = "regex-syntax" -version = "0.7.2" +version = "0.7.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "436b050e76ed2903236f032a59761c1eb99e1b0aead2c257922771dab1fc8c78" +checksum = "dbb5fb1acd8a1a18b3dd5be62d25485eb770e05afb408a9627d14d451bae12da" [[package]] name = "ring" @@ -1342,9 +1335,9 @@ checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2" [[package]] name = "rustix" -version = "0.37.20" +version = "0.37.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b96e891d04aa506a6d1f318d2771bcb1c7dfda84e126660ace067c9b474bb2c0" +checksum = "4279d76516df406a8bd37e7dff53fd37d1a093f997a3c34a5c21658c126db06d" dependencies = [ "bitflags 1.3.2", "errno", @@ -1356,15 +1349,15 @@ dependencies = [ [[package]] name = "rustix" -version = "0.38.8" +version = "0.38.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "19ed4fa021d81c8392ce04db050a3da9a60299050b7ae1cf482d862b54a7218f" +checksum = "d2f9da0cbd88f9f09e7814e388301c8414c51c62aa6ce1e4b5c551d49d96e531" dependencies = [ "bitflags 2.4.0", "errno", "itoa", "libc", - "linux-raw-sys 0.4.5", + "linux-raw-sys 0.4.8", "once_cell", "windows-sys", ] @@ -1393,15 +1386,15 @@ dependencies = [ [[package]] name = "ryu" -version = "1.0.13" +version = "1.0.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f91339c0467de62360649f8d3e185ca8de4224ff281f66000de5eb2a77a79041" +checksum = "1ad4cc8da4ef723ed60bced201181d83791ad433213d8c24efffda1eec85d741" [[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" @@ -1415,35 +1408,35 @@ dependencies = [ [[package]] name = "semver" -version = "1.0.17" +version = "1.0.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bebd363326d05ec3e2f532ab7660680f3b02130d780c299bca73469d521bc0ed" +checksum = "ad977052201c6de01a8ef2aa3378c4bd23217a056337d1d6da40468d267a4fb0" [[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.29", + "syn 2.0.37", ] [[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", @@ -1473,9 +1466,9 @@ dependencies = [ [[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", @@ -1499,18 +1492,18 @@ 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.9" +version = "0.5.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "64a4a911eed85daf18834cfaa86a79b7d266ff93ff5ba14005426219480ed662" +checksum = "4031e820eb552adee9295814c0ced9e5cf38ddf1e8b7d566d6de8e2538ea989e" dependencies = [ "libc", - "winapi", + "windows-sys", ] [[package]] @@ -1544,9 +1537,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.29" +version = "2.0.37" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c324c494eba9d92503e6f1ef2e6df781e78f6a7705a0202d9801b198807d518a" +checksum = "7303ef2c05cd654186cb250d29049a24840ca25d2747c25c0381c8d9e2f582e8" dependencies = [ "proc-macro2", "quote", @@ -1564,16 +1557,16 @@ dependencies = [ "cap-std", "fd-lock", "io-lifetimes 2.0.2", - "rustix 0.38.8", + "rustix 0.38.15", "windows-sys", "winx", ] [[package]] name = "target-lexicon" -version = "0.12.7" +version = "0.12.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fd1ba337640d60c3e96bc6f0638a939b9c9a7f2c316a1598c279828b3d1dc8c5" +checksum = "9d0e916b1148c8e263850e1ebcbd046f333e0683c724876bb0da63ea4373dc8a" [[package]] name = "tempfile" @@ -1585,37 +1578,28 @@ dependencies = [ "cfg-if", "fastrand", "redox_syscall 0.3.5", - "rustix 0.37.20", + "rustix 0.37.24", "windows-sys", ] -[[package]] -name = "termcolor" -version = "1.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "be55cf8942feac5c765c2c993422806843c9a9a45d4d5c407ad6dd2ea95eb9b6" -dependencies = [ - "winapi-util", -] - [[package]] name = "thiserror" -version = "1.0.47" +version = "1.0.49" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "97a802ec30afc17eee47b2855fc72e0c4cd62be9b4efe6591edde0ec5bd68d8f" +checksum = "1177e8c6d7ede7afde3585fd2513e611227efd6481bd78d2e82ba1ce16557ed4" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.47" +version = "1.0.49" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6bb623b56e39ab7dcd4b1b98bb6c8f8d907ed255b18de254088016b27a8ee19b" +checksum = "10712f02019e9288794769fba95cd6847df9874d49d871d062172f9dd41bc4cc" dependencies = [ "proc-macro2", "quote", - "syn 2.0.29", + "syn 2.0.37", ] [[package]] @@ -1635,11 +1619,11 @@ checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" [[package]] name = "tokio" -version = "1.28.2" +version = "1.32.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "94d7b1cfd2aa4011f2de74c2c4c63665e27a71006b0a192dcd2710272e73dfa2" +checksum = "17ed6077ed6cd6c74735e21f37eb16dc3935f96878b1fe961074089cc80893f9" dependencies = [ - "autocfg", + "backtrace", "bytes", "libc", "mio", @@ -1658,7 +1642,7 @@ checksum = "630bdcf245f78637c13ec01ffae6187cca34625e8c63150d424b59e55af2675e" dependencies = [ "proc-macro2", "quote", - "syn 2.0.29", + "syn 2.0.37", ] [[package]] @@ -1685,13 +1669,13 @@ dependencies = [ [[package]] name = "tracing-attributes" -version = "0.1.24" +version = "0.1.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f57e3ca2a01450b1a921183a9c9cbfda207fd822cef4ccb00a65402cbba7a74" +checksum = "5f4f31f56159e98206da9efd823404b79b6ef3143b4a7ab76e67b1751b25a4ab" dependencies = [ "proc-macro2", "quote", - "syn 2.0.29", + "syn 2.0.37", ] [[package]] @@ -1705,15 +1689,15 @@ 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 = "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", ] @@ -1726,9 +1710,9 @@ 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" @@ -1741,9 +1725,9 @@ dependencies = [ [[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" @@ -1775,9 +1759,9 @@ dependencies = [ [[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", @@ -1804,9 +1788,9 @@ checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" [[package]] name = "wasi-cap-std-sync" -version = "12.0.0" +version = "13.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2ec6af51bbe8d04f2de5cd7a6d52e2b2dec67754167b70f2e863541092f09ef1" +checksum = "ec076cd75f207327f5bfaebb915ef03d82c3a01a6d9b5d0deb6eafffceab3095" dependencies = [ "anyhow", "async-trait", @@ -1819,7 +1803,7 @@ dependencies = [ "io-lifetimes 2.0.2", "is-terminal", "once_cell", - "rustix 0.38.8", + "rustix 0.38.15", "system-interface", "tracing", "wasi-common", @@ -1828,9 +1812,9 @@ dependencies = [ [[package]] name = "wasi-common" -version = "12.0.0" +version = "13.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e4194b7d3bbb9f0318e5e0c5813f063284388792bd6b464257ec0d53e0fa3a6f" +checksum = "3f391b334c783c1154369be62c31dc8598ffa1a6c34ea05d7f8cf0b18ce7c272" dependencies = [ "anyhow", "bitflags 2.4.0", @@ -1838,7 +1822,7 @@ dependencies = [ "cap-std", "io-extras", "log", - "rustix 0.38.8", + "rustix 0.38.15", "thiserror", "tracing", "wasmtime", @@ -1867,7 +1851,7 @@ dependencies = [ "once_cell", "proc-macro2", "quote", - "syn 2.0.29", + "syn 2.0.37", "wasm-bindgen-shared", ] @@ -1889,7 +1873,7 @@ checksum = "54681b18a46765f095758388f2d0cf16eb8d4169b639ab575a8f5693af210c7b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.29", + "syn 2.0.37", "wasm-bindgen-backend", "wasm-bindgen-shared", ] @@ -1902,9 +1886,18 @@ checksum = "ca6ad05a4870b2bf5fe995117d3728437bd27d7cd5f06f13c17443ef369775a1" [[package]] name = "wasm-encoder" -version = "0.31.1" +version = "0.32.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1ba64e81215916eaeb48fee292f29401d69235d62d8b8fd92a7b2844ec5ae5f7" +dependencies = [ + "leb128", +] + +[[package]] +name = "wasm-encoder" +version = "0.33.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "41763f20eafed1399fff1afb466496d3a959f58241436cfdc17e3f5ca954de16" +checksum = "34180c89672b3e4825c3a8db4b61a674f1447afd5fe2445b2d22c3d8b6ea086c" dependencies = [ "leb128", ] @@ -1921,39 +1914,39 @@ dependencies = [ [[package]] name = "wasmparser" -version = "0.110.0" +version = "0.112.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1dfcdb72d96f01e6c85b6bf20102e7423bdbaad5c337301bab2bbf253d26413c" +checksum = "e986b010f47fcce49cf8ea5d5f9e5d2737832f12b53ae8ae785bbe895d0877bf" dependencies = [ - "indexmap 2.0.0", + "indexmap 2.0.2", "semver", ] [[package]] name = "wasmparser" -version = "0.111.0" +version = "0.113.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ad71036aada3f6b09251546e97e4f4f176dd6b41cf6fa55e7e0f65e86aec319a" +checksum = "286049849b5a5bd09a8773171be96824afabffc7cc3df6caaf33a38db6cd07ae" dependencies = [ - "indexmap 2.0.0", + "indexmap 2.0.2", "semver", ] [[package]] name = "wasmprinter" -version = "0.2.63" +version = "0.2.68" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eeb8cc41d341939dce08ee902b50e36cd35add940f6044c94b144e8f73fe07a6" +checksum = "537030718ce76e985896e91fe2cac77c1913c8dccd46eaf8ab1a4cd56d824cc3" dependencies = [ "anyhow", - "wasmparser 0.111.0", + "wasmparser 0.113.3", ] [[package]] name = "wasmtime" -version = "12.0.2" +version = "13.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c4e87029cc5760db9a3774aff4708596fe90c20ed2baeef97212e98b812fd0fc" +checksum = "16ed7db409c1acf60d33128b2a38bee25aaf38c4bd955ab98a5b623c8294593c" dependencies = [ "anyhow", "async-trait", @@ -1962,7 +1955,7 @@ dependencies = [ "cfg-if", "encoding_rs", "fxprof-processed-profile", - "indexmap 2.0.0", + "indexmap 2.0.2", "libc", "log", "object", @@ -1971,10 +1964,11 @@ dependencies = [ "psm", "rayon", "serde", + "serde_derive", "serde_json", "target-lexicon", - "wasm-encoder", - "wasmparser 0.110.0", + "wasm-encoder 0.32.0", + "wasmparser 0.112.0", "wasmtime-cache", "wasmtime-component-macro", "wasmtime-component-util", @@ -1990,27 +1984,27 @@ dependencies = [ [[package]] name = "wasmtime-asm-macros" -version = "12.0.2" +version = "13.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "96d84f68d831200016e120f2ee79d81b50cf4c4123112914aefb168d036d445d" +checksum = "53af0f8f6271bd687fe5632c8fe0a0f061d0aa1b99a0cd4e1df8e4cbeb809d2f" dependencies = [ "cfg-if", ] [[package]] name = "wasmtime-cache" -version = "12.0.2" +version = "13.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "31561fbbaa86d3c042696940bc9601146bf4aaec39ae725c86b5f1358d8d7023" +checksum = "41376a7c094335ee08abe6a4eff79a32510cc805a249eff1b5e7adf0a42e7cdf" dependencies = [ "anyhow", "base64", "bincode", "directories-next", - "file-per-thread-logger", "log", - "rustix 0.38.8", + "rustix 0.38.15", "serde", + "serde_derive", "sha2", "toml", "windows-sys", @@ -2019,14 +2013,14 @@ dependencies = [ [[package]] name = "wasmtime-component-macro" -version = "12.0.2" +version = "13.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e7e07b8da23838e870c4c092027208ac546398a2ac4f5afff33a1ea1d763ec0" +checksum = "74ab5b291f2dad56f1e6929cc61fb7cac68845766ca77c3838b5d05d82c33976" dependencies = [ "anyhow", "proc-macro2", "quote", - "syn 2.0.29", + "syn 2.0.37", "wasmtime-component-util", "wasmtime-wit-bindgen", "wit-parser", @@ -2034,17 +2028,18 @@ dependencies = [ [[package]] name = "wasmtime-component-util" -version = "12.0.2" +version = "13.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "74f421bc59c753dcd24e39601928a0f2915adf15f40d8ba0066c4cf23f92c9a0" +checksum = "21436177bf19f6b60dc0b83ad5872e849892a4a90c3572785e1a28c0e2e1132c" [[package]] name = "wasmtime-cranelift" -version = "12.0.2" +version = "13.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ae8ed7a4845f22be6b1ad80f33f43fa03445b03a02f2d40dca695129769cd1a" +checksum = "920e42058862d1f7a3dd3fca73cb495a20d7506e3ada4bbc0a9780cd636da7ca" dependencies = [ "anyhow", + "cfg-if", "cranelift-codegen", "cranelift-control", "cranelift-entity", @@ -2056,7 +2051,7 @@ dependencies = [ "object", "target-lexicon", "thiserror", - "wasmparser 0.110.0", + "wasmparser 0.112.0", "wasmtime-cranelift-shared", "wasmtime-environ", "wasmtime-versioned-export-macros", @@ -2064,9 +2059,9 @@ dependencies = [ [[package]] name = "wasmtime-cranelift-shared" -version = "12.0.2" +version = "13.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "86b17099f9320a1c481634d88101258917d5065717cf22b04ed75b1a8ea062b4" +checksum = "516d63bbe18219e64a9705cf3a2c865afe1fb711454ea03091dc85a1d708194d" dependencies = [ "anyhow", "cranelift-codegen", @@ -2080,21 +2075,22 @@ dependencies = [ [[package]] name = "wasmtime-environ" -version = "12.0.2" +version = "13.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e8b9227b1001229ff125e0f76bf1d5b9dc4895e6bcfd5cc35a56f84685964ec7" +checksum = "59cef239d663885f1427f8b8f4fde7be6075249c282580d94b480f11953ca194" dependencies = [ "anyhow", "cranelift-entity", "gimli", - "indexmap 2.0.0", + "indexmap 2.0.2", "log", "object", "serde", + "serde_derive", "target-lexicon", "thiserror", - "wasm-encoder", - "wasmparser 0.110.0", + "wasm-encoder 0.32.0", + "wasmparser 0.112.0", "wasmprinter", "wasmtime-component-util", "wasmtime-types", @@ -2102,13 +2098,13 @@ dependencies = [ [[package]] name = "wasmtime-fiber" -version = "12.0.2" +version = "13.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fc8c8410c03a79073ea06806ccde3da4854c646bd646b3b2707b99b3746c3f70" +checksum = "2ef118b557df6193cd82cfb45ab57cd12388fedfe2bb76f090b2d77c96c1b56e" dependencies = [ "cc", "cfg-if", - "rustix 0.38.8", + "rustix 0.38.15", "wasmtime-asm-macros", "wasmtime-versioned-export-macros", "windows-sys", @@ -2116,9 +2112,9 @@ dependencies = [ [[package]] name = "wasmtime-jit" -version = "12.0.2" +version = "13.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cce606b392c321d7272928003543447119ef937a9c3ebfce5c4bb0bf6b0f5bac" +checksum = "c8089d5909b8f923aad57702ebaacb7b662aa9e43a3f71e83e025c5379a1205f" dependencies = [ "addr2line", "anyhow", @@ -2130,8 +2126,9 @@ dependencies = [ "log", "object", "rustc-demangle", - "rustix 0.38.8", + "rustix 0.38.15", "serde", + "serde_derive", "target-lexicon", "wasmtime-environ", "wasmtime-jit-debug", @@ -2142,21 +2139,21 @@ dependencies = [ [[package]] name = "wasmtime-jit-debug" -version = "12.0.2" +version = "13.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aef27ea6c34ef888030d15560037fe7ef27a5609fbbba8e1e3e41dc4245f5bb2" +checksum = "9b13924aedf6799ad66edb25500a20e3226629978b30a958c55285352bad130a" dependencies = [ "object", "once_cell", - "rustix 0.38.8", + "rustix 0.38.15", "wasmtime-versioned-export-macros", ] [[package]] name = "wasmtime-jit-icache-coherence" -version = "12.0.2" +version = "13.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b59f94b0409221873565419168e20b5aedf18c4bd64de5c38acf8f0634efeee3" +checksum = "c6ff5f3707a5e3797deeeeac6ac26b2e1dd32dbc06693c0ab52e8ac4d18ec706" dependencies = [ "cfg-if", "libc", @@ -2165,15 +2162,15 @@ dependencies = [ [[package]] name = "wasmtime-runtime" -version = "12.0.2" +version = "13.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ceb587a88ae5bb6ca248455a391aff29ac63329a404b2cdea36d91267c797db4" +checksum = "11ab4ce04ac05342edfa7f42895f2a5d8b16ee914330869acb865cd1facf265f" dependencies = [ "anyhow", "cc", "cfg-if", "encoding_rs", - "indexmap 2.0.0", + "indexmap 2.0.2", "libc", "log", "mach", @@ -2181,60 +2178,65 @@ dependencies = [ "memoffset", "paste", "rand", - "rustix 0.38.8", + "rustix 0.38.15", "sptr", - "wasm-encoder", + "wasm-encoder 0.32.0", "wasmtime-asm-macros", "wasmtime-environ", "wasmtime-fiber", "wasmtime-jit-debug", "wasmtime-versioned-export-macros", + "wasmtime-wmemcheck", "windows-sys", ] [[package]] name = "wasmtime-types" -version = "12.0.2" +version = "13.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77943729d4b46141538e8d0b6168915dc5f88575ecdfea26753fd3ba8bab244a" +checksum = "ecf61e21d5bd95e1ad7fa42b7bdabe21220682d6a6046d376edca29760849222" dependencies = [ "cranelift-entity", "serde", + "serde_derive", "thiserror", - "wasmparser 0.110.0", + "wasmparser 0.112.0", ] [[package]] name = "wasmtime-versioned-export-macros" -version = "12.0.2" +version = "13.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca7af9bb3ee875c4907835e607a275d10b04d15623d3aebe01afe8fbd3f85050" +checksum = "fe877472cbdd6d96b4ecdc112af764e3b9d58c2e4175a87828f892ab94c60643" dependencies = [ "proc-macro2", "quote", - "syn 2.0.29", + "syn 2.0.37", ] [[package]] name = "wasmtime-wasi" -version = "12.0.0" +version = "13.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1070c476eee479bdfd98ee7040f21b28993cce87b8b9ced3bf84ff07d4ec3a6e" +checksum = "b6db393deb775e8bece53a6869be6425e46b28426aa7709df8c529a19759f4be" dependencies = [ "anyhow", "async-trait", "bitflags 2.4.0", "bytes", "cap-fs-ext", + "cap-net-ext", "cap-rand", "cap-std", "cap-time-ext", "fs-set-times", "futures", "io-extras", + "io-lifetimes 2.0.2", + "is-terminal", "libc", "once_cell", - "rustix 0.38.8", + "rustix 0.38.15", "system-interface", "thiserror", "tokio", @@ -2248,16 +2250,16 @@ dependencies = [ [[package]] name = "wasmtime-winch" -version = "12.0.2" +version = "13.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bcdfbdbb400f63e4dfc6dd32f42c77484da58c9622cdd9e9aac238c7347afdf1" +checksum = "0bc5a770003807c55f2187a0092dea01722b0e24151e35816bd5091538bb8e88" dependencies = [ "anyhow", "cranelift-codegen", "gimli", "object", "target-lexicon", - "wasmparser 0.110.0", + "wasmparser 0.112.0", "wasmtime-cranelift-shared", "wasmtime-environ", "winch-codegen", @@ -2265,16 +2267,22 @@ dependencies = [ [[package]] name = "wasmtime-wit-bindgen" -version = "12.0.2" +version = "13.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "14770d0820f56ba86cdd9987aef97cc3bacbb0394633c37dbfbc61ef29603a71" +checksum = "62003d48822f89cc393e93643366ddbee1766779c0874353b8ba2ede4679fbf9" 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" + [[package]] name = "wast" version = "35.0.2" @@ -2286,23 +2294,23 @@ dependencies = [ [[package]] name = "wast" -version = "63.0.0" +version = "66.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2560471f60a48b77fccefaf40796fda61c97ce1e790b59dfcec9dc3995c9f63a" +checksum = "0da7529bb848d58ab8bf32230fc065b363baee2bd338d5e58c589a1e7d83ad07" dependencies = [ "leb128", "memchr", "unicode-width", - "wasm-encoder", + "wasm-encoder 0.33.2", ] [[package]] name = "wat" -version = "1.0.70" +version = "1.0.75" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3bdc306c2c4c2f2bf2ba69e083731d0d2a77437fc6a350a19db139636e7e416c" +checksum = "4780374047c65b6b6e86019093fe80c18b66825eb684df778a4e068282a780e7" dependencies = [ - "wast 63.0.0", + "wast 66.0.0", ] [[package]] @@ -2337,9 +2345,9 @@ dependencies = [ [[package]] name = "wiggle" -version = "12.0.0" +version = "13.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1411b73e79260d74c9b10f5b7adf0f682b9f3a19a6286d60c6a67da07a9b8251" +checksum = "da341f21516453768bd115bdc17b186c0a1ab6773c2b2eeab44a062db49bd616" dependencies = [ "anyhow", "async-trait", @@ -2352,28 +2360,28 @@ dependencies = [ [[package]] name = "wiggle-generate" -version = "12.0.0" +version = "13.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "80f95f3125bae7b5884c92b969d1b450cc90b703a5c1fb3224e59935a13fcd4f" +checksum = "e22c6bd943a4bae37052b79d249fb32d7afa22b3f6a147a5f2e7bc2b9f901879" dependencies = [ "anyhow", "heck", "proc-macro2", "quote", "shellexpand", - "syn 2.0.29", + "syn 2.0.37", "witx", ] [[package]] name = "wiggle-macro" -version = "12.0.0" +version = "13.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ed8231ff26b8b6a996497823e73095f43f22719609aa0493d3b2975f17721a0" +checksum = "7d72d838b7c9302b2ca7c44f36d6af5ce1988239a16deba951d99c4630d17caf" dependencies = [ "proc-macro2", "quote", - "syn 2.0.29", + "syn 2.0.37", "wiggle-generate", ] @@ -2393,15 +2401,6 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" -[[package]] -name = "winapi-util" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70ec6ce85bb158151cae5e5c87f95a8e97d2c0c4b001223f33a334e3ce5de178" -dependencies = [ - "winapi", -] - [[package]] name = "winapi-x86_64-pc-windows-gnu" version = "0.4.0" @@ -2410,9 +2409,9 @@ checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" [[package]] name = "winch-codegen" -version = "0.10.2" +version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9722f5d601e3ea1cab8cc23f8e4c07c57d6657a1d72ef4c3a064100cca725a20" +checksum = "50647204d600a2a112eefac0645ba6653809a15bd362c7e4e6a049a5bdff0de9" dependencies = [ "anyhow", "cranelift-codegen", @@ -2420,7 +2419,7 @@ dependencies = [ "regalloc2", "smallvec", "target-lexicon", - "wasmparser 0.110.0", + "wasmparser 0.112.0", "wasmtime-environ", ] @@ -2435,9 +2434,9 @@ 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", "windows_aarch64_msvc", @@ -2450,51 +2449,51 @@ dependencies = [ [[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" -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" -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" -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" -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" -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" -version = "0.48.0" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a515f5799fe4961cb532f983ce2b23082366b898e52ffbce459c86f67c8378a" +checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" [[package]] name = "winx" -version = "0.36.1" +version = "0.36.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4857cedf8371f690bb6782a3e2b065c54d1b6661be068aaf3eac8b45e813fdf8" +checksum = "357bb8e2932df531f83b052264b050b81ba0df90ee5a59b2d1d3949f344f81e5" dependencies = [ "bitflags 2.4.0", "windows-sys", @@ -2502,16 +2501,18 @@ dependencies = [ [[package]] name = "wit-parser" -version = "0.9.2" +version = "0.11.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "541efa2046e544de53a9da1e2f6299e63079840360c9e106f1f8275a97771318" +checksum = "a39edca9abb16309def3843af73b58d47d243fe33a9ceee572446bcc57556b9a" dependencies = [ "anyhow", "id-arena", - "indexmap 2.0.0", + "indexmap 2.0.2", "log", "pulldown-cmark", "semver", + "serde", + "serde_json", "unicode-xid", "url", ] diff --git a/Cargo.toml b/Cargo.toml index e0ddf8fd..668fd506 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,3 +1,4 @@ [workspace] members = [ "rust" ] -exclude = [ "observe-api/rust", "observe-api/test/rust" ] +exclude = [ "observe-api/rust", "observe-api/test/rust", "corpus/" ] +resolver = "2" diff --git a/corpus/00-component-instr-reactor/Cargo.lock b/corpus/00-component-instr-reactor/Cargo.lock new file mode 100644 index 00000000..cd17c931 --- /dev/null +++ b/corpus/00-component-instr-reactor/Cargo.lock @@ -0,0 +1,471 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 3 + +[[package]] +name = "anyhow" +version = "1.0.75" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a4668cab20f66d8d020e1fbc0ebe47217433c1b6c8f2040faf858554e394ace6" + +[[package]] +name = "bitflags" +version = "1.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" + +[[package]] +name = "bitflags" +version = "2.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b4682ae6287fcf752ecaabbfcc7b6f9b72aa33933dc23a554d853aea8eea8635" + +[[package]] +name = "cargo-component-bindings" +version = "0.1.0" +source = "git+https://github.com/bytecodealliance/cargo-component#465baa975bbe0aced376645fc7cc851f76eedd66" +dependencies = [ + "cargo-component-macro", + "wit-bindgen", +] + +[[package]] +name = "cargo-component-macro" +version = "0.1.0" +source = "git+https://github.com/bytecodealliance/cargo-component#465baa975bbe0aced376645fc7cc851f76eedd66" +dependencies = [ + "heck", + "proc-macro2", + "quote", + "syn 2.0.37", + "wit-bindgen-core", + "wit-bindgen-rust", + "wit-bindgen-rust-lib", + "wit-component", +] + +[[package]] +name = "component-instr-reactor" +version = "0.1.0" +dependencies = [ + "cargo-component-bindings", + "log", + "observe_api", +] + +[[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.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a62bc1cf6f830c2ec14a513a9fb124d0a213a629668a4186f329db21fe045652" +dependencies = [ + "percent-encoding", +] + +[[package]] +name = "hashbrown" +version = "0.14.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7dfda62a12f55daeae5015f81b0baea145391cb4520f86c248fc615d72640d12" + +[[package]] +name = "heck" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8" +dependencies = [ + "unicode-segmentation", +] + +[[package]] +name = "id-arena" +version = "2.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "25a2bc672d1148e28034f176e01fffebb08b35768468cc954630da77a1449005" + +[[package]] +name = "idna" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7d20d6b07bfbc108882d88ed8e37d39636dcc260e15e30c45e6ba089610b917c" +dependencies = [ + "unicode-bidi", + "unicode-normalization", +] + +[[package]] +name = "indexmap" +version = "2.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8adf3ddd720272c6ea8bf59463c04e0f93d0bbf7c5439b691bca2987e0270897" +dependencies = [ + "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" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "884e2677b40cc8c339eaefcb701c32ef1fd2493d71118dc0ca4b6a736c93bd67" + +[[package]] +name = "log" +version = "0.4.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b5e6163cb8c49088c2c36f57875e58ccd8c87c7427f7fbd50ea6710b2f3f2e8f" + +[[package]] +name = "memchr" +version = "2.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f665ee40bc4a3c5590afb1e9677db74a508659dfd71e126420da8274909a0167" + +[[package]] +name = "observe_api" +version = "0.1.0" +dependencies = [ + "log", + "observe_instrument", +] + +[[package]] +name = "observe_instrument" +version = "0.1.0" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "percent-encoding" +version = "2.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9b2a4787296e9989611394c33f193f676704af1686e70b8f8033ab5ba9a35a94" + +[[package]] +name = "proc-macro2" +version = "1.0.67" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3d433d9f1a3e8c1263d9456598b16fec66f4acc9a74dacffd35c7bb09b3a1328" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "pulldown-cmark" +version = "0.9.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77a1a2f1f0a7ecff9c31abbe177637be0e97a0aef46cf8738ece09327985d998" +dependencies = [ + "bitflags 1.3.2", + "memchr", + "unicase", +] + +[[package]] +name = "quote" +version = "1.0.33" +source = "registry+https://github.com/rust-lang/crates.io-index" +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.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ad977052201c6de01a8ef2aa3378c4bd23217a056337d1d6da40468d267a4fb0" + +[[package]] +name = "serde" +version = "1.0.188" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cf9e0fcba69a370eed61bcf2b728575f726b50b55cba78064753d708ddc7549e" +dependencies = [ + "serde_derive", +] + +[[package]] +name = "serde_derive" +version = "1.0.188" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4eca7ac642d82aa35b60049a6eccb4be6be75e599bd2e9adb5f875a737654af2" +dependencies = [ + "proc-macro2", + "quote", + "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 = "spdx" +version = "0.10.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b19b32ed6d899ab23174302ff105c1577e45a06b08d4fe0a9dd13ce804bbbf71" +dependencies = [ + "smallvec", +] + +[[package]] +name = "syn" +version = "1.0.109" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "syn" +version = "2.0.37" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7303ef2c05cd654186cb250d29049a24840ca25d2747c25c0381c8d9e2f582e8" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "tinyvec" +version = "1.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "87cc5ceb3875bb20c2890005a4e226a4651264a5c75edb2421b52861a0a0cb50" +dependencies = [ + "tinyvec_macros", +] + +[[package]] +name = "tinyvec_macros" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" + +[[package]] +name = "unicase" +version = "2.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f7d2d4dafb69621809a81864c9c1b864479e1235c0dd4e199924b9742439ed89" +dependencies = [ + "version_check", +] + +[[package]] +name = "unicode-bidi" +version = "0.3.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "92888ba5573ff080736b3648696b70cafad7d250551175acbaa4e0385b3e1460" + +[[package]] +name = "unicode-ident" +version = "1.0.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" + +[[package]] +name = "unicode-normalization" +version = "0.1.22" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c5713f0fc4b5db668a2ac63cdb7bb4469d8c9fed047b1d0292cc7b0ce2ba921" +dependencies = [ + "tinyvec", +] + +[[package]] +name = "unicode-segmentation" +version = "1.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1dd624098567895118886609431a7c3b8f516e41d30e0643f03d94592a147e36" + +[[package]] +name = "unicode-xid" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f962df74c8c05a667b5ee8bcf162993134c104e96440b663c8daa176dc772d8c" + +[[package]] +name = "url" +version = "2.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "143b538f18257fac9cad154828a57c6bf5157e1aa604d4816b5995bf6de87ae5" +dependencies = [ + "form_urlencoded", + "idna", + "percent-encoding", +] + +[[package]] +name = "version_check" +version = "0.9.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" + +[[package]] +name = "wasm-encoder" +version = "0.33.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "34180c89672b3e4825c3a8db4b61a674f1447afd5fe2445b2d22c3d8b6ea086c" +dependencies = [ + "leb128", +] + +[[package]] +name = "wasm-metadata" +version = "0.10.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "577508d8a45bc54ad97efe77c95ba57bb10e7e5c5bac9c31295ce88b8045cd7d" +dependencies = [ + "anyhow", + "indexmap", + "serde", + "serde_json", + "spdx", + "wasm-encoder", + "wasmparser", +] + +[[package]] +name = "wasmparser" +version = "0.113.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1fd0d44fab0bd78404e352f3399324eef76516a4580b52bc9031c60f064e98f3" +dependencies = [ + "indexmap", + "semver", +] + +[[package]] +name = "wit-bindgen" +version = "0.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b4f7c5d6f59ae013fc4c013c76eab667844a46e86b51987acb71b1e32953211a" +dependencies = [ + "bitflags 2.4.0", + "wit-bindgen-rust-macro", +] + +[[package]] +name = "wit-bindgen-core" +version = "0.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f0371c47784e7559efb422f74473e395b49f7101725584e2673657e0b4fc104" +dependencies = [ + "anyhow", + "wit-component", + "wit-parser", +] + +[[package]] +name = "wit-bindgen-rust" +version = "0.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eeab5a09a85b1641690922ce05d79d868a2f2e78e9415a5302f58b9846fab8f1" +dependencies = [ + "anyhow", + "heck", + "wasm-metadata", + "wit-bindgen-core", + "wit-bindgen-rust-lib", + "wit-component", +] + +[[package]] +name = "wit-bindgen-rust-lib" +version = "0.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a13c89c9c1a93e164318745841026f63f889376f38664f86a7f678930280e728" +dependencies = [ + "heck", + "wit-bindgen-core", +] + +[[package]] +name = "wit-bindgen-rust-macro" +version = "0.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a70c97e09751a9a95a592bd8ef84e953e5cdce6ebbfdb35ceefa5cc511da3b71" +dependencies = [ + "anyhow", + "proc-macro2", + "syn 2.0.37", + "wit-bindgen-core", + "wit-bindgen-rust", + "wit-bindgen-rust-lib", + "wit-component", +] + +[[package]] +name = "wit-component" +version = "0.14.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ee23614740bf871dac9856e3062c7a308506eb3f0a2759939ab8d0aa8436a1c0" +dependencies = [ + "anyhow", + "bitflags 2.4.0", + "indexmap", + "log", + "serde", + "serde_json", + "wasm-encoder", + "wasm-metadata", + "wasmparser", + "wit-parser", +] + +[[package]] +name = "wit-parser" +version = "0.11.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a39edca9abb16309def3843af73b58d47d243fe33a9ceee572446bcc57556b9a" +dependencies = [ + "anyhow", + "id-arena", + "indexmap", + "log", + "pulldown-cmark", + "semver", + "serde", + "serde_json", + "unicode-xid", + "url", +] diff --git a/corpus/00-component-instr-reactor/Cargo.toml b/corpus/00-component-instr-reactor/Cargo.toml new file mode 100644 index 00000000..4f1586f3 --- /dev/null +++ b/corpus/00-component-instr-reactor/Cargo.toml @@ -0,0 +1,24 @@ +[package] +name = "component-instr-reactor" +version = "0.1.0" +edition = "2021" + +[lib] +crate-type = ["cdylib"] + +[package.metadata.component] +package = "example:component-instr-reactor" + +[package.metadata.component.target] +path = "wit" +world = "component-instr-reactor" + +[package.metadata.component.target.dependencies] +"dylibso:observe" = { path = "../../wit/observe.wasm" } + +# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html + +[dependencies] +cargo-component-bindings = { git = "https://github.com/bytecodealliance/cargo-component" } +log = "0.4.20" +observe_api = { path = "../../observe-api/rust" } diff --git a/corpus/00-component-instr-reactor/src/lib.rs b/corpus/00-component-instr-reactor/src/lib.rs new file mode 100644 index 00000000..78935743 --- /dev/null +++ b/corpus/00-component-instr-reactor/src/lib.rs @@ -0,0 +1,15 @@ +cargo_component_bindings::generate!(); + +use observe_api::*; + +use bindings::Guest; + +pub struct Component; + +impl Guest for Component { + /// Say hello! + fn hello_world() -> u32 { + log(log::Level::Info, "hello world"); + 0xdeadbeef + } +} diff --git a/corpus/00-component-instr-reactor/src/main.rs b/corpus/00-component-instr-reactor/src/main.rs new file mode 100644 index 00000000..f4389160 --- /dev/null +++ b/corpus/00-component-instr-reactor/src/main.rs @@ -0,0 +1,22 @@ +cargo_component_bindings::generate!(); + +use observe_api::*; + +use bindings::Guest; + +pub struct Component; + +impl Guest for Component { + /// Say hello! + fn hello_world() -> u32 { + span_enter("hello world"); + log(log::Level::Info, "hello world"); + span_exit(); + 0xdeadbeef + } +} + +fn main() { + log(log::Level::Info, "hello world"); + println!("Hello, world!"); +} diff --git a/corpus/00-component-instr-reactor/wit/example.wit b/corpus/00-component-instr-reactor/wit/example.wit new file mode 100644 index 00000000..7ac61ab5 --- /dev/null +++ b/corpus/00-component-instr-reactor/wit/example.wit @@ -0,0 +1,6 @@ +package example:component-instr-reactor + +world component-instr-reactor { + import dylibso:observe/api + export hello-world: func() -> u32 +} diff --git a/justfile b/justfile new file mode 100644 index 00000000..7e3c34c5 --- /dev/null +++ b/justfile @@ -0,0 +1,11 @@ +_help: + @just --list + +build_wit: + wasm-tools component wit wit/observe.wit -w -o wit/observe.wasm + +component_demo: + #!/bin/bash + set -eou pipefail + (cd corpus/00-component-instr-reactor; cargo component build) + (cd rust/; cargo run -F component-model --example otel-stdout-components ../corpus/00-component-instr-reactor/target/wasm32-wasi/debug/component-instr-reactor.wasm) diff --git a/observe-api/rust/src/lib.rs b/observe-api/rust/src/lib.rs index 8fcbd509..34b733b1 100644 --- a/observe-api/rust/src/lib.rs +++ b/observe-api/rust/src/lib.rs @@ -1,23 +1,23 @@ pub use observe_instrument::instrument; -#[link(wasm_import_module = "dylibso_observe")] +#[link(wasm_import_module = "dylibso:observe/api")] extern "C" { #[link_name = "metric"] - fn _metric(format: u32, ptr: u64, len: u32); + fn _metric(format: u32, ptr: u32, len: u32); #[link_name = "log"] - fn _log(level: u32, ptr: u64, len: u32); - #[link_name = "span_enter"] - fn _span_enter(ptr: u64, len: u32); - #[link_name = "span_tags"] - fn _span_tags(ptr: u64, len: u32); - #[link_name = "span_exit"] + fn _log(level: u32, ptr: u32, len: u32); + #[link_name = "span-enter"] + fn _span_enter(ptr: u32, len: u32); + #[link_name = "span-tags"] + fn _span_tags(ptr: u32, len: u32); + #[link_name = "span-exit"] fn _span_exit(); } pub fn log(level: log::Level, message: &str) { let level = level as u32; - let ptr = message.as_ptr() as *const u8; - let ptr = ptr as u64; + let ptr = message.as_ptr(); + let ptr = ptr as u32; let len = message.len() as u32; unsafe { _log(level, ptr, len) }; } @@ -28,23 +28,23 @@ pub enum MetricFormat { pub fn metric(format: MetricFormat, message: &str) { let format = format as u32; - let ptr = message.as_ptr() as *const u8; - let ptr = ptr as u64; + let ptr = message.as_ptr(); + let ptr = ptr as u32; let len = message.len() as u32; unsafe { _metric(format, ptr, len) }; } pub fn span_enter(name: &str) { - let ptr = name.as_ptr() as *const u8; - let ptr = ptr as u64; + let ptr = name.as_ptr(); + let ptr = ptr as u32; let len = name.len() as u32; unsafe { _span_enter(ptr, len) }; } pub fn span_tags(tags: Vec<&str>) { let tags = tags.join(","); - let ptr = tags.as_ptr() as *const u8; - let ptr = ptr as u64; + let ptr = tags.as_ptr(); + let ptr = ptr as u32; let len = tags.len() as u32; unsafe { _span_tags(ptr, len) }; } diff --git a/rust/Cargo.toml b/rust/Cargo.toml index 17382bde..6152a8fb 100644 --- a/rust/Cargo.toml +++ b/rust/Cargo.toml @@ -3,6 +3,9 @@ name = "dylibso-observe-sdk" version = "0.1.0" edition = "2021" +[features] +component-model = ["wasmtime/component-model", "wasmtime/async"] + [lib] # not testing docs because the prost generated structs fail doctest = false diff --git a/rust/examples/otel-stdout-components.rs b/rust/examples/otel-stdout-components.rs new file mode 100644 index 00000000..265f476a --- /dev/null +++ b/rust/examples/otel-stdout-components.rs @@ -0,0 +1,92 @@ +use dylibso_observe_sdk::{adapter::otelstdout::OtelStdoutAdapter, context::component::ObserveSdkBindings}; + +use wasmtime::component::Val; +use wasmtime_wasi::preview2::{WasiView, WasiCtx, Table}; + +struct State { + table: Table, + wasi_ctx: WasiCtx, + observe_sdk_bindings: ObserveSdkBindings, +} + +impl WasiView for State { + fn table(&self) -> &Table { + &self.table + } + + fn table_mut(&mut self) -> &mut Table { + &mut self.table + } + + fn ctx(&self) -> &WasiCtx { + &self.wasi_ctx + } + + fn ctx_mut(&mut self) -> &mut WasiCtx { + &mut self.wasi_ctx + } +} + +impl AsMut for State { + fn as_mut(&mut self) -> &mut ObserveSdkBindings { + &mut self.observe_sdk_bindings + } +} + +#[tokio::main] +pub async fn main() -> anyhow::Result<()> { + let args: Vec<_> = std::env::args().skip(1).collect(); + let data = std::fs::read(&args[0])?; + let function_name = "hello-world"; + let mut config = wasmtime::Config::new(); + + config.async_support(true); + config.wasm_component_model(true); + + // Create instance + let engine = wasmtime::Engine::new(&config)?; + let component = wasmtime::component::Component::new(&engine, &data)?; + + let mut table = Table::new(); + + // Setup WASI + let wasi_ctx = wasmtime_wasi::preview2::WasiCtxBuilder::new() + .inherit_stdio() + .args(&args.clone()) + .build(&mut table)?; + + let mut linker = wasmtime::component::Linker::new(&engine); + + let adapter = OtelStdoutAdapter::create(); + // Provide the observability functions to the `Linker` to be made available + // to the instrumented guest code. These are safe to add and are a no-op + // if guest code is uninstrumented. + let (observe_sdk_bindings, trace_ctx) = adapter.create_bindings(&data, Default::default())?; + + let state = State { + table, + wasi_ctx, + observe_sdk_bindings + }; + let mut store = wasmtime::Store::new(&engine, state); + + wasmtime_wasi::preview2::command::add_to_linker(&mut linker)?; + dylibso_observe_sdk::context::component::add_to_linker(&mut linker)?; + + let instance = linker.instantiate_async(&mut store, &component).await?; + + // get the function and run it, the events pop into the queue + // as the function is running + + let mut vals = [Val::U32(0)]; + let f = instance + .get_func(&mut store, function_name) + .expect("function exists"); + + f.call_async(&mut store, &[], &mut vals).await.unwrap(); + + dbg!(vals); + trace_ctx.shutdown().await; + + Ok(()) +} diff --git a/rust/src/adapter/mod.rs b/rust/src/adapter/mod.rs index 7106108a..e3f66c73 100644 --- a/rust/src/adapter/mod.rs +++ b/rust/src/adapter/mod.rs @@ -14,6 +14,9 @@ use crate::{ Event, TelemetryId, TraceEvent, }; +#[cfg(feature = "component-model")] +use crate::{ wasm_instr::WasmInstrInfo, context::{ InstrumentationContext, component::ObserveSdkBindings } }; + use self::datadog::DatadogMetadata; pub mod datadog; @@ -183,6 +186,26 @@ impl AdapterHandle { Ok(TraceContext { collector }) } + #[cfg(feature = "component-model")] + pub fn create_bindings(&self, data: &[u8], options: Options) -> Result<(ObserveSdkBindings, TraceContext)> { + let (ctx, collector, collector_rx) = InstrumentationContext::new(options); + let wasm_instr_info = WasmInstrInfo::new(data)?; + + // check that the version number is supported with this SDK + // TODO decide what to do about this error? + if let Err(e) = wasm_instr_info.check_version() { + warn!("{}", e); + } + + let bindings = ObserveSdkBindings { + instr_context: ctx, + wasm_instr_info + }; + Collector::start(collector_rx, self.clone()); + Ok((bindings, TraceContext { collector })) + } + + pub fn try_send(&self, event: TraceEvent) -> Result<()> { self.adapter_tx.try_send(event)?; Ok(()) diff --git a/rust/src/context.rs b/rust/src/context.rs index 116720c0..9d758c72 100644 --- a/rust/src/context.rs +++ b/rust/src/context.rs @@ -36,7 +36,7 @@ pub struct InstrumentationContext { } impl InstrumentationContext { - fn new( + pub(crate) fn new( options: Options, ) -> ( Arc>, @@ -440,7 +440,6 @@ pub fn add_to_linker( if let Err(e) = wasm_instr_info.check_version() { warn!("{}", e); } - let t = FuncType::new([ValType::I32], []); let enter_ctx = ctx.clone(); @@ -529,3 +528,105 @@ pub fn add_to_linker( linker.allow_unknown_exports(true); Ok((events_tx, events_rx)) } + +#[cfg(feature = "component-model")] +pub mod component { + use super::*; + use wasmtime::component::Linker; + + wasmtime::component::bindgen!({ + path: "../wit", + async: false + }); + + use dylibso::observe::api::{ MetricFormat, LogLevel, Host as ApiHost }; + use dylibso::observe::instrument::Host as InstrumentHost; + + pub struct ObserveSdkBindings { + pub(crate) instr_context: Arc>, + pub(crate) wasm_instr_info: WasmInstrInfo + } + + impl TryInto for MetricFormat { + type Error = anyhow::Error; + + fn try_into(self) -> std::result::Result { + #[allow(unreachable_patterns)] + match self { + MetricFormat::Statsd => Ok(super::MetricFormat::Statsd), + _ => bail!("Illegal metric format value") + } + } + } + + impl ApiHost for ObserveSdkBindings { + fn metric(&mut self, format: MetricFormat, name: Vec) -> wasmtime::Result<()> { + if let Ok(mut cont) = self.instr_context.lock() { + cont.metric(format.try_into()?, name.as_slice())?; + } + Ok(()) + } + + fn log(&mut self, level: LogLevel, msg: Vec) -> wasmtime::Result<()> { + if let Ok(mut cont) = self.instr_context.lock() { + cont.log_write(level as u8, msg.as_slice())?; + } + Ok(()) + } + + fn span_enter(&mut self, name: String) -> wasmtime::Result<()> { + if let Ok(mut cont) = self.instr_context.lock() { + cont.enter(0u32, Some(name.as_str()))?; + } + Ok(()) + } + + fn span_tags(&mut self, tags: String) -> wasmtime::Result<()> { + let tags: Vec = tags.split(',').map(|xs| xs.to_string()).collect(); + if let Ok(mut cont) = self.instr_context.lock() { + cont.span_tags(tags)?; + } + Ok(()) + } + + fn span_exit(&mut self) -> wasmtime::Result<()> { + if let Ok(mut cont) = self.instr_context.lock() { + cont.exit(0u32)?; + } + Ok(()) + } + } + + impl InstrumentHost for ObserveSdkBindings { + fn instrument_memory_grow(&mut self, amount_in_pages: u32) -> wasmtime::Result<()> { + if let Ok(mut cont) = self.instr_context.lock() { + cont.allocate(amount_in_pages)?; + } + Ok(()) + } + + fn instrument_enter(&mut self, func_id: u32) -> wasmtime::Result<()> { + let printname = self.wasm_instr_info.function_names.get(&func_id); + if let Ok(mut cont) = self.instr_context.lock() { + cont.enter(func_id, printname.map(|x| x.as_str()))?; + } + Ok(()) + } + + fn instrument_exit(&mut self, func_id: u32) -> wasmtime::Result<()> { + if let Ok(mut cont) = self.instr_context.lock() { + cont.exit(func_id)?; + } + Ok(()) + } + } + + pub fn add_to_linker( + linker: &mut Linker, + ) -> Result<()> where T: AsMut + 'static { + Imports::add_to_linker(linker, |s| -> &mut ObserveSdkBindings { + s.as_mut() + })?; + Ok(()) + } +} diff --git a/wit/observe.wasm b/wit/observe.wasm new file mode 100644 index 0000000000000000000000000000000000000000..818f4385f7c9f69f5101ae7ec393bf8d42a75c20 GIT binary patch literal 874 zcmds#!A`?442JDB=_qX4BqR{LLk37YaoTv3EcL30CaIEiqe8pzP;+E3tLn$e6(hn***!`B%)WG{g`XF(`eA7r08VNbZjCn~qp8ye_+1Z-RSvn?Qa?53t)515y5!dX0 zjXeANk!Qb;oZ;=+kC?{!7})6Q4$uAXb=qZs`J|ERH7$xLoeJ=NfJM=GSGJ0Lz)3nP Z3V}+o>2R8IgmS5@O}mjlE}oW)) + log: func(level: log-level, msg: list) + span-enter: func(name: string) + span-tags: func(tags: string) + span-exit: func() +} + +interface instrument { + instrument-memory-grow: func(amount-in-pages: u32) + instrument-enter: func(func-id: u32) + instrument-exit: func(func-id: u32) +} + +world imports { + import api + import instrument +}