From 8c145f994d8de16ad6feac073fbef9e323d21f74 Mon Sep 17 00:00:00 2001 From: Richard Montoya Date: Sat, 22 Jul 2023 00:35:49 -0500 Subject: [PATCH 1/7] fix: update Cargo.lock to remove proc_macro_span --- Cargo.lock | 237 +++++++++++++++++++++++++++++------------------------ 1 file changed, 131 insertions(+), 106 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index b105e29..3843c9f 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -26,9 +26,9 @@ dependencies = [ [[package]] name = "aho-corasick" -version = "1.0.1" +version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "67fc08ce920c31afb70f013dcce1bfc3a3195de6a228474e45e1f145b36f8d04" +checksum = "43f6cb1bf222025340178f382c426f13757b2960e89779dfcb319c32542a5a41" dependencies = [ "memchr", ] @@ -50,15 +50,15 @@ dependencies = [ [[package]] name = "anstyle" -version = "1.0.0" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "41ed9a86bf92ae6580e0a31281f65a1b1d867c0cc68d5346e2ae128dddfa6a7d" +checksum = "3a30da5c5f2d5e72842e00bcb57657162cdabef0931f40e2deb9b4140440cecd" [[package]] name = "anstyle-parse" -version = "0.2.0" +version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e765fd216e48e067936442276d1d57399e37bce53c264d6fefbe298080cb57ee" +checksum = "938874ff5980b03a87c5524b3ae5b59cf99b1d6bc836848df7bc5ada9643c333" dependencies = [ "utf8parse", ] @@ -84,9 +84,9 @@ dependencies = [ [[package]] name = "anyhow" -version = "1.0.71" +version = "1.0.72" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c7d0618f0e0b7e8ff11427422b64564d5fb0be1940354bfe2e0529b18a9d9b8" +checksum = "3b13c32d80ecc7ab747b80c3784bce54ee8a7a0cc4fbda9bf4cda2cf6fe90854" [[package]] name = "approx" @@ -99,15 +99,15 @@ dependencies = [ [[package]] name = "arrayvec" -version = "0.7.2" +version = "0.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8da52d66c7071e2e3fa2a1e5c6d088fec47b593032b254f5e980de8ea54454d6" +checksum = "96d30a06541fbafbc7f82ed10c06164cfbd2c401138f6addd8404629c4b16711" [[package]] name = "assert_cmd" -version = "2.0.11" +version = "2.0.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "86d6b683edf8d1119fe420a94f8a7e389239666aa72e65495d91c00462510151" +checksum = "88903cb14723e4d4003335bb7f8a14f27691649105346a0f0957466c096adfe6" dependencies = [ "anstyle", "bstr", @@ -150,6 +150,12 @@ version = "1.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" +[[package]] +name = "bitflags" +version = "2.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "630be753d4e58660abd17930c71b647fe46c27ea6b63cc59e1e3851406972e42" + [[package]] name = "bitvec" version = "1.0.1" @@ -209,12 +215,11 @@ dependencies = [ [[package]] name = "bstr" -version = "1.5.0" +version = "1.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a246e68bb43f6cd9db24bea052a53e40405417c5fb372e3d1a8a7f770a564ef5" +checksum = "6798148dccfbff0fae41c7574d2fa8f1ef3492fba0face179de5d8d447d67b05" dependencies = [ "memchr", - "once_cell", "regex-automata", "serde", ] @@ -267,22 +272,21 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" [[package]] name = "clap" -version = "4.3.1" +version = "4.3.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b4ed2379f8603fa2b7509891660e802b88c70a79a6427a70abb5968054de2c28" +checksum = "5fd304a20bff958a57f04c4e96a2e7594cc4490a0e809cbd48bb6437edaa452d" dependencies = [ "clap_builder", ] [[package]] name = "clap_builder" -version = "4.3.1" +version = "4.3.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "72394f3339a76daf211e57d4bcb374410f3965dcc606dd0e03738c7888766980" +checksum = "01c6a3f08f1fe5662a35cfe393aec09c4df95f60ee93b7556505260f75eee9e1" dependencies = [ "anstream", "anstyle", - "bitflags", "clap_lex", "once_cell", "strsim", @@ -291,9 +295,9 @@ dependencies = [ [[package]] name = "clap_complete" -version = "4.3.1" +version = "4.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f6b5c519bab3ea61843a7923d074b04245624bb84a64a8c150f5deb014e388b" +checksum = "5fc443334c81a804575546c5a8a79b4913b50e28d69232903604cada1de817ce" dependencies = [ "clap", ] @@ -310,7 +314,7 @@ version = "0.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ddfc5b9aa5d4507acaf872de71051dfd0e309860e88966e1051e462a077aac4f" dependencies = [ - "bitflags", + "bitflags 1.3.2", ] [[package]] @@ -321,13 +325,13 @@ checksum = "acbf1af155f9b9ef647e42cdc158db4b64a1b61f743629225fde6f3e0be2a7c7" [[package]] name = "colored" -version = "2.0.0" +version = "2.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b3616f750b84d8f0de8a58bda93e08e2a81ad3f523089b05f1dffecab48c6cbd" +checksum = "2674ec482fbc38012cf31e6c42ba0177b431a0cb6f15fe40efa5aab1bda516f6" dependencies = [ - "atty", + "is-terminal", "lazy_static", - "winapi", + "windows-sys 0.48.0", ] [[package]] @@ -378,9 +382,9 @@ checksum = "fea41bba32d969b513997752735605054bc0dfa92b4c56bf1189f2e174be7a10" [[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 = "encode_unicode" @@ -411,12 +415,9 @@ dependencies = [ [[package]] name = "fastrand" -version = "1.9.0" +version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e51093e27b0797c359783294ca4f0a911c270184cb10f85783b118614a1501be" -dependencies = [ - "instant", -] +checksum = "6999dc1837253364c2ebb0704ba97994bd874e8f195d665c50b7548f6ea92764" [[package]] name = "float-cmp" @@ -441,9 +442,9 @@ checksum = "e6d5a32815ae3f33302d95fdcb2ce17862f8c65363dcfd29360480ba1001fc9c" [[package]] name = "getrandom" -version = "0.2.9" +version = "0.2.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c85e1d9ab2eadba7e5040d4e09cbd6d072b76a557ad64e797c2cb9d4da21d7e4" +checksum = "be4136b2a15dd319360be1c07d9933517ccf0be8f16bf62a3bee4f0d618df427" dependencies = [ "cfg-if", "libc", @@ -479,9 +480,9 @@ dependencies = [ [[package]] name = "hermit-abi" -version = "0.3.1" +version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fed44880c466736ef9a5c5b5facefb5ed0785676d0c02d612db14e54f0d84286" +checksum = "443144c8cdadd93ebf52ddb4056d257f5b52c04d3c804e657d19eb73fc33668b" [[package]] name = "hyperfine" @@ -513,9 +514,9 @@ dependencies = [ [[package]] name = "indicatif" -version = "0.17.4" +version = "0.17.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "db45317f37ef454e6519b6c3ed7d377e5f23346f0823f86e65ca36912d1d0ef8" +checksum = "8ff8cc23a7393a397ed1d7f56e6365cba772aba9f9912ab968b03043c395d057" dependencies = [ "console", "instant", @@ -539,20 +540,19 @@ version = "1.0.11" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "eae7b9aee968036d54dce06cebaefd919e4472e753296daccd6d344e3e2df0c2" dependencies = [ - "hermit-abi 0.3.1", + "hermit-abi 0.3.2", "libc", "windows-sys 0.48.0", ] [[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", - "rustix", + "hermit-abi 0.3.2", + "rustix 0.38.4", "windows-sys 0.48.0", ] @@ -567,9 +567,9 @@ 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 = "lazy_static" @@ -579,9 +579,9 @@ checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" [[package]] name = "libc" -version = "0.2.144" +version = "0.2.147" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2b00cc1c228a6782d0f076e7b232802e0c5689d41bb5df366f2a6b6621cfdfe1" +checksum = "b4668fb0ea861c1df094127ac5f1da3409a82116a4ba74fca2e58ef927159bb3" [[package]] name = "linux-raw-sys" @@ -589,6 +589,12 @@ version = "0.3.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ef53942eb7bf7ff43a617b3e2c1c4a5ecf5944a7c1bc12d7ee39bbb15e5c1519" +[[package]] +name = "linux-raw-sys" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09fc20d2ca12cb9f044c93e3bd6d32d523e6e2ec3db4f7b2939cd99026ecd3f0" + [[package]] name = "memchr" version = "2.5.0" @@ -610,7 +616,7 @@ version = "0.26.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bfdda3d196821d6af13126e40375cdf7da646a96114af134d5f417a9a1dc8e1a" dependencies = [ - "bitflags", + "bitflags 1.3.2", "cfg-if", "libc", "memoffset", @@ -694,9 +700,9 @@ dependencies = [ [[package]] name = "num-traits" -version = "0.2.15" +version = "0.2.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "578ede34cf02f8924ab9447f50c28075b4d3e5b269972345e7e0372b38c6cdcd" +checksum = "f30b0abd723be7e2ffca1272140fac1a2f084c77ec3e123c192b66af1ee9e6c2" dependencies = [ "autocfg 1.1.0", ] @@ -709,9 +715,9 @@ checksum = "830b246a0e5f20af87141b25c173cd1b609bd7779a4617d6ec582abaf90870f3" [[package]] name = "once_cell" -version = "1.17.2" +version = "1.18.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9670a07f94779e00908f3e686eab508878ebb390ba6e604d3a284c00e8d0487b" +checksum = "dd8b5dd2ae5ed71462c540258bedcb51965123ad7e7ccf4b9a8cafaa4a63576d" [[package]] name = "pin-utils" @@ -721,9 +727,9 @@ checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" [[package]] name = "portable-atomic" -version = "1.3.3" +version = "1.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "767eb9f07d4a5ebcb39bbf2d452058a93c011373abf6832e24194a1c3f004794" +checksum = "edc55135a600d700580e406b4de0d59cb9ad25e344a3a091a97ded2622ec4ec6" [[package]] name = "ppv-lite86" @@ -773,9 +779,9 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.59" +version = "1.0.66" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6aeca18b86b413c660b781aa319e4e2648a3e6f9eadc9b47e9038e6fe9f3451b" +checksum = "18fb31db3f9bddb2ea821cde30a9f70117e3f119938b5ee630b7403aa6e2ead9" dependencies = [ "unicode-ident", ] @@ -802,9 +808,9 @@ dependencies = [ [[package]] name = "quote" -version = "1.0.28" +version = "1.0.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1b9ab9c7eadfd8df19006f1cf1a4aed13540ed5cbc047010ece5826e10825488" +checksum = "5fe8a65d69dd0808184ebb5f836ab526bb259db23c657efa38711b1072ee47f0" dependencies = [ "proc-macro2", ] @@ -966,31 +972,37 @@ version = "0.3.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "567664f262709473930a4bf9e51bf2ebf3348f2e748ccc50dea20646858f8f29" dependencies = [ - "bitflags", + "bitflags 1.3.2", ] [[package]] name = "regex" -version = "1.8.3" +version = "1.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "81ca098a9821bd52d6b24fd8b10bd081f47d39c22778cafaa75a2857a62c6390" +checksum = "b2eae68fc220f7cf2532e4494aded17545fce192d59cd996e0fe7887f4ceb575" +dependencies = [ + "aho-corasick", + "memchr", + "regex-automata", + "regex-syntax", +] + +[[package]] +name = "regex-automata" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "39354c10dd07468c2e73926b23bb9c2caca74c5501e38a35da70406f1d923310" dependencies = [ "aho-corasick", "memchr", "regex-syntax", ] -[[package]] -name = "regex-automata" -version = "0.1.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6c230d73fb8d8c1b9c0b3135c5142a8acee3a0558fb8db5cf1cb65f8d7862132" - [[package]] name = "regex-syntax" -version = "0.7.2" +version = "0.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "436b050e76ed2903236f032a59761c1eb99e1b0aead2c257922771dab1fc8c78" +checksum = "e5ea92a5b6195c6ef2a0295ea818b312502c6fc94dde986c5553242e18fd4ce2" [[package]] name = "rend" @@ -1031,9 +1043,9 @@ dependencies = [ [[package]] name = "rust_decimal" -version = "1.29.1" +version = "1.30.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26bd36b60561ee1fb5ec2817f198b6fd09fa571c897a5e86d1487cfc2b096dfc" +checksum = "d0446843641c69436765a35a5a77088e28c2e6a12da93e84aa3ab1cd4aa5a042" dependencies = [ "arrayvec", "borsh", @@ -1049,23 +1061,36 @@ dependencies = [ [[package]] name = "rustix" -version = "0.37.19" +version = "0.37.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "acf8729d8542766f1b2cf77eb034d52f40d375bb8b615d0b147089946e16613d" +checksum = "4d69718bf81c6127a49dc64e44a742e8bb9213c0ff8869a22c308f84c1d4ab06" dependencies = [ - "bitflags", + "bitflags 1.3.2", "errno", "io-lifetimes", "libc", - "linux-raw-sys", + "linux-raw-sys 0.3.8", + "windows-sys 0.48.0", +] + +[[package]] +name = "rustix" +version = "0.38.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0a962918ea88d644592894bc6dc55acc6c0956488adcebbfb6e273506b7fd6e5" +dependencies = [ + "bitflags 2.3.3", + "errno", + "libc", + "linux-raw-sys 0.4.3", "windows-sys 0.48.0", ] [[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 = "seahash" @@ -1075,29 +1100,29 @@ checksum = "1c107b6f4780854c8b126e228ea8869f4d7b71260f962fefb57b996b8959ba6b" [[package]] name = "serde" -version = "1.0.164" +version = "1.0.174" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9e8c8cf938e98f769bc164923b06dce91cea1751522f46f8466461af04c9027d" +checksum = "3b88756493a5bd5e5395d53baa70b194b05764ab85b59e43e4b8f4e1192fa9b1" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.164" +version = "1.0.174" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d9735b638ccc51c28bf6914d90a2e9725b377144fc612c49a611fddd1b631d68" +checksum = "6e5c3a298c7f978e53536f95a63bdc4c4a64550582f31a0359a9afda6aede62e" dependencies = [ "proc-macro2", "quote", - "syn 2.0.18", + "syn 2.0.27", ] [[package]] name = "serde_json" -version = "1.0.99" +version = "1.0.103" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "46266871c240a00b8f503b877622fe33430b3c7d963bdc0f2adc511e54a1eae3" +checksum = "d03b412469450d4404fe8499a268edd7f8b79fecb074b0d812ad64ca21f4031b" dependencies = [ "itoa", "ryu", @@ -1151,9 +1176,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.18" +version = "2.0.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "32d41677bcbe24c20c52e7c70b0d8db04134c5d1066bf98662e2871ad200ea3e" +checksum = "b60f673f44a8255b9c8c657daf66a596d435f2da81a555b06dc644d080ba45e0" dependencies = [ "proc-macro2", "quote", @@ -1168,15 +1193,15 @@ checksum = "55937e1799185b12863d447f42597ed69d9928686b8d88a1df17376a097d8369" [[package]] name = "tempfile" -version = "3.5.0" +version = "3.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b9fbec84f381d5795b08656e4912bec604d162bff9291d6189a78f4c8ab87998" +checksum = "5486094ee78b2e5038a6382ed7645bc084dc2ec433426ca4c3cb61e2007b8998" dependencies = [ "cfg-if", "fastrand", "redox_syscall", - "rustix", - "windows-sys 0.45.0", + "rustix 0.38.4", + "windows-sys 0.48.0", ] [[package]] @@ -1185,7 +1210,7 @@ version = "0.2.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8e6bf6f19e9f8ed8d4048dc22981458ebcf406d67e94cd422e5ecd73d63b3237" dependencies = [ - "rustix", + "rustix 0.37.23", "windows-sys 0.48.0", ] @@ -1197,22 +1222,22 @@ checksum = "3369f5ac52d5eb6ab48c6b4ffdc8efbcad6b89c765749064ba298f2c68a16a76" [[package]] name = "thiserror" -version = "1.0.40" +version = "1.0.44" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "978c9a314bd8dc99be594bc3c175faaa9794be04a5a5e153caba6915336cebac" +checksum = "611040a08a0439f8248d1990b111c95baa9c704c805fa1f62104b39655fd7f90" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.40" +version = "1.0.44" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f9456a42c5b0d803c8cd86e73dd7cc9edd429499f37a3550d286d5e86720569f" +checksum = "090198534930841fab3a5d1bb637cde49e339654e606195f8d9c76eeb081dc96" dependencies = [ "proc-macro2", "quote", - "syn 2.0.18", + "syn 2.0.27", ] [[package]] @@ -1241,9 +1266,9 @@ dependencies = [ [[package]] name = "unicode-ident" -version = "1.0.9" +version = "1.0.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b15811caf2415fb889178633e7724bad2509101cde276048e013b9def5e51fa0" +checksum = "301abaae475aa91687eb82514b328ab47a211a533026cb25fc3e519b86adfc3c" [[package]] name = "unicode-width" @@ -1259,9 +1284,9 @@ checksum = "711b9620af191e0cdc7468a8d14e709c3dcdb115b36f838e601583af800a370a" [[package]] name = "uuid" -version = "1.3.3" +version = "1.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "345444e32442451b267fc254ae85a209c64be56d2890e601a0c37ff0c3c5ecd2" +checksum = "79daa5ed5740825c40b389c5e50312b9c86df53fccd33f281df655642b43869d" [[package]] name = "version_check" @@ -1321,7 +1346,7 @@ version = "0.48.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9" dependencies = [ - "windows-targets 0.48.0", + "windows-targets 0.48.1", ] [[package]] @@ -1341,9 +1366,9 @@ dependencies = [ [[package]] name = "windows-targets" -version = "0.48.0" +version = "0.48.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7b1eb6f0cd7c80c79759c929114ef071b87354ce476d9d94271031c0497adfd5" +checksum = "05d4b17490f70499f20b9e791dcf6a299785ce8af4d709018206dc5b4953e95f" dependencies = [ "windows_aarch64_gnullvm 0.48.0", "windows_aarch64_msvc 0.48.0", From 1cb474f452935a04fe8141237969a8210adad8ac Mon Sep 17 00:00:00 2001 From: Richard Montoya Date: Mon, 24 Jul 2023 15:10:52 -0500 Subject: [PATCH 2/7] bump the minimum supported rust version. --- Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Cargo.toml b/Cargo.toml index 1c3823d..0286cba 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -10,7 +10,7 @@ repository = "https://github.com/sharkdp/hyperfine" version = "1.17.0" edition = "2018" build = "build.rs" -rust-version = "1.65.0" +rust-version = "1.66.0" [features] # Use the nightly feature windows_process_extensions_main_thread_handle From b90fa23237e2d2ef4dcc5a2a8a938e12f2bcc573 Mon Sep 17 00:00:00 2001 From: Richard Montoya Date: Wed, 26 Jul 2023 23:09:41 -0500 Subject: [PATCH 3/7] modify types for serialization and deserialization The existing types need to be modified so they can be used for the deserialization process. --- src/benchmark/benchmark_result.rs | 8 ++++---- src/export/json.rs | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/benchmark/benchmark_result.rs b/src/benchmark/benchmark_result.rs index b37f725..e9cac70 100644 --- a/src/benchmark/benchmark_result.rs +++ b/src/benchmark/benchmark_result.rs @@ -1,20 +1,20 @@ use std::collections::BTreeMap; -use serde::Serialize; +use serde::{Serialize, Deserialize}; use crate::util::units::Second; /// Set of values that will be exported. // NOTE: `serde` is used for JSON serialization, but not for CSV serialization due to the // `parameters` map. Update `src/hyperfine/export/csv.rs` with new fields, as appropriate. -#[derive(Debug, Default, Clone, Serialize, PartialEq)] +#[derive(Debug, Default, Clone, Serialize, Deserialize ,PartialEq)] pub struct BenchmarkResult { /// The full command line of the program that is being benchmarked pub command: String, /// The full command line of the program that is being benchmarked, possibly including a list of /// parameters that were not used in the command line template. - #[serde(skip_serializing)] + #[serde(skip)] pub command_with_unused_parameters: String, /// The average run time @@ -46,6 +46,6 @@ pub struct BenchmarkResult { pub exit_codes: Vec>, /// Parameter values for this benchmark - #[serde(skip_serializing_if = "BTreeMap::is_empty")] + #[serde(default, skip_serializing_if = "BTreeMap::is_empty")] pub parameters: BTreeMap, } diff --git a/src/export/json.rs b/src/export/json.rs index d2542c1..2153091 100644 --- a/src/export/json.rs +++ b/src/export/json.rs @@ -8,9 +8,9 @@ use crate::util::units::Unit; use anyhow::Result; -#[derive(Serialize, Debug)] -struct HyperfineSummary<'a> { - results: &'a [BenchmarkResult], +#[derive(Serialize, Deserialize, Debug)] +pub struct HyperfineSummary { + results: Vec, } #[derive(Default)] @@ -23,7 +23,7 @@ impl Exporter for JsonExporter { _unit: Option, _sort_order: SortOrder, ) -> Result> { - let mut output = to_vec_pretty(&HyperfineSummary { results }); + let mut output = to_vec_pretty(&HyperfineSummary { results: results.to_vec() }); if let Ok(ref mut content) = output { content.push(b'\n'); } From 0033f23006830ebb029499a6e6ddb3845c1c7633 Mon Sep 17 00:00:00 2001 From: Richard Montoya Date: Fri, 28 Jul 2023 19:23:38 -0500 Subject: [PATCH 4/7] Make the JSON public for use in import Modify the JSON export module so it can be used as a reference for importing and deserializing. --- src/export/json.rs | 2 +- src/export/mod.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/export/json.rs b/src/export/json.rs index 2153091..dff1d6a 100644 --- a/src/export/json.rs +++ b/src/export/json.rs @@ -10,7 +10,7 @@ use anyhow::Result; #[derive(Serialize, Deserialize, Debug)] pub struct HyperfineSummary { - results: Vec, + pub results: Vec, } #[derive(Default)] diff --git a/src/export/mod.rs b/src/export/mod.rs index 717f879..ad7c053 100644 --- a/src/export/mod.rs +++ b/src/export/mod.rs @@ -3,7 +3,7 @@ use std::io::Write; mod asciidoc; mod csv; -mod json; +pub mod json; mod markdown; mod markup; mod orgmode; From 610c8c4a8a22e20873aec238f8b7e03a64747d82 Mon Sep 17 00:00:00 2001 From: Richard Montoya Date: Fri, 28 Jul 2023 19:26:30 -0500 Subject: [PATCH 5/7] Add functionality to load a previous run --- src/benchmark/scheduler.rs | 19 +++++++++++++++---- src/import.rs | 31 +++++++++++++++++++++++++++++++ src/main.rs | 6 +++++- 3 files changed, 51 insertions(+), 5 deletions(-) create mode 100644 src/import.rs diff --git a/src/benchmark/scheduler.rs b/src/benchmark/scheduler.rs index 62f3e63..bdf5a01 100644 --- a/src/benchmark/scheduler.rs +++ b/src/benchmark/scheduler.rs @@ -22,12 +22,13 @@ impl<'a> Scheduler<'a> { commands: &'a Commands, options: &'a Options, export_manager: &'a ExportManager, + results: &'a Vec ) -> Self { Self { commands, options, export_manager, - results: vec![], + results: results.to_vec(), } } @@ -69,6 +70,14 @@ impl<'a> Scheduler<'a> { &self.results, self.options.sort_order_speed_comparison, ) { + fn get_command_from_result<'b>(result: &'b BenchmarkResult) -> &'b str { + if !result.command_with_unused_parameters.is_empty() { + &result.command_with_unused_parameters + } else { + &result.command + } + } + match self.options.sort_order_speed_comparison { SortOrder::MeanTime => { println!("{}", "Summary".bold()); @@ -76,9 +85,10 @@ impl<'a> Scheduler<'a> { let fastest = annotated_results.iter().find(|r| r.is_fastest).unwrap(); let others = annotated_results.iter().filter(|r| !r.is_fastest); + println!( " {} ran", - fastest.result.command_with_unused_parameters.cyan() + (get_command_from_result(&fastest.result)).cyan() ); for item in others { @@ -90,7 +100,8 @@ impl<'a> Scheduler<'a> { } else { "".into() }, - &item.result.command_with_unused_parameters.magenta() + // &item.result.command_with_unused_parameters.magenta() + &(get_command_from_result(&item.result)).magenta() ); } } @@ -108,7 +119,7 @@ impl<'a> Scheduler<'a> { } else { " ".into() }, - &item.result.command_with_unused_parameters, + &(get_command_from_result(item.result)), ); } } diff --git a/src/import.rs b/src/import.rs new file mode 100644 index 0000000..dc91431 --- /dev/null +++ b/src/import.rs @@ -0,0 +1,31 @@ +use clap::ArgMatches; +use std::fs; +use crate::{export::json::HyperfineSummary, benchmark::benchmark_result::BenchmarkResult}; + +#[derive(Debug, Clone, PartialEq, Eq)] +pub struct Importer {} + +impl Importer { + pub fn from_cli_arguments(matches: &ArgMatches) -> Option> { + match matches.get_one::("import-json") { + Some(file_name) => read_summary_from_file(file_name), + None => None, + } + } +} + +fn read_summary_from_file(file_name: &str) -> Option> { + let file_content = match fs::read_to_string(file_name) { + Ok(content) => content, + Err(_) => { + eprintln!("Unable to load previous run from file {}", file_name); + return None + }, + }; + + let hyperfine_summary = serde_json::from_str::(&file_content); + match hyperfine_summary { + Ok(summary) => Some(summary.results), + Err(_) => None, + } +} diff --git a/src/main.rs b/src/main.rs index a75d4bd..b5f259a 100644 --- a/src/main.rs +++ b/src/main.rs @@ -9,6 +9,7 @@ use benchmark::scheduler::Scheduler; use cli::get_cli_arguments; use command::Commands; use export::ExportManager; +use import::Importer; use options::Options; use anyhow::Result; @@ -19,6 +20,7 @@ pub mod cli; pub mod command; pub mod error; pub mod export; +pub mod import; pub mod options; pub mod outlier_detection; pub mod output; @@ -32,13 +34,15 @@ fn run() -> Result<()> { colored::control::set_virtual_terminal(true).unwrap(); let cli_arguments = get_cli_arguments(env::args_os()); + let previous_results = Importer::from_cli_arguments(&cli_arguments).unwrap_or(Vec::new()); + let options = Options::from_cli_arguments(&cli_arguments)?; let commands = Commands::from_cli_arguments(&cli_arguments)?; let export_manager = ExportManager::from_cli_arguments(&cli_arguments, options.time_unit)?; options.validate_against_command_list(&commands)?; - let mut scheduler = Scheduler::new(&commands, &options, &export_manager); + let mut scheduler = Scheduler::new(&commands, &options, &export_manager, &previous_results); scheduler.run_benchmarks()?; scheduler.print_relative_speed_comparison(); scheduler.final_export()?; From c8bfd59d817e6f7535e43f2dc7d3287945471dc5 Mon Sep 17 00:00:00 2001 From: Richard Montoya Date: Fri, 28 Jul 2023 19:30:33 -0500 Subject: [PATCH 6/7] Adds the import-json to the cli options --- src/cli.rs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/cli.rs b/src/cli.rs index 8063253..b734caa 100644 --- a/src/cli.rs +++ b/src/cli.rs @@ -257,6 +257,13 @@ fn build_command() -> Command { .help("Export the timing summary statistics and timings of individual runs as JSON to the given FILE. \ The output time unit is always seconds"), ) + .arg( + Arg::new("import-json") + .long("import-json") + .action(ArgAction::Set) + .value_name("FILE") + .help("Import the timing summary statistics and timings of individual runs from a JSON FILE.") + ) .arg( Arg::new("export-markdown") .long("export-markdown") From 539995aad13d8221cb75f499fc524a0031c412c8 Mon Sep 17 00:00:00 2001 From: Richard Montoya Date: Fri, 28 Jul 2023 19:39:41 -0500 Subject: [PATCH 7/7] formtating --- src/benchmark/benchmark_result.rs | 4 ++-- src/benchmark/scheduler.rs | 3 +-- src/export/json.rs | 4 +++- src/import.rs | 6 +++--- 4 files changed, 9 insertions(+), 8 deletions(-) diff --git a/src/benchmark/benchmark_result.rs b/src/benchmark/benchmark_result.rs index e9cac70..10ff0a8 100644 --- a/src/benchmark/benchmark_result.rs +++ b/src/benchmark/benchmark_result.rs @@ -1,13 +1,13 @@ use std::collections::BTreeMap; -use serde::{Serialize, Deserialize}; +use serde::{Deserialize, Serialize}; use crate::util::units::Second; /// Set of values that will be exported. // NOTE: `serde` is used for JSON serialization, but not for CSV serialization due to the // `parameters` map. Update `src/hyperfine/export/csv.rs` with new fields, as appropriate. -#[derive(Debug, Default, Clone, Serialize, Deserialize ,PartialEq)] +#[derive(Debug, Default, Clone, Serialize, Deserialize, PartialEq)] pub struct BenchmarkResult { /// The full command line of the program that is being benchmarked pub command: String, diff --git a/src/benchmark/scheduler.rs b/src/benchmark/scheduler.rs index bdf5a01..b97c548 100644 --- a/src/benchmark/scheduler.rs +++ b/src/benchmark/scheduler.rs @@ -22,7 +22,7 @@ impl<'a> Scheduler<'a> { commands: &'a Commands, options: &'a Options, export_manager: &'a ExportManager, - results: &'a Vec + results: &'a Vec, ) -> Self { Self { commands, @@ -85,7 +85,6 @@ impl<'a> Scheduler<'a> { let fastest = annotated_results.iter().find(|r| r.is_fastest).unwrap(); let others = annotated_results.iter().filter(|r| !r.is_fastest); - println!( " {} ran", (get_command_from_result(&fastest.result)).cyan() diff --git a/src/export/json.rs b/src/export/json.rs index dff1d6a..27c7d83 100644 --- a/src/export/json.rs +++ b/src/export/json.rs @@ -23,7 +23,9 @@ impl Exporter for JsonExporter { _unit: Option, _sort_order: SortOrder, ) -> Result> { - let mut output = to_vec_pretty(&HyperfineSummary { results: results.to_vec() }); + let mut output = to_vec_pretty(&HyperfineSummary { + results: results.to_vec(), + }); if let Ok(ref mut content) = output { content.push(b'\n'); } diff --git a/src/import.rs b/src/import.rs index dc91431..34e50c4 100644 --- a/src/import.rs +++ b/src/import.rs @@ -1,6 +1,6 @@ +use crate::{benchmark::benchmark_result::BenchmarkResult, export::json::HyperfineSummary}; use clap::ArgMatches; use std::fs; -use crate::{export::json::HyperfineSummary, benchmark::benchmark_result::BenchmarkResult}; #[derive(Debug, Clone, PartialEq, Eq)] pub struct Importer {} @@ -19,8 +19,8 @@ fn read_summary_from_file(file_name: &str) -> Option> { Ok(content) => content, Err(_) => { eprintln!("Unable to load previous run from file {}", file_name); - return None - }, + return None; + } }; let hyperfine_summary = serde_json::from_str::(&file_content);