From 492f0567ecb14443afe2c4116976898b66b27e71 Mon Sep 17 00:00:00 2001 From: Steve Lee Date: Mon, 9 Dec 2024 10:54:06 -0800 Subject: [PATCH 1/2] Update version to `preview.12` and updates crate versions --- dsc/Cargo.lock | 127 ++++++++++++++++++++++++++++++------- dsc/Cargo.toml | 11 ++-- dsc/src/main.rs | 2 +- dsc/src/util.rs | 6 +- runcommandonset/Cargo.lock | 12 ++-- 5 files changed, 118 insertions(+), 40 deletions(-) diff --git a/dsc/Cargo.lock b/dsc/Cargo.lock index a4f4b1f1..45a56a51 100644 --- a/dsc/Cargo.lock +++ b/dsc/Cargo.lock @@ -1,6 +1,6 @@ # This file is automatically @generated by Cargo. # It is not intended for manual editing. -version = 3 +version = 4 [[package]] name = "addr2line" @@ -158,7 +158,16 @@ version = "0.5.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0700ddab506f33b20a03b13996eccd309a48e5ff77d0d95926aa0210fb4e95f1" dependencies = [ - "bit-vec", + "bit-vec 0.6.3", +] + +[[package]] +name = "bit-set" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "08807e080ed7f9d5433fa9b275196cfc35414f66a0c79d864dc51a0d825231a3" +dependencies = [ + "bit-vec 0.8.0", ] [[package]] @@ -167,6 +176,12 @@ version = "0.6.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "349f9b6a179ed607305526ca489b34ad0a41aed5f7980fa90eb03160b69598fb" +[[package]] +name = "bit-vec" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5e764a1d40d510daf35e07be9eb06e75770908c27d411ee6c92109c9840eaaf7" + [[package]] name = "bitflags" version = "1.3.2" @@ -469,7 +484,7 @@ dependencies = [ [[package]] name = "dsc" -version = "3.1.0-preview.1" +version = "3.0.0-preview.12" dependencies = [ "clap", "clap_complete", @@ -477,7 +492,7 @@ dependencies = [ "ctrlc", "dsc_lib", "indicatif", - "jsonschema", + "jsonschema 0.26.1", "path-absolutize", "schemars", "serde", @@ -485,7 +500,7 @@ dependencies = [ "serde_yaml", "syntect", "sysinfo", - "thiserror", + "thiserror 2.0.6", "tracing", "tracing-indicatif", "tracing-subscriber", @@ -501,7 +516,7 @@ dependencies = [ "clap", "derive_builder", "indicatif", - "jsonschema", + "jsonschema 0.23.0", "linked-hash-map", "num-traits", "regex", @@ -511,7 +526,7 @@ dependencies = [ "serde", "serde_json", "serde_yaml", - "thiserror", + "thiserror 1.0.64", "tokio", "tracing", "tracing-indicatif", @@ -569,7 +584,7 @@ version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b95f7c0680e4142284cf8b22c14a476e87d61b004a3a0861872b32ef7ead40a2" dependencies = [ - "bit-set", + "bit-set 0.5.3", "regex", ] @@ -579,7 +594,18 @@ version = "0.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "531e46835a22af56d1e3b66f04844bed63158bc094a628bec1d321d9b4c44bf2" dependencies = [ - "bit-set", + "bit-set 0.5.3", + "regex-automata 0.4.8", + "regex-syntax 0.8.5", +] + +[[package]] +name = "fancy-regex" +version = "0.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6e24cb5a94bcae1e5408b0effca5cd7172ea3c5755049c5f3af4cd283a165298" +dependencies = [ + "bit-set 0.8.0", "regex-automata 0.4.8", "regex-syntax 0.8.5", ] @@ -596,9 +622,9 @@ dependencies = [ [[package]] name = "fluent-uri" -version = "0.3.1" +version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b7bd399b64ddd63a83cf40512c96007dafe9ac26cfc8c89c820a247c6f7d2376" +checksum = "1918b65d96df47d3591bed19c5cca17e3fa5d0707318e4b5ef2eae01764df7e5" dependencies = [ "borrow-or-share", "ref-cast", @@ -932,7 +958,7 @@ dependencies = [ "num-cmp", "once_cell", "percent-encoding", - "referencing", + "referencing 0.23.0", "regex-syntax 0.8.5", "serde", "serde_json", @@ -940,6 +966,30 @@ dependencies = [ "uuid-simd", ] +[[package]] +name = "jsonschema" +version = "0.26.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "893d6229c7315763ca0df9b29ab7661ee419f286577a02847c5521b462e071af" +dependencies = [ + "ahash", + "base64", + "bytecount", + "email_address", + "fancy-regex 0.14.0", + "fraction", + "idna 1.0.2", + "itoa", + "num-cmp", + "once_cell", + "percent-encoding", + "referencing 0.26.1", + "regex-syntax 0.8.5", + "serde", + "serde_json", + "uuid-simd", +] + [[package]] name = "lazy_static" version = "1.5.0" @@ -948,9 +998,9 @@ checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe" [[package]] name = "libc" -version = "0.2.159" +version = "0.2.168" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "561d97a539a36e26a9a5fad1ea11a3039a67714694aaa379433e580854bc3dc5" +checksum = "5aaeb2981e0606ca11d79718f8bb01164f1d6ed75080182d3abf017e6d244b6d" [[package]] name = "linked-hash-map" @@ -1252,9 +1302,9 @@ checksum = "439ee305def115ba05938db6eb1644ff94165c5ab5e9420d1c1bcedbba909391" [[package]] name = "proc-macro2" -version = "1.0.87" +version = "1.0.92" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b3e4daa0dcf6feba26f985457cdf104d4b4256fc5a09547140f3631bb076b19a" +checksum = "37d3544b3f2748c54e147655edb5025752e2303145b5aefb3c3ea2c78b973bb0" dependencies = [ "unicode-ident", ] @@ -1339,6 +1389,19 @@ dependencies = [ "serde_json", ] +[[package]] +name = "referencing" +version = "0.26.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eb853437e467c693ac1dc8c1520105a31b8c2588544ff2f3cfa5a7c706c6c069" +dependencies = [ + "ahash", + "fluent-uri", + "once_cell", + "percent-encoding", + "serde_json", +] + [[package]] name = "regex" version = "1.11.0" @@ -1600,9 +1663,9 @@ checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f" [[package]] name = "syn" -version = "2.0.79" +version = "2.0.90" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "89132cd0bf050864e1d38dc3bbc07a0eb8e7530af26344d3d2bbbef83499f590" +checksum = "919d3b74a5dd0ccd15aeb8f93e7006bd9e14c295087c9896a110f490752bcf31" dependencies = [ "proc-macro2", "quote", @@ -1637,16 +1700,16 @@ dependencies = [ "serde", "serde_derive", "serde_json", - "thiserror", + "thiserror 1.0.64", "walkdir", "yaml-rust", ] [[package]] name = "sysinfo" -version = "0.32.0" +version = "0.33.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e3b5ae3f4f7d64646c46c4cae4e3f01d1c5d255c7406fdd7c7f999a94e488791" +checksum = "948512566b1895f93b1592c7574baeb2de842f224f2aab158799ecadb8ebbb46" dependencies = [ "core-foundation-sys", "libc", @@ -1662,7 +1725,16 @@ version = "1.0.64" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d50af8abc119fb8bb6dbabcfa89656f46f84aa0ac7688088608076ad2b459a84" dependencies = [ - "thiserror-impl", + "thiserror-impl 1.0.64", +] + +[[package]] +name = "thiserror" +version = "2.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8fec2a1820ebd077e2b90c4df007bebf344cd394098a13c563957d0afc83ea47" +dependencies = [ + "thiserror-impl 2.0.6", ] [[package]] @@ -1676,6 +1748,17 @@ dependencies = [ "syn", ] +[[package]] +name = "thiserror-impl" +version = "2.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d65750cab40f4ff1929fb1ba509e9914eb756131cef4210da8d5d700d26f6312" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + [[package]] name = "thread_local" version = "1.1.8" diff --git a/dsc/Cargo.toml b/dsc/Cargo.toml index 8523f2e0..97c53e9b 100644 --- a/dsc/Cargo.toml +++ b/dsc/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "dsc" -version = "3.1.0-preview.1" +version = "3.0.0-preview.12" edition = "2021" [profile.release] @@ -17,16 +17,15 @@ crossterm = { version = "0.28" } ctrlc = { version = "3.4" } dsc_lib = { path = "../dsc_lib" } indicatif = { version = "0.17" } -jsonschema = { version = "0.23", default-features = false } +jsonschema = { version = "0.26", default-features = false } path-absolutize = { version = "3.1" } -# reqwest = { version = "0.12.8", features = ["native-tls"], default-features = false } schemars = { version = "0.8" } serde = { version = "1.0", features = ["derive"] } serde_json = { version = "1.0", features = ["preserve_order"] } serde_yaml = { version = "0.9" } syntect = { version = "5.0", features = ["default-fancy"], default-features = false } -sysinfo = { version = "0.32" } -thiserror = "1.0" -tracing = { version = "0.1.37" } +sysinfo = { version = "0.33" } +thiserror = "2.0" +tracing = { version = "0.1" } tracing-subscriber = { version = "0.3", features = ["ansi", "env-filter", "json"] } tracing-indicatif = { version = "0.3" } diff --git a/dsc/src/main.rs b/dsc/src/main.rs index ac7bfc2b..93ba0fdc 100644 --- a/dsc/src/main.rs +++ b/dsc/src/main.rs @@ -81,7 +81,7 @@ fn ctrlc_handler() { warn!("Ctrl-C received"); // get process tree for current process and terminate all processes - let sys = System::new_with_specifics(RefreshKind::new().with_processes(ProcessRefreshKind::new())); + let sys = System::new_with_specifics(RefreshKind::nothing().with_processes(ProcessRefreshKind::everything())); info!("Found {} processes", sys.processes().len()); let Ok(current_pid) = get_current_pid() else { error!("Could not get current process id"); diff --git a/dsc/src/util.rs b/dsc/src/util.rs index 4949a28a..4d2f89a2 100644 --- a/dsc/src/util.rs +++ b/dsc/src/util.rs @@ -443,11 +443,7 @@ pub fn validate_json(source: &str, schema: &Value, json: &Value) -> Result<(), D }; if let Err(err) = compiled_schema.validate(json) { - let mut error = format!("'{source}' failed validation: "); - for e in err { - error.push_str(&format!("\n{e} ")); - } - return Err(DscError::Validation(error)); + return Err(DscError::Validation(format!("'{source}' failed validation: {err}"))); }; Ok(()) diff --git a/runcommandonset/Cargo.lock b/runcommandonset/Cargo.lock index 0b82a3a9..90649bba 100644 --- a/runcommandonset/Cargo.lock +++ b/runcommandonset/Cargo.lock @@ -195,9 +195,9 @@ dependencies = [ [[package]] name = "fastrand" -version = "2.2.0" +version = "2.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "486f806e73c5707928240ddc295403b1b93c96a02038563881c4a2fd84b81ac4" +checksum = "37909eebbb50d72f9059c3b6d82c0463f2ff062c9e95845c43a6c9c0355411be" [[package]] name = "glob" @@ -296,9 +296,9 @@ checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe" [[package]] name = "libc" -version = "0.2.167" +version = "0.2.168" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "09d6582e104315a817dff97f75133544b2e094ee22447d2acf4a74e189ba06fc" +checksum = "5aaeb2981e0606ca11d79718f8bb01164f1d6ed75080182d3abf017e6d244b6d" [[package]] name = "libyml" @@ -500,9 +500,9 @@ dependencies = [ [[package]] name = "rustix" -version = "0.38.41" +version = "0.38.42" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d7f649912bc1495e167a6edee79151c84b1bad49748cb4f1f1167f459f6224f6" +checksum = "f93dc38ecbab2eb790ff964bb77fa94faf256fd3e73285fd7ba0903b76bedb85" dependencies = [ "bitflags 2.6.0", "errno", From 6d00330b5fcfda1e53e3f7312d4c07591b58a09b Mon Sep 17 00:00:00 2001 From: Steve Lee Date: Mon, 9 Dec 2024 11:03:21 -0800 Subject: [PATCH 2/2] fix Windows specific code --- dsc/src/main.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dsc/src/main.rs b/dsc/src/main.rs index 93ba0fdc..59a52a75 100644 --- a/dsc/src/main.rs +++ b/dsc/src/main.rs @@ -145,7 +145,7 @@ Visit https://aka.ms/dscv3-docs for more information on how to use DSC.exe. Press any key to close this window "; - let sys = System::new_with_specifics(RefreshKind::new().with_processes(ProcessRefreshKind::new())); + let sys = System::new_with_specifics(RefreshKind::nothing().with_processes(ProcessRefreshKind::everything())); // get current process let Ok(current_pid) = get_current_pid() else { return;