From 64c1bc4c1e6257bb199cfc205e1de665672a7a9e Mon Sep 17 00:00:00 2001 From: Miles Johnson Date: Fri, 1 Mar 2024 14:54:29 -0800 Subject: [PATCH] new: Support proto v0.31. (#23) --- .github/workflows/ci.yml | 6 +- CHANGELOG.md | 12 ++ Cargo.lock | 399 ++++++++++++++++++++++----------------- Cargo.toml | 16 +- rust-toolchain.toml | 2 +- src/helpers.rs | 8 +- src/proto.rs | 18 -- tests/download_test.rs | 18 +- 8 files changed, 274 insertions(+), 205 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 395e6e2..db64511 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -15,7 +15,7 @@ jobs: os: [ubuntu-latest, windows-latest] fail-fast: false steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - uses: moonrepo/setup-rust@v1 with: cache: false @@ -29,7 +29,7 @@ jobs: os: [ubuntu-latest, windows-latest] fail-fast: false steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - uses: moonrepo/setup-rust@v1 with: cache: false @@ -43,7 +43,7 @@ jobs: os: [ubuntu-latest, macos-latest, windows-latest] fail-fast: false steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - uses: moonrepo/setup-rust@v1 with: bins: cargo-nextest diff --git a/CHANGELOG.md b/CHANGELOG.md index fed06e7..d769b52 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,17 @@ # Changelog +## 0.9.0 + +#### 💥 Breaking + +- Removed `install_global`, use `cargo install` instead. +- Removed `uninstall_global`, use `cargo uninstall` instead. + +#### 🚀 Updates + +- Updated to support proto v0.31 release. +- Updated dependencies. + ## 0.8.1 #### 🐞 Fixes diff --git a/Cargo.lock b/Cargo.lock index 258ce06..04fce5f 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -76,9 +76,9 @@ checksum = "3a30da5c5f2d5e72842e00bcb57657162cdabef0931f40e2deb9b4140440cecd" [[package]] name = "anyhow" -version = "1.0.79" +version = "1.0.80" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "080e9890a082662b09c1ad45f567faeeb47f22b5fb23895fbe1e651e718e25ca" +checksum = "5ad32ce52e4161730f7098c077cd2ed6229b5804ccf99e5366be1ab72a98b4e1" [[package]] name = "arbitrary" @@ -118,9 +118,9 @@ dependencies = [ [[package]] name = "async-trait" -version = "0.1.74" +version = "0.1.77" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a66537f1bb974b254c98ed142ff995236e81b9d0fe4db0575f46612cb15eb0f9" +checksum = "c980ee35e870bd1a4d2c8294d4c04d0499e67bca1e4b5cefcc693c2fa00caea9" dependencies = [ "proc-macro2", "quote", @@ -221,9 +221,9 @@ checksum = "89b2fd2a0dcf38d7971e2194b6b6eebab45ae01067456a7fd93d5547a61b70be" [[package]] name = "cached" -version = "0.48.1" +version = "0.49.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "355face540df58778b96814c48abb3c2ed67c4878a8087ab1819c1fedeec505f" +checksum = "f251fd1e72720ca07bf5d8e310f54a193fd053479a1f6342c6663ee4fa01cf96" dependencies = [ "ahash", "cached_proc_macro", @@ -236,9 +236,9 @@ dependencies = [ [[package]] name = "cached_proc_macro" -version = "0.19.1" +version = "0.20.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d52f526f7cbc875b296856ca8c964a9f6290556922c303a8a3883e3c676e6a1" +checksum = "ad9f16c0d84de31a2ab7fdf5f7783c14631f7075cf464eb3bb43119f61c9cb2a" dependencies = [ "darling 0.14.4", "proc-macro2", @@ -658,12 +658,12 @@ dependencies = [ [[package]] name = "darling" -version = "0.20.3" +version = "0.20.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0209d94da627ab5605dcccf08bb18afa5009cfbef48d8a8b7d7bdbc79be25c5e" +checksum = "54e36fcd13ed84ffdfda6f5be89b31287cbb80c439841fe69e04841435464391" dependencies = [ - "darling_core 0.20.3", - "darling_macro 0.20.3", + "darling_core 0.20.8", + "darling_macro 0.20.8", ] [[package]] @@ -682,9 +682,9 @@ dependencies = [ [[package]] name = "darling_core" -version = "0.20.3" +version = "0.20.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "177e3443818124b357d8e76f53be906d60937f0d3a90773a664fa63fa253e621" +checksum = "9c2cf1c23a687a1feeb728783b993c4e1ad83d99f351801977dd809b48d0a70f" dependencies = [ "fnv", "ident_case", @@ -707,11 +707,11 @@ dependencies = [ [[package]] name = "darling_macro" -version = "0.20.3" +version = "0.20.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "836a9bbc7ad63342d6d6e7b815ccab164bc77a2d95d84bc3117a8c0d5c98e2d5" +checksum = "a668eda54683121533a393014d8692171709ff57a7d61f187b6e782719f8933f" dependencies = [ - "darling_core 0.20.3", + "darling_core 0.20.8", "quote", "syn 2.0.48", ] @@ -865,9 +865,9 @@ dependencies = [ [[package]] name = "extism" -version = "1.0.3" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5472dcd9d979ac3a094f1712dea48936a4ef7c35600184f89464c145c2e7dd1c" +checksum = "7360c0823a0e303eb0b5bdb1125a5dae0867a77bfc533bd7e306b5989a53aab6" dependencies = [ "anyhow", "cbindgen", @@ -878,7 +878,7 @@ dependencies = [ "serde", "serde_json", "sha2", - "toml 0.8.8", + "toml 0.8.10", "tracing", "tracing-subscriber", "ureq", @@ -890,24 +890,38 @@ dependencies = [ [[package]] name = "extism-convert" -version = "1.0.3" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "37b5889f52d54f53d540f4661af6122cb6443449a0c9111d5458383352aa2dda" +checksum = "8e78a2317936c20806cb60fa98c15dcc5ccf43458e4cbddad3c6cce17a05b31c" dependencies = [ "anyhow", "base64", "bytemuck", + "extism-convert-macros", "prost", "rmp-serde", "serde", "serde_json", ] +[[package]] +name = "extism-convert-macros" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d190cc0c058346b7750868de96dab17e047e7588ec91691a29b6db4eafd51a7e" +dependencies = [ + "manyhow", + "proc-macro-crate", + "proc-macro2", + "quote", + "syn 2.0.48", +] + [[package]] name = "extism-manifest" -version = "1.0.3" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e977dc7c7b75e819b184f35a67c4922e5b2a5424fbdc5c4188e74991b9c9e199" +checksum = "a08af46dc0633e0874e6c1a66ac1226bf2fad6fa67568538238af8b316569d06" dependencies = [ "base64", "serde", @@ -916,9 +930,9 @@ dependencies = [ [[package]] name = "extism-pdk" -version = "1.0.0" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38ac12d16e778ccf351f39a45efb65c0bbdb45bc9928c557507e808efafa51cf" +checksum = "1f9a87d636d30b75e697642dd4f6cff2054db5a7a5d69d6601041a76265bb681" dependencies = [ "anyhow", "base64", @@ -931,9 +945,9 @@ dependencies = [ [[package]] name = "extism-pdk-derive" -version = "1.0.0" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "61a79239414de9041626020530854cef77027a28d92bf542c7854e271101e9aa" +checksum = "d83995c2023720a0fd5ef2a349c89c1670efb37a979228b0218705f5ddb50d4b" dependencies = [ "proc-macro2", "quote", @@ -1128,9 +1142,9 @@ dependencies = [ [[package]] name = "garde" -version = "0.17.0" +version = "0.18.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0237d668ccb63fd96dff6a81c5f37b7d984872f9584794dc1d1a62472d2c7b57" +checksum = "d5fa8fb3ffe035745c6194540b2064b2fe275f32367fbb4eb026024b7921e2e5" dependencies = [ "compact_str", "garde_derive", @@ -1141,9 +1155,9 @@ dependencies = [ [[package]] name = "garde_derive" -version = "0.17.0" +version = "0.18.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4a42efb40be9de1926cfd15881ff08adb7a70c6cedacced425537c8b1f96ac4f" +checksum = "9cf62650515830c41553b72bd49ec20fb120226f9277c7f2847f071cf998325b" dependencies = [ "proc-macro2", "quote", @@ -1185,7 +1199,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4271d37baee1b8c7e4b708028c57d816cf9d2434acb33a549475f78c181f6253" dependencies = [ "fallible-iterator", - "indexmap 2.1.0", + "indexmap 2.2.3", "stable_deref_trait", ] @@ -1427,9 +1441,9 @@ dependencies = [ [[package]] name = "indexmap" -version = "2.1.0" +version = "2.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d530e1a18b1cb4c484e6e34556a0d948706958449fca0cab753d649f2bce3d1f" +checksum = "233cf39063f058ea2caae4091bf4a3ef70a653afbc026f5c4a4135d114e3c177" dependencies = [ "equivalent", "hashbrown 0.14.2", @@ -1491,22 +1505,11 @@ version = "2.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "28b29a3cd74f0f4598934efe3aeba42bae0eb4680554128851ebbecb02af14e6" -[[package]] -name = "is-terminal" -version = "0.4.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cb0889898416213fab133e1d33a0e5858a48177452750691bde3666d0fdbaf8b" -dependencies = [ - "hermit-abi", - "rustix 0.38.8", - "windows-sys 0.48.0", -] - [[package]] name = "is_ci" -version = "1.1.1" +version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "616cde7c720bb2bb5824a224687d8f77bfd38922027f01d825cd7453be5099fb" +checksum = "7655c9839580ee829dfacba1d1278c2b7883e50a277ff7541299489d6bdfdc45" [[package]] name = "itertools" @@ -1571,10 +1574,10 @@ dependencies = [ ] [[package]] -name = "json_comments" -version = "0.2.2" +name = "json-strip-comments" +version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9dbbfed4e59ba9750e15ba154fdfd9329cee16ff3df539c2666b70f58cc32105" +checksum = "c3d129799327c8f80861e467c59b825ba24c277dba6ad0d71a141dc98f9e04ee" [[package]] name = "lazy_static" @@ -1648,6 +1651,29 @@ dependencies = [ "libc", ] +[[package]] +name = "manyhow" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c8cd8783b626890c6e8124a894135b3bebca18af66a00f8e246dc378084d56e8" +dependencies = [ + "manyhow-macros", + "proc-macro2", + "quote", + "syn 2.0.48", +] + +[[package]] +name = "manyhow-macros" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "532aa12d5846b38a524b3acd99fb74dc8a5f193b33e65dac142ef92bd60f9416" +dependencies = [ + "proc-macro-utils", + "proc-macro2", + "quote", +] + [[package]] name = "matchers" version = "0.1.0" @@ -1689,21 +1715,20 @@ dependencies = [ [[package]] name = "miette" -version = "5.10.0" +version = "7.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "59bb584eaeeab6bd0226ccf3509a69d7936d148cf3d036ad350abe35e8c6856e" +checksum = "baed61d13cc3723ee6dbed730a82bfacedc60a85d81da2d77e9c3e8ebc0b504a" dependencies = [ "miette-derive", - "once_cell", "thiserror", "unicode-width", ] [[package]] name = "miette-derive" -version = "5.10.0" +version = "7.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49e7bc1560b95a3c4a25d03de42fe76ca718ab92d1a22a55b9b4cf67b3ae635c" +checksum = "f301c3f54f98abc6c212ee722f5e5c62e472a334415840669e356f04850051ec" dependencies = [ "proc-macro2", "quote", @@ -1821,7 +1846,7 @@ checksum = "a6a622008b6e321afc04970976f62ee297fdbaa6f95318ca343e3eebb9648441" dependencies = [ "crc32fast", "hashbrown 0.14.2", - "indexmap 2.1.0", + "indexmap 2.2.3", "memchr", ] @@ -1833,9 +1858,9 @@ checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" [[package]] name = "once_map" -version = "0.4.14" +version = "0.4.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f2d1d09016ea926b4a8c89938674322fca80bc139d605b21a574c0ce1000a19" +checksum = "0087372f82622a51024ad20d38a6901ba83d09de1e23ef15a621e4404dadbb7a" dependencies = [ "ahash", "hashbrown 0.14.2", @@ -1863,9 +1888,9 @@ checksum = "b15813163c1d831bf4a13c3610c05c0d03b39feb07f7e09fa234dac9b15aaf39" [[package]] name = "owo-colors" -version = "3.5.0" +version = "4.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c1b04fb49957986fdce4d6ee7a65027d55d4b6d2265e5848bbb507b58ccfdb6f" +checksum = "caff54706df99d2a78a5a4e3455ff45448d81ef1bb63c22cd14052ca0e993a3f" [[package]] name = "parking_lot" @@ -1937,14 +1962,13 @@ checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de" [[package]] name = "predicates" -version = "3.0.4" +version = "3.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6dfc28575c2e3f19cb3c73b93af36460ae898d426eba6fc15b9bd2a5220758a0" +checksum = "68b87bfd4605926cdfefc1c3b5f8fe560e3feca9d5552cf68c466d3d8236c7e8" dependencies = [ "anstyle", "difflib", "float-cmp", - "itertools 0.11.0", "normalize-line-endings", "predicates-core", "regex", @@ -1976,11 +2000,31 @@ dependencies = [ "yansi", ] +[[package]] +name = "proc-macro-crate" +version = "3.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6d37c51ca738a55da99dc0c4a34860fd675453b8b36209178c2249bb13651284" +dependencies = [ + "toml_edit 0.21.0", +] + +[[package]] +name = "proc-macro-utils" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f59e109e2f795a5070e69578c4dc101068139f74616778025ae1011d4cd41a8" +dependencies = [ + "proc-macro2", + "quote", + "smallvec", +] + [[package]] name = "proc-macro2" -version = "1.0.76" +version = "1.0.78" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "95fc56cda0b5c3325f5fbbd7ff9fda9e02bb00bb3dac51252d2f1bfa1cb8cc8c" +checksum = "e2422ad645d89c99f8f3e6b88a9fdeca7fabeac836b1002371c4367c8f984aae" dependencies = [ "unicode-ident", ] @@ -2010,13 +2054,13 @@ dependencies = [ [[package]] name = "proto_core" -version = "0.29.1" +version = "0.31.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "276b59495e6c7a4d7df813ddac9d6c21eb392c0d00f36c10e0988df00bebd11a" +checksum = "9901b14a4c9681199ae9a22e04374d14c03fc3c30608d64f844a14a2f44506ff" dependencies = [ "cached", "human-sort", - "indexmap 2.1.0", + "indexmap 2.2.3", "miette", "minisign-verify", "once_cell", @@ -2024,6 +2068,7 @@ dependencies = [ "proto_shim", "regex", "reqwest", + "rustc-hash", "schematic", "semver", "serde", @@ -2044,22 +2089,24 @@ dependencies = [ [[package]] name = "proto_pdk" -version = "0.15.1" +version = "0.17.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "caf90105b373875a194fda4b02e1a6f7be3d043976f27d6e85704070ed1cd7ca" +checksum = "d296af01babbdc7f81b493f99ba36aabb75407f6025a76ea3ed25b7fda77ca07" dependencies = [ "extism-pdk", "proto_pdk_api", + "rustc-hash", "serde", "warpgate_pdk", ] [[package]] name = "proto_pdk_api" -version = "0.15.1" +version = "0.17.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "54c4edbb65667fa05ad5a83c281c369bfd4243f66d08e1b8db8107753121eb81" +checksum = "de1e28d245d8af9d8dae9a77647beea080e6800224f8d2734495bf8176065b5a" dependencies = [ + "rustc-hash", "semver", "serde", "serde_json", @@ -2071,9 +2118,9 @@ dependencies = [ [[package]] name = "proto_pdk_test_utils" -version = "0.17.2" +version = "0.19.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e6117b549659d6c0425a932493918f8d5982d642757544c0bae619903cbe40f2" +checksum = "74a0f6b649e24d7eae82e8584771e7aa0838b0dacb217a910f954c0a794efda5" dependencies = [ "extism", "proto_core", @@ -2085,9 +2132,9 @@ dependencies = [ [[package]] name = "proto_shim" -version = "0.2.6" +version = "0.2.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9818ce0d6c81e911ef60f047b9e8befdab59a2aebda8fee7c54da8a7556ba0bc" +checksum = "2065b1e7c1bf5d1d590052f0e8457280a84584840abfcb0a52de96ecadd1897a" dependencies = [ "command-group", "dirs 5.0.1", @@ -2257,15 +2304,15 @@ checksum = "c08c74e62047bb2de4ff487b251e4a92e24f48745648451635cec7d591162d9f" [[package]] name = "relative-path" -version = "1.9.0" +version = "1.9.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c707298afce11da2efef2f600116fa93ffa7a032b5d7b628aa17711ec81383ca" +checksum = "e898588f33fdd5b9420719948f9f2a32c922a246964576f71ba7f24f80610fbc" [[package]] name = "reqwest" -version = "0.11.23" +version = "0.11.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "37b1ae8d9ac08420c66222fb9096fc5de435c3c48542bc5336c51892cffafb41" +checksum = "c6920094eb85afde5e4a138be3f2de8bbdf28000f0029e72c45025a56b042251" dependencies = [ "base64", "bytes", @@ -2290,6 +2337,7 @@ dependencies = [ "serde", "serde_json", "serde_urlencoded", + "sync_wrapper", "system-configuration", "tokio", "tokio-rustls", @@ -2340,7 +2388,7 @@ dependencies = [ [[package]] name = "rust_plugin" -version = "0.8.1" +version = "0.9.0" dependencies = [ "extism-pdk", "proto_pdk", @@ -2348,7 +2396,7 @@ dependencies = [ "serde", "starbase_sandbox", "tokio", - "toml 0.8.8", + "toml 0.8.10", ] [[package]] @@ -2477,12 +2525,12 @@ dependencies = [ [[package]] name = "schematic" -version = "0.13.5" +version = "0.14.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b264774063bdc7a16fe1158426b5a29604478d1c64da0b73cba396505329116" +checksum = "709e1f0b0a3db267a98da09c89a7818e307cc8daea841e1079eb5f5a02591d54" dependencies = [ "garde", - "indexmap 2.1.0", + "indexmap 2.2.3", "miette", "schematic_macros", "schematic_types", @@ -2490,18 +2538,18 @@ dependencies = [ "serde_path_to_error", "starbase_styles", "thiserror", - "toml 0.8.8", + "toml 0.8.10", "tracing", ] [[package]] name = "schematic_macros" -version = "0.13.4" +version = "0.14.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5362f20a1e2346fb9a7878261b27c8e1adf7872bf4201b7c018dfd3cd88e26a7" +checksum = "31af7347544d97d00870a5865d2077dac07c069a5290c26215ddd1138b302590" dependencies = [ "convert_case", - "darling 0.20.3", + "darling 0.20.8", "proc-macro2", "quote", "syn 2.0.48", @@ -2509,13 +2557,13 @@ dependencies = [ [[package]] name = "schematic_types" -version = "0.5.4" +version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1c90769caea1c16e71c756f7afe77a35620d61f77d3db4b834d246203f4ea44b" +checksum = "8f3adfbe1c90a6a9643433e490ef1605c6a99f93be37e4c83fe5149fca9698c6" dependencies = [ - "indexmap 2.1.0", + "indexmap 2.2.3", "serde_json", - "toml 0.8.8", + "toml 0.8.10", ] [[package]] @@ -2559,27 +2607,27 @@ dependencies = [ [[package]] name = "semver" -version = "1.0.21" +version = "1.0.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b97ed7a9823b74f99c7742f5336af7be5ecd3eeafcb1507d1fa93347b1d589b0" +checksum = "92d43fe69e652f3df9bdc2b85b2854a0825b86e4fb76bc44d945137d053639ca" dependencies = [ "serde", ] [[package]] name = "serde" -version = "1.0.195" +version = "1.0.197" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "63261df402c67811e9ac6def069e4786148c4563f4b50fd4bf30aa370d626b02" +checksum = "3fb1c873e1b9b056a4dc4c0c198b24c3ffa059243875552b2bd0933b1aee4ce2" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.195" +version = "1.0.197" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "46fe8f8603d81ba86327b23a2e9cdf49e1255fb94a4c5f297f6ee0547178ea2c" +checksum = "7eb0b34b42edc17f6b7cac84a52a1c5f0e1bb2227e997ca9011ea3dd34e8610b" dependencies = [ "proc-macro2", "quote", @@ -2588,9 +2636,9 @@ dependencies = [ [[package]] name = "serde_json" -version = "1.0.111" +version = "1.0.114" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "176e46fa42316f18edd598015a5166857fc835ec732f5215eac6b7bdbf0a84f4" +checksum = "c5f09b1bd632ef549eaa9f60a1f8de742bdbc698e6cee2095fc84dde5f549ae0" dependencies = [ "itoa", "ryu", @@ -2609,9 +2657,9 @@ dependencies = [ [[package]] name = "serde_spanned" -version = "0.6.4" +version = "0.6.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "12022b835073e5b11e90a14f86838ceb1c8fb0325b72416845c487ac0fa95e80" +checksum = "eb3622f419d1296904700073ea6cc23ad690adbd66f13ea683df73298736f0c1" dependencies = [ "serde", ] @@ -2739,9 +2787,9 @@ checksum = "a8f112729512f8e442d81f95a8a7ddf2b7c6b8a1a6f509a95864142b30cab2d3" [[package]] name = "starbase_archive" -version = "0.2.5" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b4a0d1c404d4e987597b018bee76fb8e79937f3b2ab0cf5963ce043031092694" +checksum = "a99a24e91bf823d46d04d520fb87c02ab0c3cac75bfdcf3c7671505681fd9f29" dependencies = [ "flate2", "miette", @@ -2758,9 +2806,9 @@ dependencies = [ [[package]] name = "starbase_events" -version = "0.2.2" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "455a107aab23fa941399ed716e42776ac8e200f5f92706b7ce59b08949aaf153" +checksum = "b98298edb3a2630bf96c6d422f91c617abda687e8a564f36fb4bc38cecbb7155" dependencies = [ "async-trait", "miette", @@ -2770,11 +2818,11 @@ dependencies = [ [[package]] name = "starbase_macros" -version = "0.2.7" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70da3be1ac772cd1cf5b71a725988b64829da92664b8fc362be765462c28638c" +checksum = "fb40eb09c82a8ddffa48a13d53bec72300b5626cb17f216d1fb4cf1b8a14f118" dependencies = [ - "darling 0.20.3", + "darling 0.20.8", "proc-macro2", "quote", "syn 2.0.48", @@ -2782,9 +2830,9 @@ dependencies = [ [[package]] name = "starbase_sandbox" -version = "0.1.13" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "74dc9bd92b3587c63cad2db7cb23c79b0d1d1a25b314990880a7a932f6f31e87" +checksum = "46c13185a91009f058c1649eb9692957e3e78398d98a89ed5fc9c3e24844e9c7" dependencies = [ "assert_cmd", "assert_fs", @@ -2798,9 +2846,9 @@ dependencies = [ [[package]] name = "starbase_styles" -version = "0.1.18" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aadf4bb3f99ac3782017aa75123781dd64de38b543469c6b9e96ca9f29fc4868" +checksum = "0e06fa37c027e48ef341787d8c3d26cfbe8507aa4e2e8c61fcba82fe931bb598" dependencies = [ "dirs 5.0.1", "owo-colors", @@ -2809,23 +2857,22 @@ dependencies = [ [[package]] name = "starbase_utils" -version = "0.3.11" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9af464d976956393070880234f8d9f3509f04555266174abfd9b11386cdce4bc" +checksum = "f23570a8fa500ad7ccb3bbfed7d9dc759b657ed536fb9b10eec729ad9de1b60e" dependencies = [ "dirs 5.0.1", "fs4", - "json_comments", + "json-strip-comments", "miette", "once_cell", - "regex", "relative-path", "serde", "serde_json", "starbase_styles", "thiserror", "tokio", - "toml 0.8.8", + "toml 0.8.10", "tracing", "wax", ] @@ -2844,11 +2891,10 @@ checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623" [[package]] name = "supports-color" -version = "2.1.0" +version = "3.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d6398cde53adc3c4557306a96ce67b302968513830a77a95b2b17305d9719a89" +checksum = "9829b314621dfc575df4e409e79f9d6a66a3bd707ab73f23cb4aa3a854ac854f" dependencies = [ - "is-terminal", "is_ci", ] @@ -2874,6 +2920,12 @@ dependencies = [ "unicode-ident", ] +[[package]] +name = "sync_wrapper" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2047c6ded9c721764247e62cd3b03c09ffc529b2ba5b10ec482ae507a4a70160" + [[package]] name = "system-configuration" version = "0.5.1" @@ -2913,9 +2965,9 @@ dependencies = [ [[package]] name = "system_env" -version = "0.2.0" +version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8dbaf08f70781cb6543bb0cce3d6b63a50cce05f4b071db833d78426f072ef7b" +checksum = "9cc6e061f286e270fa78c10406c3146455906149b684ae2dc15a3a758da16fda" dependencies = [ "schematic", "serde", @@ -2935,16 +2987,6 @@ dependencies = [ "xattr", ] -[[package]] -name = "tardar" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "900c942f83b6a8b9998cc8f74ad3ffa24b7ff3c4279ea1c1c52d95dced9f3516" -dependencies = [ - "miette", - "vec1", -] - [[package]] name = "target-lexicon" version = "0.12.10" @@ -2972,18 +3014,18 @@ checksum = "3369f5ac52d5eb6ab48c6b4ffdc8efbcad6b89c765749064ba298f2c68a16a76" [[package]] name = "thiserror" -version = "1.0.56" +version = "1.0.57" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d54378c645627613241d077a3a79db965db602882668f9136ac42af9ecb730ad" +checksum = "1e45bcbe8ed29775f228095caf2cd67af7a4ccf756ebff23a306bf3e8b47b24b" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.56" +version = "1.0.57" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fa0faa943b50f3db30a20aa7e265dbc66076993efed8463e8de414e5d06d3471" +checksum = "a953cb265bef375dae3de6663da4d3804eee9682ea80d8e2542529b73c531c81" dependencies = [ "proc-macro2", "quote", @@ -3017,9 +3059,9 @@ checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" [[package]] name = "tokio" -version = "1.35.1" +version = "1.36.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c89b4efa943be685f629b149f53829423f8f5531ea21249408e8e2f8671ec104" +checksum = "61285f6515fa018fb2d1e46eb21223fff441ee8db5d0f1435e8ab4f5cdb80931" dependencies = [ "backtrace", "bytes", @@ -3080,14 +3122,14 @@ dependencies = [ [[package]] name = "toml" -version = "0.8.8" +version = "0.8.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1a195ec8c9da26928f773888e0742ca3ca1040c6cd859c919c9f59c1954ab35" +checksum = "9a9aad4a3066010876e8dcf5a8a06e70a558751117a145c6ce2b82c2e2054290" dependencies = [ "serde", "serde_spanned", "toml_datetime", - "toml_edit", + "toml_edit 0.22.6", ] [[package]] @@ -3105,11 +3147,22 @@ version = "0.21.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d34d383cd00a163b4a5b85053df514d45bc330f6de7737edfe0a93311d1eaa03" dependencies = [ - "indexmap 2.1.0", + "indexmap 2.2.3", + "toml_datetime", + "winnow 0.5.1", +] + +[[package]] +name = "toml_edit" +version = "0.22.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2c1b5fd4128cc8d3e0cb74d4ed9a9cc7c7284becd4df68f5f940e1ad123606f6" +dependencies = [ + "indexmap 2.2.3", "serde", "serde_spanned", "toml_datetime", - "winnow", + "winnow 0.6.3", ] [[package]] @@ -3221,9 +3274,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" @@ -3279,12 +3332,6 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "830b7e5d4d90034032940e4ace0d9a9a057e7a45cd94e6c007832e39edb82f6d" -[[package]] -name = "vec1" -version = "1.10.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2bda7c41ca331fe9a1c278a9e7ee055f4be7f5eb1c2b72f079b4ff8b5fce9d5c" - [[package]] name = "version_check" version = "0.9.4" @@ -3293,9 +3340,9 @@ checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" [[package]] name = "version_spec" -version = "0.2.0" +version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "28f9327e7b3c0554ec9291491b8e16bf693d35ea18ba4173efbcf2e76078c91f" +checksum = "a81a98a1dd2c4d6f994f4e217029fcc64f3811769ed8e8b9edaabb0cd0c31f3d" dependencies = [ "human-sort", "regex", @@ -3334,9 +3381,9 @@ dependencies = [ [[package]] name = "warpgate" -version = "0.10.2" +version = "0.11.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3226aa23973b00283aa7955385a902ea1c4f60b0a5d43533bcc937f6eebd0a07" +checksum = "fbe4df5f206fe3d93a15297673412dbba41ced8579e7167f0cfcb04289b966e1" dependencies = [ "extism", "miette", @@ -3344,6 +3391,7 @@ dependencies = [ "once_map", "regex", "reqwest", + "rustc-hash", "schematic", "serde", "serde_json", @@ -3359,22 +3407,24 @@ dependencies = [ [[package]] name = "warpgate_api" -version = "0.3.1" +version = "0.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "17eca79a6da0046450f09d55829eb53284e727d3d539f076c19754e81db6d236" +checksum = "7df14416cdd0aa47c75b5cb6b9138781e05cc99cb99954322412ac003011e4b1" dependencies = [ "anyhow", + "rustc-hash", "schematic", "serde", "serde_json", "system_env", + "thiserror", ] [[package]] name = "warpgate_pdk" -version = "0.1.0" +version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3e54d60b8fe7d4d20f74cea816ee5d761c3bedd796bc00a87c19828b85802b5e" +checksum = "816f8e749c69c800012a61db8a3b29bc08804695f9b6b558737fe1e870df5c83" dependencies = [ "extism-pdk", "serde", @@ -3520,7 +3570,7 @@ version = "0.115.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e06c0641a4add879ba71ccb3a1e4278fd546f76f1eafb21d8f7b07733b547cd5" dependencies = [ - "indexmap 2.1.0", + "indexmap 2.2.3", "semver", ] @@ -3530,7 +3580,7 @@ version = "0.118.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "95ee9723b928e735d53000dec9eae7b07a60e490c85ab54abb66659fc61bfcd9" dependencies = [ - "indexmap 2.1.0", + "indexmap 2.2.3", "semver", ] @@ -3557,7 +3607,7 @@ dependencies = [ "cfg-if", "encoding_rs", "fxprof-processed-profile", - "indexmap 2.1.0", + "indexmap 2.2.3", "libc", "log", "object 0.32.2", @@ -3684,7 +3734,7 @@ dependencies = [ "anyhow", "cranelift-entity", "gimli 0.28.1", - "indexmap 2.1.0", + "indexmap 2.2.3", "log", "object 0.32.2", "serde", @@ -3772,7 +3822,7 @@ dependencies = [ "cc", "cfg-if", "encoding_rs", - "indexmap 2.1.0", + "indexmap 2.2.3", "libc", "log", "mach", @@ -3876,7 +3926,7 @@ checksum = "9d214ca7513d76af2872ad5bba4b0dcc0225821931745fdcb4fc30dd34bc3bf7" dependencies = [ "anyhow", "heck", - "indexmap 2.1.0", + "indexmap 2.2.3", "wit-parser", ] @@ -3924,11 +3974,9 @@ checksum = "8d12a78aa0bab22d2f26ed1a96df7ab58e8a93506a3e20adb47c51a93b4e1357" dependencies = [ "const_format", "itertools 0.11.0", - "miette", "nom", "pori", "regex", - "tardar", "thiserror", "walkdir", ] @@ -4257,6 +4305,15 @@ dependencies = [ "memchr", ] +[[package]] +name = "winnow" +version = "0.6.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "44e19b97e00a4d3db3cdb9b53c8c5f87151b5689b82cc86c2848cbdcccb2689b" +dependencies = [ + "memchr", +] + [[package]] name = "winreg" version = "0.50.0" @@ -4285,7 +4342,7 @@ checksum = "43771ee863a16ec4ecf9da0fc65c3bbd4a1235c8e3da5f094b562894843dfa76" dependencies = [ "anyhow", "id-arena", - "indexmap 2.1.0", + "indexmap 2.2.3", "log", "semver", "serde", diff --git a/Cargo.toml b/Cargo.toml index 00e8b0f..f270095 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "rust_plugin" -version = "0.8.1" +version = "0.9.0" edition = "2021" license = "MIT" publish = false @@ -9,15 +9,15 @@ publish = false crate-type = ['cdylib'] [dependencies] -extism-pdk = { version = "1.0.0" } -proto_pdk = { version = "0.15.1" } #, path = "../../proto/crates/pdk" } -serde = "1.0.195" -toml = "0.8.8" +extism-pdk = { version = "1.1.0" } +proto_pdk = { version = "0.17.3" } #, path = "../../proto/crates/pdk" } +serde = "1.0.197" +toml = { version = "0.8.10", default-features = false, features = ["parse"] } [dev-dependencies] -proto_pdk_test_utils = { version = "0.17.2" } #, path = "../../proto/crates/pdk-test-utils" } -starbase_sandbox = "0.1.13" -tokio = { version = "1.35.1", features = ["full"] } +proto_pdk_test_utils = { version = "0.19.6" } #, path = "../../proto/crates/pdk-test-utils" } +starbase_sandbox = "0.4.0" +tokio = { version = "1.36.0", features = ["full"] } [features] default = ["wasm"] diff --git a/rust-toolchain.toml b/rust-toolchain.toml index 93c4cba..51b24ee 100644 --- a/rust-toolchain.toml +++ b/rust-toolchain.toml @@ -1,3 +1,3 @@ [toolchain] profile = "default" -channel = "1.75.0" +channel = "1.76.0" diff --git a/src/helpers.rs b/src/helpers.rs index 46457ce..a522048 100644 --- a/src/helpers.rs +++ b/src/helpers.rs @@ -8,11 +8,17 @@ extern "ExtismHost" { } pub fn get_rustup_home(env: &HostEnvironment) -> Result { + // Cargo sets the RUSTUP_HOME env var when running tests, + // which causes a ton of issues, so intercept it here! + if let Some(test_env) = get_test_environment()? { + return Ok(test_env.sandbox.join(".home/.rustup")); + } + // Variable returns a real path Ok(host_env!("RUSTUP_HOME") .map(PathBuf::from) // So we need our fallback to also be a real path - .unwrap_or_else(|| env.home_dir.real_path().join(".rustup"))) + .unwrap_or_else(|| env.home_dir.real_path().unwrap().join(".rustup"))) } pub fn get_channel_from_version(spec: &VersionSpec) -> String { diff --git a/src/proto.rs b/src/proto.rs index 4540fbd..ec2b08f 100644 --- a/src/proto.rs +++ b/src/proto.rs @@ -234,24 +234,6 @@ pub fn locate_executables( })) } -#[plugin_fn] -pub fn install_global( - Json(input): Json, -) -> FnResult> { - let result = exec_command!(inherit, "cargo", ["install", "--force", &input.dependency]); - - Ok(Json(InstallGlobalOutput::from_exec_command(result))) -} - -#[plugin_fn] -pub fn uninstall_global( - Json(input): Json, -) -> FnResult> { - let result = exec_command!(inherit, "cargo", ["uninstall", &input.dependency]); - - Ok(Json(UninstallGlobalOutput::from_exec_command(result))) -} - #[plugin_fn] pub fn sync_manifest(Json(_): Json) -> FnResult> { let env = get_host_environment()?; diff --git a/tests/download_test.rs b/tests/download_test.rs index 5be632e..ddfddee 100644 --- a/tests/download_test.rs +++ b/tests/download_test.rs @@ -11,7 +11,11 @@ fn locates_linux_bin() { let plugin = create_plugin_with_config( "rust-test", sandbox.path(), - HashMap::from_iter([map_config_environment(HostOS::Linux, HostArch::Arm64)]), + HashMap::from_iter([map_config_environment_with_home( + HostOS::Linux, + HostArch::Arm64, + sandbox.path().join(".home"), + )]), ); assert_eq!( @@ -35,7 +39,11 @@ fn locates_macos_bin() { let plugin = create_plugin_with_config( "rust-test", sandbox.path(), - HashMap::from_iter([map_config_environment(HostOS::MacOS, HostArch::X64)]), + HashMap::from_iter([map_config_environment_with_home( + HostOS::MacOS, + HostArch::X64, + sandbox.path().join(".home"), + )]), ); assert_eq!( @@ -59,7 +67,11 @@ fn locates_windows_bin() { let plugin = create_plugin_with_config( "rust-test", sandbox.path(), - HashMap::from_iter([map_config_environment(HostOS::Windows, HostArch::X86)]), + HashMap::from_iter([map_config_environment_with_home( + HostOS::Windows, + HostArch::X86, + sandbox.path().join(".home"), + )]), ); assert_eq!(