From 9b049ed5524ea51aa2ca400ed21afef69515fec2 Mon Sep 17 00:00:00 2001 From: jdx <216188+jdx@users.noreply.github.com> Date: Mon, 9 Dec 2024 09:23:04 -0600 Subject: [PATCH] bump to miette-7 (#21) --- Cargo.lock | 109 +++++++++++++++++++--------------------- cli/Cargo.toml | 6 +-- lib/Cargo.toml | 6 +-- lib/src/error.rs | 8 +-- lib/src/spec/helpers.rs | 4 +- mise.lock | 1 + 6 files changed, 67 insertions(+), 67 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 117d5cb..3208f2f 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -466,6 +466,16 @@ dependencies = [ "winapi", ] +[[package]] +name = "errno" +version = "0.3.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "33d852cb9b869c2a9b3df2f71a3074817f01e1844f839a144f5fcef059a4eb5d" +dependencies = [ + "libc", + "windows-sys 0.59.0", +] + [[package]] name = "errno-dragonfly" version = "0.1.2" @@ -482,7 +492,7 @@ version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "886b70328cba8871bfc025858e1de4be16b1d5088f2ba50b57816f4210672615" dependencies = [ - "errno", + "errno 0.2.8", "libc", ] @@ -570,12 +580,6 @@ version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea" -[[package]] -name = "hermit-abi" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fbf6a919d6cf397374f7dfeeea91d974c7c0a7221d0d0f4f20d859d329e53fcc" - [[package]] name = "homedir" version = "0.3.4" @@ -665,17 +669,6 @@ dependencies = [ "similar", ] -[[package]] -name = "is-terminal" -version = "0.4.13" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "261f68e344040fbd0edea105bef17c66edf46f984ddb1115b775ce31be948f4b" -dependencies = [ - "hermit-abi", - "libc", - "windows-sys 0.52.0", -] - [[package]] name = "is_ci" version = "1.2.0" @@ -715,9 +708,9 @@ dependencies = [ [[package]] name = "kdl" -version = "4.6.0" +version = "4.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "062c875482ccb676fd40c804a40e3824d4464c18c364547456d1c8e8e951ae47" +checksum = "3a18038fbecda667e7ea2101bdd02af754da5e17ca2887a7649b8f3fa809d8b8" dependencies = [ "miette", "nom", @@ -759,6 +752,12 @@ version = "0.5.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0717cef1bc8b636c6e1c1bbdefc09e6322da8a9321966e8928ef80d20f7f770f" +[[package]] +name = "linux-raw-sys" +version = "0.4.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "78b3ae25bc7c8c38cec158d1f2757ee79e9b3740fbc7ccf0e59e4b08d793fa89" + [[package]] name = "log" version = "0.4.22" @@ -773,15 +772,14 @@ checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3" [[package]] name = "miette" -version = "5.10.0" +version = "7.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "59bb584eaeeab6bd0226ccf3509a69d7936d148cf3d036ad350abe35e8c6856e" +checksum = "317f146e2eb7021892722af37cf1b971f0a70c8406f487e24952667616192c64" dependencies = [ "backtrace", "backtrace-ext", - "is-terminal", + "cfg-if", "miette-derive", - "once_cell", "owo-colors", "supports-color", "supports-hyperlinks", @@ -794,9 +792,9 @@ dependencies = [ [[package]] name = "miette-derive" -version = "5.10.0" +version = "7.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49e7bc1560b95a3c4a25d03de42fe76ca718ab92d1a22a55b9b4cf67b3ae635c" +checksum = "23c9b935fbe1d6cbd1dac857b54a688145e2d93f48db36010514d0f612d0ad67" dependencies = [ "proc-macro2", "quote", @@ -882,9 +880,9 @@ dependencies = [ [[package]] name = "owo-colors" -version = "3.5.0" +version = "4.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c1b04fb49957986fdce4d6ee7a65027d55d4b6d2265e5848bbb507b58ccfdb6f" +checksum = "fb37767f6569cd834a413442455e0f066d0d522de8630436e2a1761d9726ba56" [[package]] name = "parse-zoneinfo" @@ -1125,6 +1123,19 @@ version = "0.1.24" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "719b953e2095829ee67db738b3bfa9fa368c94900df327b3f07fe6e794d2fe1f" +[[package]] +name = "rustix" +version = "0.38.42" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f93dc38ecbab2eb790ff964bb77fa94faf256fd3e73285fd7ba0903b76bedb85" +dependencies = [ + "bitflags", + "errno 0.3.10", + "libc", + "linux-raw-sys", + "windows-sys 0.59.0", +] + [[package]] name = "rustversion" version = "1.0.18" @@ -1233,12 +1244,6 @@ dependencies = [ "wasm-bindgen", ] -[[package]] -name = "smawk" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b7c388c1b5e93756d0c740965c41e8822f866621d41acbdf6336a6a168f8840c" - [[package]] name = "strsim" version = "0.11.1" @@ -1269,31 +1274,24 @@ dependencies = [ [[package]] name = "supports-color" -version = "2.1.0" +version = "3.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d6398cde53adc3c4557306a96ce67b302968513830a77a95b2b17305d9719a89" +checksum = "c64fc7232dd8d2e4ac5ce4ef302b1d81e0b80d055b9d77c7c4f51f6aa4c867d6" dependencies = [ - "is-terminal", "is_ci", ] [[package]] name = "supports-hyperlinks" -version = "2.1.0" +version = "3.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f84231692eb0d4d41e4cdd0cabfdd2e6cd9e255e65f80c9aa7c98dd502b4233d" -dependencies = [ - "is-terminal", -] +checksum = "804f44ed3c63152de6a9f90acbea1a110441de43006ea51bcce8f436196a288b" [[package]] name = "supports-unicode" -version = "2.1.0" +version = "3.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f850c19edd184a205e883199a261ed44471c81e39bd95b1357f5febbef00e77a" -dependencies = [ - "is-terminal", -] +checksum = "b7401a30af6cb5818bb64852270bb722533397edcfc7344954a38f420819ece2" [[package]] name = "syn" @@ -1341,12 +1339,12 @@ dependencies = [ [[package]] name = "terminal_size" -version = "0.1.17" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "633c1a546cee861a1a6d0dc69ebeca693bf4296661ba7852b9d21d159e0506df" +checksum = "5352447f921fda68cf61b4101566c0bdb5104eff6804d0678e5227580ab6a4e9" dependencies = [ - "libc", - "winapi", + "rustix", + "windows-sys 0.59.0", ] [[package]] @@ -1357,11 +1355,10 @@ checksum = "3369f5ac52d5eb6ab48c6b4ffdc8efbcad6b89c765749064ba298f2c68a16a76" [[package]] name = "textwrap" -version = "0.15.2" +version = "0.16.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b7b3e525a49ec206798b40326a44121291b530c963cfb01018f63e135bac543d" +checksum = "23d434d3f8967a09480fb04132ebe0a3e088c173e6d0ee7897abbdf4eab0f8b9" dependencies = [ - "smawk", "unicode-linebreak", "unicode-width", ] @@ -1825,9 +1822,9 @@ checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" [[package]] name = "xx" -version = "1.1.9" +version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf77a847b8a88b00563bb61a1041c90a8697bc23f0382eb1ecbe852098df351c" +checksum = "f2c507cfdc3944bf23d0ef0fc39894bd05b566828bb961dbd1dc42e013d99f99" dependencies = [ "duct", "filetime", diff --git a/cli/Cargo.toml b/cli/Cargo.toml index aadbf00..b192918 100644 --- a/cli/Cargo.toml +++ b/cli/Cargo.toml @@ -33,9 +33,9 @@ exec = "0.3" heck = "0.5" indexmap = "2" itertools = "0.13" -kdl = "<4.7" +kdl = "4" log = "0.4" -miette = { version = "5", features = ["fancy"] } +miette = { version = "7", features = ["fancy"] } once_cell = "1" regex = "1" serde = { version = "1", features = ["derive"] } @@ -44,7 +44,7 @@ strum = { version = "0.26", features = ["derive"] } tera = "1" thiserror = "2" usage-lib = { workspace = true, features = ["clap", "docs"] } -xx = "1" +xx = "2" [dev-dependencies] assert_cmd = { version = "2", features = ["color-auto"] } diff --git a/lib/Cargo.toml b/lib/Cargo.toml index efe7ec9..5eaef53 100644 --- a/lib/Cargo.toml +++ b/lib/Cargo.toml @@ -25,9 +25,9 @@ clap = { version = "4", features = ["derive", "string"], optional = true } heck = "0.5" indexmap = { version = "2", features = ["serde"] } itertools = "0.13" -kdl = "<4.7" +kdl = "4" log = "0.4" -miette = "5" +miette = "7" once_cell = "1" regex = "1" serde = { version = "1", features = ["derive"] } @@ -35,7 +35,7 @@ strum = { version = "0.26", features = ["derive"] } tera = { version = "1", optional = true } thiserror = "2" versions = "6" -xx = "1" +xx = "2" [features] default = ["docs"] diff --git a/lib/src/error.rs b/lib/src/error.rs index 89671cc..e02427d 100644 --- a/lib/src/error.rs +++ b/lib/src/error.rs @@ -13,7 +13,7 @@ pub enum UsageErr { InvalidInput( String, #[label = "{0}"] SourceSpan, - #[source_code] NamedSource, + #[source_code] NamedSource, ), #[error("Missing required arg: <{0}>")] @@ -52,13 +52,15 @@ pub type Result = std::result::Result; #[macro_export] macro_rules! bail_parse { ($ctx:expr, $span:expr, $fmt:literal) => {{ + let span: miette::SourceSpan = ($span.offset(), $span.len()).into(); let msg = format!($fmt); - let err = $ctx.build_err(msg, $span); + let err = $ctx.build_err(msg, span); return std::result::Result::Err(err); }}; ($ctx:expr, $span:expr, $fmt:literal, $($arg:tt)*) => {{ + let span: miette::SourceSpan = ($span.offset(), $span.len()).into(); let msg = format!($fmt, $($arg)*); - let err = $ctx.build_err(msg, $span); + let err = $ctx.build_err(msg, span); return std::result::Result::Err(err); }}; } diff --git a/lib/src/spec/helpers.rs b/lib/src/spec/helpers.rs index e8a2df2..818f2da 100644 --- a/lib/src/spec/helpers.rs +++ b/lib/src/spec/helpers.rs @@ -22,7 +22,7 @@ impl<'a> NodeHelper<'a> { self.node.name().value() } pub(crate) fn span(&self) -> SourceSpan { - *self.node.span() + (self.node.span().offset(), self.node.span().len()).into() } pub(crate) fn ensure_arg_len(&self, range: R) -> Result<&Self, UsageErr> where @@ -92,7 +92,7 @@ impl<'a> ParseEntry<'a> { } fn span(&self) -> SourceSpan { - *self.entry.span() + (self.entry.span().offset(), self.entry.span().len()).into() } } diff --git a/mise.lock b/mise.lock index 47a3fab..d863954 100644 --- a/mise.lock +++ b/mise.lock @@ -5,6 +5,7 @@ version = "1.7.4" version = "1.10.8" [tools.cargo-binstall.checksums] +"cargo-binstall-aarch64-apple-darwin.zip" = "sha256:23a27d534c98fed95e88c320fd7de154f851af7bce9100eed15e72fee316804c" cargo-binstall-macos-aarch64 = "sha256:c30a499060745f0c4435a446253fc676838cff0a18d2dd555fcf10399176b1bf" [tools."cargo:cargo-edit"]