diff --git a/.cargo/config.toml b/.cargo/config.toml index 7a5a02c38e2..fd39b0dbed6 100644 --- a/.cargo/config.toml +++ b/.cargo/config.toml @@ -2,7 +2,7 @@ rustflags = [ # Rustc lints # "-W", "warning_name" - # "-A", "warning_name" + "-A", "clippy::let_unit_value", # in 'small' builds this triggers as the `span!` macro yields `let x = ()`. No way to prevent it in macro apparently. # Clippy lints "-W", "clippy::cloned_instead_of_copied", diff --git a/.github/workflows/msrv.yml b/.github/workflows/msrv.yml index 0098a4d0280..8f9143e879f 100644 --- a/.github/workflows/msrv.yml +++ b/.github/workflows/msrv.yml @@ -20,6 +20,6 @@ jobs: runs-on: ${{ matrix.os }} steps: - uses: actions/checkout@v3 - - uses: dtolnay/rust-toolchain@1.64.0 # dictated by `windows` crates effectively, IMPORTANT: adjust etc/msrv-badge.svg as well + - uses: dtolnay/rust-toolchain@1.65.0 # dictated by `windows` crates effectively, IMPORTANT: adjust etc/msrv-badge.svg as well - uses: extractions/setup-just@v1 - run: just ci-check-msrv diff --git a/Cargo.lock b/Cargo.lock index 6cb9c1c95da..e23021c2232 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -8,17 +8,6 @@ version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" -[[package]] -name = "ahash" -version = "0.7.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fcb51a0695d8f838b1ee009b3fbf66bda078cd64590202a864a8f3e8c4315c47" -dependencies = [ - "getrandom", - "once_cell", - "version_check", -] - [[package]] name = "ahash" version = "0.8.3" @@ -33,13 +22,19 @@ 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", ] +[[package]] +name = "allocator-api2" +version = "0.2.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "56fc6cf8dc8c4158eed8649f9b8b0ea1518eb62b544fe9490d66fa0b349eafe9" + [[package]] name = "anes" version = "0.1.6" @@ -57,9 +52,9 @@ dependencies = [ [[package]] name = "anstream" -version = "0.3.0" +version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9e579a7752471abc2a8268df8b20005e3eadd975f585398f17efcfd8d4927371" +checksum = "0ca84f3628370c59db74ee214b3263d58f9aadd9b4fe7e711fd87dc452b7f163" dependencies = [ "anstyle", "anstyle-parse", @@ -96,9 +91,9 @@ dependencies = [ [[package]] name = "anstyle-wincon" -version = "1.0.0" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4bcd8291a340dd8ac70e18878bc4501dd7b4ff970cfa21c207d36ece51ea88fd" +checksum = "180abfa45703aebe0093f79badacc01b8fd4ea2e35118747e5811127f926e188" dependencies = [ "anstyle", "windows-sys 0.48.0", @@ -106,9 +101,9 @@ dependencies = [ [[package]] name = "anyhow" -version = "1.0.70" +version = "1.0.71" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7de8ce5e0f9f8d88245311066a578d72b7af3e7088f32783804676302df237e4" +checksum = "9c7d0618f0e0b7e8ff11427422b64564d5fb0be1940354bfe2e0529b18a9d9b8" [[package]] name = "arc-swap" @@ -118,9 +113,9 @@ checksum = "bddcadddf5e9015d310179a59bb28c4d4b9920ad0f11e8e14dbadf654890c9a6" [[package]] name = "arrayvec" -version = "0.7.2" +version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8da52d66c7071e2e3fa2a1e5c6d088fec47b593032b254f5e980de8ea54454d6" +checksum = "8868f09ff8cea88b079da74ae569d9b8c62a23c68c746240b704ee6f7525c89c" [[package]] name = "async-attributes" @@ -188,7 +183,7 @@ dependencies = [ "polling", "rustix", "slab", - "socket2", + "socket2 0.4.9", "waker-fn", ] @@ -254,7 +249,7 @@ checksum = "b9ccdd8f2a161be9bd5c023df56f1b2a0bd1d83872ae53b71a84a12c9bf6e842" dependencies = [ "proc-macro2", "quote", - "syn 2.0.15", + "syn 2.0.18", ] [[package]] @@ -282,9 +277,9 @@ checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" [[package]] name = "base64" -version = "0.21.0" +version = "0.21.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4a4ddaa51a5bc52a6948f74c06d20aaaddb71924eab79b8c97a8c556e942d6a" +checksum = "604178f6c5c21f02dc555784810edfb88d34ac2c73b2eae109655649ee73ce3d" [[package]] name = "bitflags" @@ -294,9 +289,9 @@ checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" [[package]] name = "bitflags" -version = "2.1.0" +version = "2.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c70beb79cbb5ce9c4f8e20849978f34225931f665bb49efa6982875a4d5facb3" +checksum = "6dbe3c979c178231552ecba20214a8272df4e09f232a87aef4320cf06539aded" dependencies = [ "serde", ] @@ -327,9 +322,9 @@ dependencies = [ [[package]] name = "bstr" -version = "1.4.0" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3d4260bcc2e8fc9df1eac4919a720effeb63a3f0952f5bf4944adfa18897f09" +checksum = "a246e68bb43f6cd9db24bea052a53e40405417c5fb372e3d1a8a7f770a564ef5" dependencies = [ "memchr", "once_cell", @@ -348,9 +343,9 @@ dependencies = [ [[package]] name = "bumpalo" -version = "3.12.0" +version = "3.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0d261e256854913907f67ed06efbc3338dfe6179796deefc1ff763fc1aee5535" +checksum = "a3e2c3daef883ecc1b5d58c15adae93470a91d425f3532ba1695849656af3fc1" [[package]] name = "bytecount" @@ -396,10 +391,10 @@ name = "cargo-smart-release" version = "0.20.0" dependencies = [ "anyhow", - "bitflags 2.1.0", + "bitflags 2.3.2", "cargo_metadata", "cargo_toml", - "clap 4.2.4", + "clap 4.3.4", "crates-index", "env_logger", "git-conventional", @@ -431,9 +426,9 @@ dependencies = [ [[package]] name = "cargo_toml" -version = "0.15.2" +version = "0.15.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f83bc2e401ed041b7057345ebc488c005efa0341d5541ce7004d30458d0090b" +checksum = "599aa35200ffff8f04c1925aa1acc92fa2e08874379ef42e210a80e527e60838" dependencies = [ "serde", "toml", @@ -468,9 +463,9 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" [[package]] name = "ciborium" -version = "0.2.0" +version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b0c137568cc60b904a7724001b35ce2630fd00d5d84805fbb608ab89509d788f" +checksum = "effd91f6c78e5a4ace8a5d3c0b6bfaec9e2baaef55f3efc00e45fb2e477ee926" dependencies = [ "ciborium-io", "ciborium-ll", @@ -479,15 +474,15 @@ dependencies = [ [[package]] name = "ciborium-io" -version = "0.2.0" +version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "346de753af073cc87b52b2083a506b38ac176a44cfb05497b622e27be899b369" +checksum = "cdf919175532b369853f5d5e20b26b43112613fd6fe7aee757e35f7a44642656" [[package]] name = "ciborium-ll" -version = "0.2.0" +version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "213030a2b5a4e0c0892b6652260cf6ccac84827b83a85a534e178e3906c4cf1b" +checksum = "defaa24ecc093c77630e6c15e17c51f5e187bf35ee514f4e2d67baaa96dae22b" dependencies = [ "ciborium-io", "half", @@ -495,9 +490,9 @@ dependencies = [ [[package]] name = "clap" -version = "3.2.23" +version = "3.2.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "71655c45cb9845d3270c9d6df84ebe72b4dad3c2ba3f7023ad47c144e4e473a5" +checksum = "4ea181bf566f71cb9a5d17a59e1871af638180a18fb0035c92ae62b705207123" dependencies = [ "bitflags 1.3.2", "clap_lex 0.2.4", @@ -507,9 +502,9 @@ dependencies = [ [[package]] name = "clap" -version = "4.2.4" +version = "4.3.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "956ac1f6381d8d82ab4684768f89c0ea3afe66925ceadb4eeb3fc452ffc55d62" +checksum = "80672091db20273a15cf9fdd4e47ed43b5091ec9841bf4c6145c9dfbbcae09ed" dependencies = [ "clap_builder", "clap_derive", @@ -518,28 +513,28 @@ dependencies = [ [[package]] name = "clap_builder" -version = "4.2.4" +version = "4.3.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "84080e799e54cff944f4b4a4b0e71630b0e0443b25b985175c7dddc1a859b749" +checksum = "c1458a1df40e1e2afebb7ab60ce55c1fa8f431146205aa5f4887e0b111c27636" dependencies = [ "anstream", "anstyle", "bitflags 1.3.2", - "clap_lex 0.4.1", + "clap_lex 0.5.0", "once_cell", "strsim", ] [[package]] name = "clap_derive" -version = "4.2.0" +version = "4.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3f9644cd56d6b87dbe899ef8b053e331c0637664e9e21a33dfcdc36093f5c5c4" +checksum = "b8cd2b2a819ad6eec39e8f1d6b53001af1e5469f8c177579cdaeb313115b825f" dependencies = [ "heck", "proc-macro2", "quote", - "syn 2.0.15", + "syn 2.0.18", ] [[package]] @@ -553,9 +548,9 @@ dependencies = [ [[package]] name = "clap_lex" -version = "0.4.1" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a2dd5a6fe8c6e3502f568a6353e5273bbb15193ad9a89e457b9970798efbea1" +checksum = "2da6da31387c7e4ef160ffab6d5e7f00c42626fe39aea70a7b0f1773f7dd6c1b" [[package]] name = "clru" @@ -598,14 +593,14 @@ dependencies = [ [[package]] name = "console" -version = "0.15.5" +version = "0.15.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3d79fbe8970a77e3e34151cc13d3b3e248aa0faaecb9f6091fa07ebefe5ad60" +checksum = "c926e00cc70edefdc64d3a5ff31cc65bb97a3460097762bd23afb4d8145fccf8" dependencies = [ "encode_unicode", "lazy_static", "libc", - "windows-sys 0.42.0", + "windows-sys 0.45.0", ] [[package]] @@ -626,24 +621,23 @@ checksum = "e496a50fda8aacccc86d7529e2c1e0892dbd0f898a6b5645b5561b89c3210efa" [[package]] name = "cpufeatures" -version = "0.2.7" +version = "0.2.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3e4c1eaa2012c47becbbad2ab175484c2a84d1185b566fb2cc5b8707343dfe58" +checksum = "03e69e28e9f7f77debdedbaafa2866e1de9ba56df55a8bd7cfc724c25a09987c" dependencies = [ "libc", ] [[package]] name = "crates-index" -version = "0.19.8" +version = "0.19.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "514c516c828544009e3b5842dd087a3fa4506d9674e26d0cbfc152f3f2a178c1" +checksum = "8800d96c397c9bedf1f0d1628c2487b2d77debb529e886e7b6d15bfc51cff8fd" dependencies = [ "git2", "hex", "home", "memchr", - "num_cpus", "rayon", "rustc-hash", "semver", @@ -688,7 +682,7 @@ dependencies = [ "atty", "cast", "ciborium", - "clap 3.2.23", + "clap 3.2.25", "criterion-plot", "itertools", "lazy_static", @@ -751,14 +745,14 @@ dependencies = [ [[package]] name = "crossbeam-epoch" -version = "0.9.14" +version = "0.9.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "46bd5f3f85273295a9d14aedfb86f6aadbff6d8f5295c4a9edb08e819dcf5695" +checksum = "ae211234986c545741a7dc064309f67ee1e5ad243d0e48335adc0484d960bcc7" dependencies = [ "autocfg", "cfg-if", "crossbeam-utils", - "memoffset 0.8.0", + "memoffset 0.9.0", "scopeguard", ] @@ -774,9 +768,9 @@ dependencies = [ [[package]] name = "crossbeam-utils" -version = "0.8.15" +version = "0.8.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c063cd8cc95f5c377ed0d4b49a4b21f632396ff690e8470c29b3359b346984b" +checksum = "5a22b2d63d4d1dc0b7f1b6b2747dd0088008a9be28b6ddf0b1e7d335e3037294" dependencies = [ "cfg-if", ] @@ -800,9 +794,9 @@ dependencies = [ [[package]] name = "crossterm_winapi" -version = "0.9.0" +version = "0.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2ae1b35a484aa10e07fe0638d02301c5ad24de82d310ccbd2f3693da5f09bf1c" +checksum = "acdd7c62a3665c7f6830a51635d9ac9b23ed385797f70a83bb8bafe9c572ab2b" dependencies = [ "winapi", ] @@ -854,15 +848,15 @@ dependencies = [ "openssl-probe", "openssl-sys", "schannel", - "socket2", + "socket2 0.4.9", "winapi", ] [[package]] name = "curl-sys" -version = "0.4.61+curl-8.0.1" +version = "0.4.63+curl-8.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "14d05c10f541ae6f3bc5b3d923c20001f47db7d5f0b2bc6ad16490133842db79" +checksum = "aeb0fef7046022a1e2ad67a004978f0e3cacb9e3123dc62ce768f92197b771dc" dependencies = [ "cc", "libc", @@ -888,9 +882,9 @@ dependencies = [ [[package]] name = "data-encoding" -version = "2.3.3" +version = "2.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "23d8666cb01533c39dde32bcbab8e227b4ed6679b2c925eba05feabea39508fb" +checksum = "c2e66c9d817f1720209181c316d28635c050fa304f9c79e47a520882661b7308" [[package]] name = "defer" @@ -906,9 +900,9 @@ checksum = "56254986775e3233ffa9c4d7d3faaf6d36a2c09d30b20687e9f88bc8bafc16c8" [[package]] name = "digest" -version = "0.10.6" +version = "0.10.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8168378f4e5023e7218c89c891c0fd8ecdb5e5e4f18cb78f38cf245dd021e76f" +checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292" dependencies = [ "block-buffer", "crypto-common", @@ -1054,9 +1048,9 @@ dependencies = [ [[package]] name = "flate2" -version = "1.0.25" +version = "1.0.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a8a2db397cb1c8772f31494cb8917e48cd1e64f0fa7efac59fbd741a0a8ce841" +checksum = "3b9429470923de8e8cbd4d2dc513535400b4b3fef0319fb5c4e1f520a7bef743" dependencies = [ "crc32fast", "libz-ng-sys", @@ -1087,9 +1081,9 @@ checksum = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b" [[package]] name = "form_urlencoded" -version = "1.1.0" +version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a9c384f161156f5260c24a097c56119f9be8c798586aecc13afbcbe7b7e26bf8" +checksum = "a62bc1cf6f830c2ec14a513a9fb124d0a213a629668a4186f329db21fe045652" dependencies = [ "percent-encoding", ] @@ -1191,9 +1185,9 @@ dependencies = [ [[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", "js-sys", @@ -1215,9 +1209,9 @@ dependencies = [ [[package]] name = "git2" -version = "0.16.1" +version = "0.17.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ccf7f68c2995f392c49fffb4f95ae2c873297830eb25c6bc4c114ce8f4562acc" +checksum = "7b989d6a7ca95a362cf2cfc5ad688b3a467be1f87e480b8dad07fee8c79b0044" dependencies = [ "bitflags 1.3.2", "libc", @@ -1233,7 +1227,7 @@ name = "gitoxide" version = "0.27.0" dependencies = [ "anyhow", - "clap 4.2.4", + "clap 4.3.4", "crosstermion", "document-features", "env_logger", @@ -1246,6 +1240,9 @@ dependencies = [ "prodash 25.0.0", "tabled", "time", + "tracing", + "tracing-forest", + "tracing-subscriber", ] [[package]] @@ -1275,8 +1272,12 @@ dependencies = [ "serde", "serde_json", "smallvec", + "sysinfo", "tempfile", "thiserror", + "tracing", + "tracing-forest", + "tracing-subscriber", ] [[package]] @@ -1316,6 +1317,7 @@ dependencies = [ "gix-sec 0.8.1", "gix-tempfile 6.0.0", "gix-testtools", + "gix-trace", "gix-transport", "gix-traverse 0.27.0", "gix-url", @@ -1345,7 +1347,7 @@ checksum = "848efa0f1210cea8638f95691c82a46f98a74b9e3524f01d4955ebc25a8f84f3" dependencies = [ "bstr", "btoi", - "gix-date 0.5.0", + "gix-date 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)", "itoa", "nom", "thiserror", @@ -1386,8 +1388,8 @@ checksum = "3015baa01ad2122fbcaab7863c857a603eb7b7ec12ac8141207c42c6439805e2" dependencies = [ "bstr", "gix-glob 0.7.0", - "gix-path 0.8.0", - "gix-quote 0.4.3", + "gix-path 0.8.1 (registry+https://github.com/rust-lang/crates.io-index)", + "gix-quote 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)", "kstring", "log", "smallvec", @@ -1416,18 +1418,18 @@ dependencies = [ [[package]] name = "gix-bitmap" -version = "0.2.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "55a95f4942360766c3880bdb2b4b57f1ef73b190fc424755e7fdf480430af618" +version = "0.2.4" dependencies = [ + "gix-testtools", "thiserror", ] [[package]] name = "gix-bitmap" version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fc02feb20ad313d52a450852f2005c2205d24f851e74d82b7807cbe12c371667" dependencies = [ - "gix-testtools", "thiserror", ] @@ -1506,7 +1508,7 @@ dependencies = [ name = "gix-config-value" version = "0.12.1" dependencies = [ - "bitflags 2.1.0", + "bitflags 2.3.2", "bstr", "document-features", "gix-path 0.8.1", @@ -1534,12 +1536,15 @@ dependencies = [ [[package]] name = "gix-date" -version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "99056f37270715f5c7584fd8b46899a2296af9cae92463bf58b8bd1f5a78e553" +version = "0.5.1" dependencies = [ "bstr", + "document-features", + "gix-hash 0.11.2", + "gix-testtools", "itoa", + "once_cell", + "serde", "thiserror", "time", ] @@ -1547,14 +1552,11 @@ dependencies = [ [[package]] name = "gix-date" version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bc164145670e9130a60a21670d9b6f0f4f8de04e5dd256c51fa5a0340c625902" dependencies = [ "bstr", - "document-features", - "gix-hash 0.11.2", - "gix-testtools", "itoa", - "once_cell", - "serde", "thiserror", "time", ] @@ -1585,16 +1587,16 @@ dependencies = [ [[package]] name = "gix-discover" -version = "0.18.0" +version = "0.18.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5012710ebdecf6193c6866d6409a3b702a4aa0d78c605bc343590b44ab9962a1" +checksum = "1a6b61363e63e7cdaa3e6f96acb0257ebdb3d8883e21eba5930c99f07f0a5fc0" dependencies = [ "bstr", "dunce", - "gix-hash 0.11.1", - "gix-path 0.8.0", + "gix-hash 0.11.2 (registry+https://github.com/rust-lang/crates.io-index)", + "gix-path 0.8.1 (registry+https://github.com/rust-lang/crates.io-index)", "gix-ref 0.29.1", - "gix-sec 0.8.0", + "gix-sec 0.8.1 (registry+https://github.com/rust-lang/crates.io-index)", "thiserror", ] @@ -1622,7 +1624,7 @@ version = "0.29.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cf69b0f5c701cc3ae22d3204b671907668f6437ca88862d355eaf9bc47a4f897" dependencies = [ - "gix-hash 0.11.1", + "gix-hash 0.11.2 (registry+https://github.com/rust-lang/crates.io-index)", "libc", "prodash 23.1.2", "sha1_smol", @@ -1641,6 +1643,7 @@ dependencies = [ "document-features", "flate2", "gix-hash 0.11.2", + "gix-trace", "jwalk", "libc", "once_cell", @@ -1683,17 +1686,17 @@ version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c07c98204529ac3f24b34754540a852593d2a4c7349008df389240266627a72a" dependencies = [ - "bitflags 2.1.0", + "bitflags 2.3.2", "bstr", "gix-features 0.29.0", - "gix-path 0.8.0", + "gix-path 0.8.1 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "gix-glob" version = "0.8.0" dependencies = [ - "bitflags 2.1.0", + "bitflags 2.3.2", "bstr", "document-features", "gix-features 0.30.0", @@ -1704,33 +1707,31 @@ dependencies = [ [[package]] name = "gix-hash" -version = "0.11.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "078eec3ac2808cc03f0bddd2704cb661da5c5dc33b41a9d7947b141d499c7c42" +version = "0.11.2" dependencies = [ + "document-features", + "gix-features 0.30.0", + "gix-testtools", "hex", + "serde", "thiserror", ] [[package]] name = "gix-hash" version = "0.11.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ee181c85d3955f54c4426e6bfaeeada4428692e1a39b8788c2ac7785fc301dd8" dependencies = [ - "document-features", - "gix-features 0.30.0", - "gix-testtools", "hex", - "serde", "thiserror", ] [[package]] name = "gix-hashtable" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "afebb85691c6a085b114e01a27f4a61364519298c5826cb87a45c304802299bc" +version = "0.2.1" dependencies = [ - "gix-hash 0.11.1", + "gix-hash 0.11.2", "hashbrown 0.13.2", "parking_lot", ] @@ -1738,8 +1739,10 @@ dependencies = [ [[package]] name = "gix-hashtable" version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bd259bd0d96e6153e357a8cdaca76c48e103fd34208b6c0ce77b1ad995834bd2" dependencies = [ - "gix-hash 0.11.2", + "gix-hash 0.11.2 (registry+https://github.com/rust-lang/crates.io-index)", "hashbrown 0.13.2", "parking_lot", ] @@ -1752,7 +1755,7 @@ checksum = "ba205b6df563e2906768bb22834c82eb46c5fdfcd86ba2c347270bc8309a05b2" dependencies = [ "bstr", "gix-glob 0.7.0", - "gix-path 0.8.0", + "gix-path 0.8.1 (registry+https://github.com/rust-lang/crates.io-index)", "unicode-bom", ] @@ -1776,15 +1779,15 @@ version = "0.16.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f39c1ccc8f1912cbbd5191efc28dbc5f0d0598042aa56bc09427b7c34efab3ba" dependencies = [ - "bitflags 2.1.0", + "bitflags 2.3.2", "bstr", "btoi", "filetime", - "gix-bitmap 0.2.3", + "gix-bitmap 0.2.4 (registry+https://github.com/rust-lang/crates.io-index)", "gix-features 0.29.0", - "gix-hash 0.11.1", + "gix-hash 0.11.2 (registry+https://github.com/rust-lang/crates.io-index)", "gix-lock 5.0.1", - "gix-object 0.29.1", + "gix-object 0.29.2", "gix-traverse 0.25.0", "itoa", "memmap2", @@ -1796,7 +1799,7 @@ dependencies = [ name = "gix-index" version = "0.18.0" dependencies = [ - "bitflags 2.1.0", + "bitflags 2.3.2", "bstr", "btoi", "document-features", @@ -1838,7 +1841,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2c693d7f05730fa74a7c467150adc7cea393518410c65f0672f80226b8111555" dependencies = [ "gix-tempfile 5.0.3", - "gix-utils 0.1.1", + "gix-utils 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", "thiserror", ] @@ -1869,7 +1872,7 @@ dependencies = [ name = "gix-negotiate" version = "0.2.1" dependencies = [ - "bitflags 2.1.0", + "bitflags 2.3.2", "gix-commitgraph", "gix-date 0.5.1", "gix-hash 0.11.2", @@ -1888,16 +1891,16 @@ version = "0.0.0" [[package]] name = "gix-object" -version = "0.29.1" +version = "0.29.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c9bb30ce0818d37096daa29efe361a4bc6dd0b51a5726598898be7e9a40a01e1" +checksum = "2d96bd620fd08accdd37f70b2183cfa0b001b4f1c6ade8b7f6e15cb3d9e261ce" dependencies = [ "bstr", "btoi", "gix-actor 0.20.0", "gix-features 0.29.0", - "gix-hash 0.11.1", - "gix-validate 0.7.4", + "gix-hash 0.11.2 (registry+https://github.com/rust-lang/crates.io-index)", + "gix-validate 0.7.5 (registry+https://github.com/rust-lang/crates.io-index)", "hex", "itoa", "nom", @@ -2013,24 +2016,25 @@ dependencies = [ [[package]] name = "gix-path" -version = "0.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4fc78f47095a0c15aea0e66103838f0748f4494bf7a9555dfe0f00425400396c" +version = "0.8.1" dependencies = [ "bstr", + "gix-trace", "home", "once_cell", + "tempfile", "thiserror", ] [[package]] name = "gix-path" version = "0.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c1226f2e50adeb4d76c754c1856c06f13a24cad1624801653fbf09b869e5b808" dependencies = [ "bstr", "home", "once_cell", - "tempfile", "thiserror", ] @@ -2038,7 +2042,7 @@ dependencies = [ name = "gix-pathspec" version = "0.1.0" dependencies = [ - "bitflags 2.1.0", + "bitflags 2.3.2", "bstr", "gix-attributes 0.13.1", "gix-glob 0.8.0", @@ -2087,9 +2091,7 @@ dependencies = [ [[package]] name = "gix-quote" -version = "0.4.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a282f5a8d9ee0b09ec47390ac727350c48f2f5c76d803cd8da6b3e7ad56e0bcb" +version = "0.4.4" dependencies = [ "bstr", "btoi", @@ -2099,6 +2101,8 @@ dependencies = [ [[package]] name = "gix-quote" version = "0.4.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "29d59489bff95b06dcdabe763b7266d3dc0a628cac1ac1caf65a7ca0a43eeae0" dependencies = [ "bstr", "btoi", @@ -2118,12 +2122,12 @@ dependencies = [ "gix-actor 0.20.0", "gix-features 0.29.0", "gix-fs 0.1.1", - "gix-hash 0.11.1", + "gix-hash 0.11.2 (registry+https://github.com/rust-lang/crates.io-index)", "gix-lock 5.0.1", - "gix-object 0.29.1", - "gix-path 0.8.0", + "gix-object 0.29.2", + "gix-path 0.8.1 (registry+https://github.com/rust-lang/crates.io-index)", "gix-tempfile 5.0.3", - "gix-validate 0.7.4", + "gix-validate 0.7.5 (registry+https://github.com/rust-lang/crates.io-index)", "memmap2", "nom", "thiserror", @@ -2219,26 +2223,26 @@ dependencies = [ [[package]] name = "gix-sec" -version = "0.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "794520043d5a024dfeac335c6e520cb616f6963e30dab995892382e998c12897" +version = "0.8.1" dependencies = [ - "bitflags 2.1.0", - "gix-path 0.8.0", + "bitflags 2.3.2", + "document-features", + "gix-path 0.8.1", "libc", + "serde", + "tempfile", "windows 0.48.0", ] [[package]] name = "gix-sec" version = "0.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b2b7b38b766eb95dcc5350a9c450030b69892c0902fa35f4a6d0809273bd9dae" dependencies = [ - "bitflags 2.1.0", - "document-features", - "gix-path 0.8.1", + "bitflags 2.3.2", + "gix-path 0.8.1 (registry+https://github.com/rust-lang/crates.io-index)", "libc", - "serde", - "tempfile", "windows 0.48.0", ] @@ -2286,12 +2290,12 @@ dependencies = [ "crc", "fastrand", "fs_extra", - "gix-discover 0.18.0", + "gix-discover 0.18.1", "gix-fs 0.2.0", "gix-ignore 0.2.0", "gix-lock 5.0.1", "gix-tempfile 6.0.0", - "gix-worktree 0.17.0", + "gix-worktree 0.17.1", "io-close", "is_ci", "nom", @@ -2306,6 +2310,14 @@ dependencies = [ name = "gix-tix" version = "0.0.0" +[[package]] +name = "gix-trace" +version = "0.1.0" +dependencies = [ + "document-features", + "tracing-core", +] + [[package]] name = "gix-transport" version = "0.32.0" @@ -2341,9 +2353,9 @@ version = "0.25.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a5be1e807f288c33bb005075111886cceb43ed8a167b3182a0f62c186e2a0dd1" dependencies = [ - "gix-hash 0.11.1", - "gix-hashtable 0.2.0", - "gix-object 0.29.1", + "gix-hash 0.11.2 (registry+https://github.com/rust-lang/crates.io-index)", + "gix-hashtable 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", + "gix-object 0.29.2", "thiserror", ] @@ -2393,9 +2405,7 @@ dependencies = [ [[package]] name = "gix-utils" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c10b69beac219acb8df673187a1f07dde2d74092f974fb3f9eb385aeb667c909" +version = "0.1.2" dependencies = [ "fastrand", ] @@ -2403,34 +2413,36 @@ dependencies = [ [[package]] name = "gix-utils" version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dbcfcb150c7ef553d76988467d223254045bdcad0dc6724890f32fbe96415da5" dependencies = [ "fastrand", ] [[package]] name = "gix-validate" -version = "0.7.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7bd629d3680773e1785e585d76fd4295b740b559cad9141517300d99a0c8c049" +version = "0.7.5" dependencies = [ "bstr", + "gix-testtools", "thiserror", ] [[package]] name = "gix-validate" version = "0.7.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "57ea5845b506c7728b9d89f4227cc369a5fc5a1d5b26c3add0f0d323413a3a60" dependencies = [ "bstr", - "gix-testtools", "thiserror", ] [[package]] name = "gix-worktree" -version = "0.17.0" +version = "0.17.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "10bf56a1f5037d84293ea6cece61d9f27c4866b1e13c1c95f37cf56b7da7af25" +checksum = "a69eaff0ae973a9d37c40f02ae5ae50fa726c8fc2fd3ab79d0a19eb61975aafa" dependencies = [ "bstr", "filetime", @@ -2438,11 +2450,11 @@ dependencies = [ "gix-features 0.29.0", "gix-fs 0.1.1", "gix-glob 0.7.0", - "gix-hash 0.11.1", + "gix-hash 0.11.2 (registry+https://github.com/rust-lang/crates.io-index)", "gix-ignore 0.2.0", "gix-index 0.16.1", - "gix-object 0.29.1", - "gix-path 0.8.0", + "gix-object 0.29.2", + "gix-path 0.8.1 (registry+https://github.com/rust-lang/crates.io-index)", "io-close", "thiserror", ] @@ -2487,9 +2499,9 @@ dependencies = [ [[package]] name = "h2" -version = "0.3.18" +version = "0.3.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "17f8a914c2987b688368b5138aa05321db91f4090cf26118185672ad588bce21" +checksum = "d357c7ae988e7d2182f7d7871d0b963962420b0678b0997ce7de72001aeab782" dependencies = [ "bytes", "fnv", @@ -2515,9 +2527,6 @@ name = "hashbrown" version = "0.12.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" -dependencies = [ - "ahash 0.7.6", -] [[package]] name = "hashbrown" @@ -2525,13 +2534,23 @@ version = "0.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "43a3c133739dddd0d2990f9a4bdf8eb4b21ef50e4851ca85ab661199821d510e" +[[package]] +name = "hashbrown" +version = "0.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2c6201b9ff9fd90a5a3bac2e56a830d0caa509576f0e503818ee82c181b3437a" +dependencies = [ + "ahash", + "allocator-api2", +] + [[package]] name = "hashlink" -version = "0.8.1" +version = "0.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "69fe1fcf8b4278d860ad0548329f892a3631fb63f82574df68275f34cdbe0ffa" +checksum = "312f66718a2d7789ffef4f4b7b213138ed9f1eb3aa1d0d82fc99f88fb3ffd26f" dependencies = [ - "hashbrown 0.12.3", + "hashbrown 0.14.0", ] [[package]] @@ -2575,11 +2594,11 @@ dependencies = [ [[package]] name = "home" -version = "0.5.4" +version = "0.5.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "747309b4b440c06d57b0b25f2aee03ee9b5e5397d288c60e21fc709bb98a7408" +checksum = "5444c27eef6923071f7ebcc33e3444508466a76f7a2b93da00ed6e19f30c1ddb" dependencies = [ - "winapi", + "windows-sys 0.48.0", ] [[package]] @@ -2656,7 +2675,7 @@ dependencies = [ "httpdate", "itoa", "pin-project-lite", - "socket2", + "socket2 0.4.9", "tokio", "tower-service", "tracing", @@ -2665,9 +2684,9 @@ dependencies = [ [[package]] name = "hyper-rustls" -version = "0.23.2" +version = "0.24.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1788965e61b367cd03a62950836d5cd41560c3577d90e40e0819373194d1661c" +checksum = "0646026eb1b3eea4cd9ba47912ea5ce9cc07713d105b1a14698f4e6433d348b7" dependencies = [ "http", "hyper", @@ -2702,9 +2721,9 @@ dependencies = [ [[package]] name = "idna" -version = "0.3.0" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e14ddfc70884202db2244c223200c204c2bda1bc6e0998d11b5e024d657209e6" +checksum = "7d20d6b07bfbc108882d88ed8e37d39636dcc260e15e30c45e6ba089610b917c" dependencies = [ "unicode-bidi", "unicode-normalization", @@ -2716,7 +2735,7 @@ version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e98c1d0ad70fc91b8b9654b1f33db55e59579d3b3de2bffdced0fdb810570cb8" dependencies = [ - "ahash 0.8.3", + "ahash", "hashbrown 0.12.3", ] @@ -2764,9 +2783,9 @@ dependencies = [ [[package]] name = "io-lifetimes" -version = "1.0.10" +version = "1.0.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c66c74d2ae7e79a5a8f7ac924adbe38ee42a859c6539ad869eb51f0b52dc220" +checksum = "eae7b9aee968036d54dce06cebaefd919e4472e753296daccd6d344e3e2df0c2" dependencies = [ "hermit-abi 0.3.1", "libc", @@ -2775,14 +2794,14 @@ dependencies = [ [[package]] name = "ipconfig" -version = "0.3.1" +version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bd302af1b90f2463a98fa5ad469fc212c8e3175a41c3068601bfa2727591c5be" +checksum = "b58db92f96b720de98181bbbe63c831e87005ab460c1bf306eb2622b4707997f" dependencies = [ - "socket2", + "socket2 0.5.3", "widestring", - "winapi", - "winreg", + "windows-sys 0.48.0", + "winreg 0.50.0", ] [[package]] @@ -2854,9 +2873,9 @@ dependencies = [ [[package]] name = "js-sys" -version = "0.3.61" +version = "0.3.64" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "445dde2150c55e483f3d8416706b97ec8e8237c307e5b7b4b8dd15e6af2a0730" +checksum = "c5f195fe497f702db0f318b07fdd68edb16955aed830df8363d837542f8f935a" dependencies = [ "wasm-bindgen", ] @@ -2904,15 +2923,15 @@ checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" [[package]] name = "libc" -version = "0.2.142" +version = "0.2.146" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6a987beff54b60ffa6d51982e1aa1146bc42f19bd26be28b0586f252fccf5317" +checksum = "f92be4933c13fd498862a9e02a3055f8a8d9c039ce33db97306fd5a6caa7f29b" [[package]] name = "libgit2-sys" -version = "0.14.2+1.5.1" +version = "0.15.2+1.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f3d95f6b51075fe9810a7ae22c7095f12b98005ab364d8544797a825ce946a4" +checksum = "a80df2e11fb4a61f4ba2ab42dbe7f74468da143f1a75c74e11dee7c813f694fa" dependencies = [ "cc", "libc", @@ -2934,9 +2953,9 @@ dependencies = [ [[package]] name = "libz-ng-sys" -version = "1.1.8" +version = "1.1.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4399ae96a9966bf581e726de86969f803a81b7ce795fcd5480e640589457e0f2" +checksum = "2468756f34903b582fe7154dc1ffdebd89d0562c4a43b53c621bb0f1b1043ccb" dependencies = [ "cmake", "libc", @@ -2944,9 +2963,9 @@ dependencies = [ [[package]] name = "libz-sys" -version = "1.1.8" +version = "1.1.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9702761c3935f8cc2f101793272e202c72b99da8f4224a19ddcf1279a6450bbf" +checksum = "56ee889ecc9568871456d42f603d6a0ce59ff328d291063a45cbdf0036baf6db" dependencies = [ "cc", "cmake", @@ -2963,9 +2982,9 @@ checksum = "0717cef1bc8b636c6e1c1bbdefc09e6322da8a9321966e8928ef80d20f7f770f" [[package]] name = "linux-raw-sys" -version = "0.3.3" +version = "0.3.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b085a4f2cde5781fc4b1717f2e86c62f5cda49de7ba99a7c2eae02b61c9064c" +checksum = "ef53942eb7bf7ff43a617b3e2c1c4a5ecf5944a7c1bc12d7ee39bbb15e5c1519" [[package]] name = "litrs" @@ -2975,9 +2994,9 @@ checksum = "f9275e0933cf8bb20f008924c0cb07a0692fe54d8064996520bf998de9eb79aa" [[package]] name = "lock_api" -version = "0.4.9" +version = "0.4.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "435011366fe56583b16cf956f9df0095b405b82d76425bc8981c0e22e60ec4df" +checksum = "c1cc9717a20b1bb222f333e6a92fd32f7d8a18ddc5a3191a11af45dcbf4dcd16" dependencies = [ "autocfg", "scopeguard", @@ -2985,11 +3004,10 @@ dependencies = [ [[package]] name = "log" -version = "0.4.17" +version = "0.4.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "abb12e687cfb44aa40f41fc3978ef76448f9b6038cad6aef4259d3c095a2382e" +checksum = "b06a4cde4c0f271a446782e3eff8de789548ce57dbc8eca9292c27f4a42004b4" dependencies = [ - "cfg-if", "value-bag", ] @@ -3068,9 +3086,9 @@ dependencies = [ [[package]] name = "memoffset" -version = "0.8.0" +version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d61c719bcfbcf5d62b3a09efa6088de8c54bc0bfcd3ea7ae39fcc186108b8de1" +checksum = "5a634b1c61a95585bd15607c6ab0c4e5b226e695ff2800ba0cdccddf208c406c" dependencies = [ "autocfg", ] @@ -3089,23 +3107,23 @@ checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" [[package]] name = "miniz_oxide" -version = "0.6.2" +version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b275950c28b37e794e8c55d88aeb5e139d0ce23fdbbeda68f8d7174abdf9e8fa" +checksum = "e7810e0be55b428ada41041c41f32c9f1a42817901b4ccf45fa3d4b6561e74c7" dependencies = [ "adler", ] [[package]] name = "mio" -version = "0.8.6" +version = "0.8.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b9d9a46eff5b4ff64b45a9e316a6d1e0bc719ef429cbec4dc630684212bfdf9" +checksum = "927a765cd3fc26206e66b296465fa9d3e5ab003e651c1b3c060e7956d96b19d2" dependencies = [ "libc", "log", "wasi", - "windows-sys 0.45.0", + "windows-sys 0.48.0", ] [[package]] @@ -3150,6 +3168,25 @@ dependencies = [ "minimal-lexical", ] +[[package]] +name = "ntapi" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e8a3895c6391c39d7fe7ebc444a87eb2991b2a0bc718fdabd071eec617fc68e4" +dependencies = [ + "winapi", +] + +[[package]] +name = "nu-ansi-term" +version = "0.46.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77a8165726e8236064dbb45459242600304b42a5ea24ee2948e18e023bf7ba84" +dependencies = [ + "overload", + "winapi", +] + [[package]] name = "num-traits" version = "0.2.15" @@ -3180,9 +3217,9 @@ dependencies = [ [[package]] name = "once_cell" -version = "1.17.1" +version = "1.18.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b7e5500299e16ebb147ae15a00a942af264cf3688f47923b8fc2cd5858f23ad3" +checksum = "dd8b5dd2ae5ed71462c540258bedcb51965123ad7e7ccf4b9a8cafaa4a63576d" [[package]] name = "oorandom" @@ -3202,9 +3239,9 @@ dependencies = [ [[package]] name = "openssl" -version = "0.10.51" +version = "0.10.54" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "97ea2d98598bf9ada7ea6ee8a30fb74f9156b63bbe495d64ec2b87c269d2dda3" +checksum = "69b3f656a17a6cbc115b5c7a40c616947d213ba182135b014d6051b73ab6f019" dependencies = [ "bitflags 1.3.2", "cfg-if", @@ -3223,7 +3260,7 @@ checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" dependencies = [ "proc-macro2", "quote", - "syn 2.0.15", + "syn 2.0.18", ] [[package]] @@ -3234,18 +3271,18 @@ checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" [[package]] name = "openssl-src" -version = "111.25.3+1.1.1t" +version = "111.26.0+1.1.1u" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "924757a6a226bf60da5f7dd0311a34d2b52283dd82ddeb103208ddc66362f80c" +checksum = "efc62c9f12b22b8f5208c23a7200a442b2e5999f8bdf80233852122b5a4f6f37" dependencies = [ "cc", ] [[package]] name = "openssl-sys" -version = "0.9.86" +version = "0.9.88" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "992bac49bdbab4423199c654a5515bd2a6c6a23bf03f2dd3bdb7e5ae6259bc69" +checksum = "c2ce0f250f34a308dcfdbb351f511359857d4ed2134ba715a4eadd46e1ffd617" dependencies = [ "cc", "libc", @@ -3256,9 +3293,9 @@ dependencies = [ [[package]] name = "os_str_bytes" -version = "6.5.0" +version = "6.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ceedf44fb00f2d1984b0bc98102627ce622e083e49a5bacdb3e514fa4238e267" +checksum = "4d5d9eb14b174ee9aa2ef96dc2b94637a2d4b6e7cb873c7e171f0c20c6cf3eac" [[package]] name = "output_vt100" @@ -3269,6 +3306,12 @@ dependencies = [ "winapi", ] +[[package]] +name = "overload" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b15813163c1d831bf4a13c3610c05c0d03b39feb07f7e09fa234dac9b15aaf39" + [[package]] name = "owo-colors" version = "3.5.0" @@ -3304,15 +3347,15 @@ dependencies = [ [[package]] name = "parking_lot_core" -version = "0.9.7" +version = "0.9.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9069cbb9f99e3a5083476ccb29ceb1de18b9118cafa53e90c9551235de2b9521" +checksum = "93f00c865fe7cabf650081affecd3871070f26767e7b2070a3ffae14c654b447" dependencies = [ "cfg-if", "libc", - "redox_syscall 0.2.16", + "redox_syscall 0.3.5", "smallvec", - "windows-sys 0.45.0", + "windows-targets 0.48.0", ] [[package]] @@ -3323,9 +3366,9 @@ checksum = "8835116a5c179084a830efb3adc117ab007512b535bc1a21c991d3b32a6b44dd" [[package]] name = "percent-encoding" -version = "2.2.0" +version = "2.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "478c572c3d73181ff3c2539045f6eb99e5491218eae919370993b890cdbdd98e" +checksum = "9b2a4787296e9989611394c33f193f676704af1686e70b8f8033ab5ba9a35a94" [[package]] name = "pin-project-lite" @@ -3341,9 +3384,9 @@ checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" [[package]] name = "pkg-config" -version = "0.3.26" +version = "0.3.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ac9a59f73473f1b8d852421e59e64809f025994837ef743615c6d0c5b305160" +checksum = "26072860ba924cbfa98ea39c8c19b4dd6a4a25423dbdf219c1eca91aa0cf6964" [[package]] name = "plotters" @@ -3409,9 +3452,9 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.56" +version = "1.0.60" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2b63bdb0cd06f1f4dedf69b254734f9b45af66e4a031e42a7480257d9898b435" +checksum = "dec2b086b7a862cf4de201096214fa870344cf922b2b30c167badb3af3195406" dependencies = [ "unicode-ident", ] @@ -3457,9 +3500,9 @@ dependencies = [ [[package]] name = "pulldown-cmark" -version = "0.9.2" +version = "0.9.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2d9cc634bc78768157b5cbfe988ffcd1dcba95cd2b2f03a88316c08c6d00ed63" +checksum = "77a1a2f1f0a7ecff9c31abbe177637be0e97a0aef46cf8738ece09327985d998" dependencies = [ "bitflags 1.3.2", "getopts", @@ -3475,9 +3518,9 @@ checksum = "a1d01941d82fa2ab50be1e79e6714289dd7cde78eba4c074bc5a4374f650dfe0" [[package]] name = "quote" -version = "1.0.26" +version = "1.0.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4424af4bf778aae2051a77b60283332f386554255d722233d09fbfc7e30da2fc" +checksum = "1b9ab9c7eadfd8df19006f1cf1a4aed13540ed5cbc047010ece5826e10825488" dependencies = [ "proc-macro2", ] @@ -3567,9 +3610,9 @@ dependencies = [ [[package]] name = "regex" -version = "1.8.0" +version = "1.8.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac6cf59af1067a3fb53fbe5c88c053764e930f932be1d71d3ffe032cbe147f59" +checksum = "d0ab3ca65655bb1e41f2a8c8cd662eb4fb035e67c3f78da1d61dffe89d07300f" dependencies = [ "aho-corasick", "memchr", @@ -3584,15 +3627,15 @@ checksum = "6c230d73fb8d8c1b9c0b3135c5142a8acee3a0558fb8db5cf1cb65f8d7862132" [[package]] name = "regex-syntax" -version = "0.7.0" +version = "0.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6868896879ba532248f33598de5181522d8b3d9d724dfd230911e1a7d4822f5" +checksum = "436b050e76ed2903236f032a59761c1eb99e1b0aead2c257922771dab1fc8c78" [[package]] name = "reqwest" -version = "0.11.16" +version = "0.11.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "27b71749df584b7f4cac2c426c127a7c785a5106cc98f7a8feb044115f0fa254" +checksum = "cde824a14b7c14f85caff81225f411faacc04a2013f41670f41443742b1c1c55" dependencies = [ "base64", "bytes", @@ -3628,7 +3671,7 @@ dependencies = [ "wasm-bindgen-futures", "web-sys", "webpki-roots", - "winreg", + "winreg 0.10.1", ] [[package]] @@ -3662,7 +3705,7 @@ version = "0.29.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "549b9d036d571d42e6e85d1c1425e2ac83491075078ca9a15be021c56b1641f2" dependencies = [ - "bitflags 2.1.0", + "bitflags 2.3.2", "fallible-iterator", "fallible-streaming-iterator", "hashlink", @@ -3678,9 +3721,9 @@ checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2" [[package]] name = "rustix" -version = "0.37.13" +version = "0.37.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f79bef90eb6d984c72722595b5b1348ab39275a5e5123faca6863bf07d75a4e0" +checksum = "b96e891d04aa506a6d1f318d2771bcb1c7dfda84e126660ace067c9b474bb2c0" dependencies = [ "bitflags 1.3.2", "errno", @@ -3692,14 +3735,14 @@ dependencies = [ [[package]] name = "rustls" -version = "0.20.8" +version = "0.21.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fff78fc74d175294f4e83b28343315ffcfb114b156f0185e9741cb5570f50e2f" +checksum = "e32ca28af694bc1bbf399c33a516dbdf1c90090b8ab23c2bc24f834aa2247f5f" dependencies = [ "log", "ring", + "rustls-webpki", "sct", - "webpki", ] [[package]] @@ -3711,6 +3754,16 @@ dependencies = [ "base64", ] +[[package]] +name = "rustls-webpki" +version = "0.100.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d6207cd5ed3d8dca7816f8f3725513a34609c0c765bf652b8c3cb4cfd87db46b" +dependencies = [ + "ring", + "untrusted", +] + [[package]] name = "ryu" version = "1.0.13" @@ -3753,9 +3806,9 @@ dependencies = [ [[package]] name = "security-framework" -version = "2.8.2" +version = "2.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a332be01508d814fed64bf28f798a146d73792121129962fdf335bb3c49a4254" +checksum = "1fc758eb7bffce5b308734e9b0c1468893cae9ff70ebf13e7090be8dcbcc83a8" dependencies = [ "bitflags 1.3.2", "core-foundation", @@ -3766,9 +3819,9 @@ dependencies = [ [[package]] name = "security-framework-sys" -version = "2.8.0" +version = "2.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "31c9bb296072e961fcbd8853511dd39c2d8be2deb1e17c6860b1d30732b323b4" +checksum = "f51d0c0d83bec45f16480d0ce0058397a69e48fcdc52d1dc8855fb68acbd31a7" dependencies = [ "core-foundation-sys", "libc", @@ -3785,29 +3838,29 @@ dependencies = [ [[package]] name = "serde" -version = "1.0.160" +version = "1.0.164" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bb2f3770c8bce3bcda7e149193a069a0f4365bda1fa5cd88e03bca26afc1216c" +checksum = "9e8c8cf938e98f769bc164923b06dce91cea1751522f46f8466461af04c9027d" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.160" +version = "1.0.164" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "291a097c63d8497e00160b166a967a4a79c64f3facdd01cbd7502231688d77df" +checksum = "d9735b638ccc51c28bf6914d90a2e9725b377144fc612c49a611fddd1b631d68" dependencies = [ "proc-macro2", "quote", - "syn 2.0.15", + "syn 2.0.18", ] [[package]] name = "serde_json" -version = "1.0.96" +version = "1.0.97" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "057d394a50403bcac12672b2b18fb387ab6d289d957dab67dd201875391e52f1" +checksum = "bdf3bf93142acad5821c99197022e170842cdbc1c30482b98750c688c640842a" dependencies = [ "itoa", "ryu", @@ -3816,9 +3869,9 @@ dependencies = [ [[package]] name = "serde_spanned" -version = "0.6.1" +version = "0.6.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0efd8caf556a6cebd3b285caf480045fcc1ac04f6bd786b09a6f11af30c4fcf4" +checksum = "93107647184f6027e3b7dcb2e11034cf95ffa1e3a682c67951963ac69c1c007d" dependencies = [ "serde", ] @@ -3855,7 +3908,7 @@ checksum = "91d129178576168c589c9ec973feedf7d3126c01ac2bf08795109aa35b69fb8f" dependencies = [ "proc-macro2", "quote", - "syn 2.0.15", + "syn 2.0.18", ] [[package]] @@ -3885,6 +3938,15 @@ version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ae1a47186c03a32177042e55dbc5fd5aee900b8e0069a8d70fba96a9375cd012" +[[package]] +name = "sharded-slab" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "900fba806f70c630b0a382d0d825e17a0f19fcd059a2ade1ff237bcddf446b31" +dependencies = [ + "lazy_static", +] + [[package]] name = "signal-hook" version = "0.3.15" @@ -3958,6 +4020,16 @@ dependencies = [ "winapi", ] +[[package]] +name = "socket2" +version = "0.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2538b18701741680e0322a2302176d3253a35388e2e62f172f64f4f16605f877" +dependencies = [ + "libc", + "windows-sys 0.48.0", +] + [[package]] name = "spin" version = "0.5.2" @@ -3995,15 +4067,29 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.15" +version = "2.0.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a34fcf3e8b60f57e6a14301a2e916d323af98b0ea63c599441eec8558660c822" +checksum = "32d41677bcbe24c20c52e7c70b0d8db04134c5d1066bf98662e2871ad200ea3e" dependencies = [ "proc-macro2", "quote", "unicode-ident", ] +[[package]] +name = "sysinfo" +version = "0.29.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9557d0845b86eea8182f7b10dff120214fb6cd9fd937b6f4917714e546a38695" +dependencies = [ + "cfg-if", + "core-foundation-sys", + "libc", + "ntapi", + "once_cell", + "winapi", +] + [[package]] name = "tabled" version = "0.10.0" @@ -4026,15 +4112,16 @@ dependencies = [ [[package]] name = "tempfile" -version = "3.5.0" +version = "3.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b9fbec84f381d5795b08656e4912bec604d162bff9291d6189a78f4c8ab87998" +checksum = "31c0432476357e58790aaa47a8efb0c5138f137343f3b5f23bd36a27e3b0a6d6" dependencies = [ + "autocfg", "cfg-if", "fastrand", "redox_syscall 0.3.5", "rustix", - "windows-sys 0.45.0", + "windows-sys 0.48.0", ] [[package]] @@ -4069,14 +4156,24 @@ checksum = "f9456a42c5b0d803c8cd86e73dd7cc9edd429499f37a3550d286d5e86720569f" dependencies = [ "proc-macro2", "quote", - "syn 2.0.15", + "syn 2.0.18", +] + +[[package]] +name = "thread_local" +version = "1.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3fdd6f064ccff2d6567adcb3873ca630700f00b5ad3f060c25b5dcfd9a4ce152" +dependencies = [ + "cfg-if", + "once_cell", ] [[package]] name = "time" -version = "0.3.20" +version = "0.3.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cd0cbfecb4d19b5ea75bb31ad904eb5b9fa13f21079c3b92017ebdf4999a5890" +checksum = "ea9e1b3cf1243ae005d9e74085d4d542f3125458f3a81af210d901dcd7411efd" dependencies = [ "itoa", "libc", @@ -4088,15 +4185,15 @@ dependencies = [ [[package]] name = "time-core" -version = "0.1.0" +version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2e153e1f1acaef8acc537e68b44906d2db6436e2b35ac2c6b42640fff91f00fd" +checksum = "7300fbefb4dadc1af235a9cef3737cea692a9d97e1b9cbcd4ebdae6f8868e6fb" [[package]] name = "time-macros" -version = "0.2.8" +version = "0.2.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fd80a657e71da814b8e5d60d3374fc6d35045062245d80224748ae522dd76f36" +checksum = "372950940a5f07bf38dbe211d7283c9e6d7327df53794992d293e534c733d09b" dependencies = [ "time-core", ] @@ -4128,9 +4225,9 @@ checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" [[package]] name = "tokio" -version = "1.27.0" +version = "1.28.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d0de47a4eecbe11f498978a9b29d792f0d2692d1dd003650c24c76510e3bc001" +checksum = "94d7b1cfd2aa4011f2de74c2c4c63665e27a71006b0a192dcd2710272e73dfa2" dependencies = [ "autocfg", "bytes", @@ -4138,8 +4235,8 @@ dependencies = [ "mio", "num_cpus", "pin-project-lite", - "socket2", - "windows-sys 0.45.0", + "socket2 0.4.9", + "windows-sys 0.48.0", ] [[package]] @@ -4154,20 +4251,19 @@ dependencies = [ [[package]] name = "tokio-rustls" -version = "0.23.4" +version = "0.24.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c43ee83903113e03984cb9e5cebe6c04a5116269e900e3ddba8f068a62adda59" +checksum = "c28327cf380ac148141087fbfb9de9d7bd4e84ab5d2c28fbc911d753de8a7081" dependencies = [ "rustls", "tokio", - "webpki", ] [[package]] name = "tokio-util" -version = "0.7.7" +version = "0.7.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5427d89453009325de0d8f342c9490009f76e999cb7672d77e46267448f7e6b2" +checksum = "806fe8c2c87eccc8b3267cbae29ed3ab2d0bd37fca70ab622e46aaa9375ddb7d" dependencies = [ "bytes", "futures-core", @@ -4179,9 +4275,9 @@ dependencies = [ [[package]] name = "toml" -version = "0.7.3" +version = "0.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b403acf6f2bb0859c93c7f0d967cb4a75a7ac552100f9322faf64dc047669b21" +checksum = "d6135d499e69981f9ff0ef2167955a5333c35e36f6937d382974566b3d5b94ec" dependencies = [ "serde", "serde_spanned", @@ -4191,18 +4287,18 @@ dependencies = [ [[package]] name = "toml_datetime" -version = "0.6.1" +version = "0.6.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3ab8ed2edee10b50132aed5f331333428b011c99402b5a534154ed15746f9622" +checksum = "5a76a9312f5ba4c2dec6b9161fdf25d87ad8a09256ccea5a556fef03c706a10f" dependencies = [ "serde", ] [[package]] name = "toml_edit" -version = "0.19.8" +version = "0.19.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "239410c8609e8125456927e6707163a3b1fdb40561e4b803bc041f466ccfdc13" +checksum = "2380d56e8670370eee6566b0bfd4265f65b3f432e8c6d85623f728d4fa31f739" dependencies = [ "indexmap", "serde", @@ -4231,22 +4327,61 @@ dependencies = [ [[package]] name = "tracing-attributes" -version = "0.1.23" +version = "0.1.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4017f8f45139870ca7e672686113917c71c7a6e02d4924eda67186083c03081a" +checksum = "0f57e3ca2a01450b1a921183a9c9cbfda207fd822cef4ccb00a65402cbba7a74" dependencies = [ "proc-macro2", "quote", - "syn 1.0.109", + "syn 2.0.18", ] [[package]] name = "tracing-core" -version = "0.1.30" +version = "0.1.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "24eb03ba0eab1fd845050058ce5e616558e8f8d8fca633e6b163fe25c797213a" +checksum = "0955b8137a1df6f1a2e9a37d8a6656291ff0297c1a97c24e0d8425fe2312f79a" dependencies = [ "once_cell", + "valuable", +] + +[[package]] +name = "tracing-forest" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "119324027fc01804d9f83aefb7d80fda2e8fbe7c28e0acc59187cbd751a12915" +dependencies = [ + "serde", + "smallvec", + "thiserror", + "tracing", + "tracing-subscriber", +] + +[[package]] +name = "tracing-log" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "78ddad33d2d10b1ed7eb9d1f518a5674713876e97e5bb9b7345a7984fbb4f922" +dependencies = [ + "lazy_static", + "log", + "tracing-core", +] + +[[package]] +name = "tracing-subscriber" +version = "0.3.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "30a651bc37f915e81f087d86e62a18eec5f79550c7faff886f7090b4ea757c77" +dependencies = [ + "nu-ansi-term", + "sharded-slab", + "smallvec", + "thread_local", + "tracing-core", + "tracing-log", ] [[package]] @@ -4350,9 +4485,9 @@ checksum = "98e90c70c9f0d4d1ee6d0a7d04aa06cb9bbd53d8cfbdd62a0269a7c2eb640552" [[package]] name = "unicode-ident" -version = "1.0.8" +version = "1.0.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e5464a87b239f13a63a501f2701565754bae92d243d4bb7eb12f6d57d2269bf4" +checksum = "b15811caf2415fb889178633e7724bad2509101cde276048e013b9def5e51fa0" [[package]] name = "unicode-normalization" @@ -4383,12 +4518,12 @@ checksum = "a156c684c91ea7d62626509bce3cb4e1d9ed5c4d978f7b4352658f96a4c26b4a" [[package]] name = "url" -version = "2.3.1" +version = "2.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0d68c799ae75762b8c3fe375feb6600ef5602c883c5d21eb51c09f22b83c4643" +checksum = "50bff7831e19200a85b17131d085c25d7811bc4e186efdaf54bbd132994a88cb" dependencies = [ "form_urlencoded", - "idna 0.3.0", + "idna 0.4.0", "percent-encoding", ] @@ -4398,15 +4533,17 @@ version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "711b9620af191e0cdc7468a8d14e709c3dcdb115b36f838e601583af800a370a" +[[package]] +name = "valuable" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "830b7e5d4d90034032940e4ace0d9a9a057e7a45cd94e6c007832e39edb82f6d" + [[package]] name = "value-bag" -version = "1.0.0-alpha.9" +version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2209b78d1249f7e6f3293657c9779fe31ced465df091bbd433a1cf88e916ec55" -dependencies = [ - "ctor", - "version_check", -] +checksum = "a4d330786735ea358f3bc09eea4caa098569c1c93f342d9aca0514915022fe7e" [[package]] name = "vcpkg" @@ -4438,11 +4575,10 @@ dependencies = [ [[package]] name = "want" -version = "0.3.0" +version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ce8a968cb1cd110d136ff8b819a556d6fb6d919363c61534f6860c7eb172ba0" +checksum = "bfa7760aed19e106de2c7c0b581b509f2f25d3dacaf737cb82ac61bc6d760b0e" dependencies = [ - "log", "try-lock", ] @@ -4454,9 +4590,9 @@ checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" [[package]] name = "wasm-bindgen" -version = "0.2.84" +version = "0.2.87" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "31f8dcbc21f30d9b8f2ea926ecb58f6b91192c17e9d33594b3df58b2007ca53b" +checksum = "7706a72ab36d8cb1f80ffbf0e071533974a60d0a308d01a5d0375bf60499a342" dependencies = [ "cfg-if", "wasm-bindgen-macro", @@ -4464,24 +4600,24 @@ dependencies = [ [[package]] name = "wasm-bindgen-backend" -version = "0.2.84" +version = "0.2.87" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "95ce90fd5bcc06af55a641a86428ee4229e44e07033963a2290a8e241607ccb9" +checksum = "5ef2b6d3c510e9625e5fe6f509ab07d66a760f0885d858736483c32ed7809abd" dependencies = [ "bumpalo", "log", "once_cell", "proc-macro2", "quote", - "syn 1.0.109", + "syn 2.0.18", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-futures" -version = "0.4.34" +version = "0.4.37" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f219e0d211ba40266969f6dbdd90636da12f75bee4fc9d6c23d1260dadb51454" +checksum = "c02dbc21516f9f1f04f187958890d7e6026df8d16540b7ad9492bc34a67cea03" dependencies = [ "cfg-if", "js-sys", @@ -4491,9 +4627,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro" -version = "0.2.84" +version = "0.2.87" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c21f77c0bedc37fd5dc21f897894a5ca01e7bb159884559461862ae90c0b4c5" +checksum = "dee495e55982a3bd48105a7b947fd2a9b4a8ae3010041b9e0faab3f9cd028f1d" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -4501,28 +4637,28 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.84" +version = "0.2.87" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2aff81306fcac3c7515ad4e177f521b5c9a15f2b08f4e32d823066102f35a5f6" +checksum = "54681b18a46765f095758388f2d0cf16eb8d4169b639ab575a8f5693af210c7b" dependencies = [ "proc-macro2", "quote", - "syn 1.0.109", + "syn 2.0.18", "wasm-bindgen-backend", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-shared" -version = "0.2.84" +version = "0.2.87" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0046fef7e28c3804e5e38bfa31ea2a0f73905319b677e57ebe37e49358989b5d" +checksum = "ca6ad05a4870b2bf5fe995117d3728437bd27d7cd5f06f13c17443ef369775a1" [[package]] name = "web-sys" -version = "0.3.61" +version = "0.3.64" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e33b99f4b23ba3eec1a53ac264e35a755f00e966e0065077d6027c0f575b0b97" +checksum = "9b85cbef8c220a6abc02aefd892dfc0fc23afb1c6a426316ec33253a3877249b" dependencies = [ "js-sys", "wasm-bindgen", @@ -4549,9 +4685,9 @@ dependencies = [ [[package]] name = "widestring" -version = "0.5.1" +version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "17882f045410753661207383517a6f62ec3dbeb6a4ed2acce01f0728238d1983" +checksum = "653f141f39ec16bba3c5abe400a0c60da7468261cc2cbf36805022876bc721a8" [[package]] name = "winapi" @@ -4751,9 +4887,9 @@ checksum = "1a515f5799fe4961cb532f983ce2b23082366b898e52ffbce459c86f67c8378a" [[package]] name = "winnow" -version = "0.4.1" +version = "0.4.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ae8970b36c66498d8ff1d66685dc86b91b29db0c7739899012f63a63814b4b28" +checksum = "ca0ace3845f0d96209f0375e6d367e3eb87eb65d27d445bdc9f1843a26f39448" dependencies = [ "memchr", ] @@ -4767,6 +4903,16 @@ dependencies = [ "winapi", ] +[[package]] +name = "winreg" +version = "0.50.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "524e57b2c537c0f9b1e69f1965311ec12182b4122e45035b1508cd24d2adadb1" +dependencies = [ + "cfg-if", + "windows-sys 0.48.0", +] + [[package]] name = "xz2" version = "0.1.7" diff --git a/Cargo.toml b/Cargo.toml index 5930c96168e..7b2eb2f5f77 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -32,7 +32,7 @@ default = ["max"] ## Everything, all at once. ## -## As fast as possible, with TUI progress, progress line rendering with auto-configuration, all transports based on their most mature implementation (HTTP), all `ein` tools, CLI colors and local-time support, JSON output, regex support for rev-specs. +## As fast as possible, tracing, with TUI progress, progress line rendering with auto-configuration, all transports based on their most mature implementation (HTTP), all `ein` tools, CLI colors and local-time support, JSON output, regex support for rev-specs. max = ["max-control", "fast", "gitoxide-core-blocking-client", "http-client-curl"] ## Like `max`, but only Rust is allowed. @@ -44,12 +44,12 @@ max = ["max-control", "fast", "gitoxide-core-blocking-client", "http-client-curl max-pure = ["max-control", "gix-features/rustsha1", "gix-features/zlib-rust-backend", "http-client-reqwest", "gitoxide-core-blocking-client" ] ## Like `max`, but with more control for configuration. See the *Package Maintainers* headline for more information. -max-control = ["fast-safe", "pretty-cli", "gitoxide-core-tools-query", "gitoxide-core-tools", "prodash-render-line", "prodash-render-tui", "prodash/render-line-autoconfigure", "gix/regex" ] +max-control = ["tracing", "fast-safe", "pretty-cli", "gitoxide-core-tools-query", "gitoxide-core-tools-corpus", "gitoxide-core-tools", "prodash-render-line", "prodash-render-tui", "prodash/render-line-autoconfigure", "gix/regex" ] ## All of the good stuff, with less fanciness for smaller binaries. ## ## As fast as possible, progress line rendering, all transports based on their most mature implementation (HTTP), all `ein` tools, CLI colors and local-time support, JSON output. -lean = ["fast", "pretty-cli", "http-client-curl", "gitoxide-core-tools-query", "gitoxide-core-tools", "gitoxide-core-blocking-client", "prodash-render-line" ] +lean = ["fast", "tracing", "pretty-cli", "http-client-curl", "gitoxide-core-tools-query", "gitoxide-core-tools-corpus", "gitoxide-core-tools", "gitoxide-core-blocking-client", "prodash-render-line" ] ## The smallest possible build, best suitable for small single-core machines. ## @@ -67,7 +67,7 @@ small = ["pretty-cli", "gix-features/rustsha1", "gix-features/zlib-rust-backend" ## ## Due to async client-networking not being implemented for most transports, this one supports only the 'git+tcp' and HTTP transport. ## It uses, however, a fully asynchronous networking implementation which can serve a real-world example on how to implement custom async transports. -lean-async = ["fast", "pretty-cli", "gitoxide-core-tools", "gitoxide-core-tools-query", "gitoxide-core-async-client", "prodash-render-line"] +lean-async = ["fast", "tracing", "pretty-cli", "gitoxide-core-tools", "gitoxide-core-tools-query", "gitoxide-core-tools-corpus", "gitoxide-core-async-client", "prodash-render-line"] #! ### Package Maintainers #! `*-control` features leave it to you to configure C libraries, involving choices for `zlib`, ! hashing and transport implementation. @@ -105,6 +105,9 @@ fast = ["gix/max-performance", "gix/comfort"] ## If disabled, the binary will be visibly smaller. fast-safe = ["gix/max-performance-safe", "gix/comfort"] +## Enable tracing in `gitoxide-core`. +tracing = ["dep:tracing-forest", "dep:tracing-subscriber", "dep:tracing", "gix-features/tracing", "gix-features/tracing-detail" ] + ## Use `clap` 3.0 to build the prettiest, best documented and most user-friendly CLI at the expense of binary size. ## Provides a terminal user interface for detailed and exhaustive progress. ## Provides a line renderer for leaner progress display, without the need for a full-blown TUI. @@ -128,7 +131,10 @@ cache-efficiency-debug = ["gix-features/cache-efficiency-debug"] gitoxide-core-tools = ["gitoxide-core/organize", "gitoxide-core/estimate-hours"] ## A program to perform analytics on a `git` repository, using an auto-maintained sqlite database -gitoxide-core-tools-query = ["gitoxide-core-tools", "gitoxide-core/query"] +gitoxide-core-tools-query = ["gitoxide-core/query"] + +## A program to run algorithms on a corpus of repositories, recording each run for later comparison. +gitoxide-core-tools-corpus = ["gitoxide-core/corpus"] #! ### Building Blocks for mutually exclusive networking #! Blocking and async features are mutually exclusive and cause a compile-time error. This also means that `cargo … --all-features` will fail. @@ -165,6 +171,11 @@ env_logger = { version = "0.10.0", default-features = false } crosstermion = { version = "0.11.0", optional = true, default-features = false } futures-lite = { version = "1.12.0", optional = true, default-features = false, features = ["std"] } +# for 'tracing' +tracing-forest = { version = "0.1.5", features = ["serde"], optional = true } +tracing-subscriber = { version = "0.3.17", optional = true } +tracing = { version = "0.1.37", optional = true } + # for progress owo-colors = "3.5.0" tabled = { version = "0.10.0", default-features = false } @@ -208,6 +219,7 @@ members = [ "gix-config-value", "gix-discover", "gix-features", + "gix-trace", "gix-commitgraph", "gix-chunk", "gix-quote", diff --git a/STABILITY.md b/STABILITY.md index 4f9ce78d624..a945d73c0ba 100644 --- a/STABILITY.md +++ b/STABILITY.md @@ -126,7 +126,7 @@ Minor version updates for new features can be released when needed assuming ther The MSRV is automatically assumed to be the latest stable version for all crates with the following exception: `gix` and all it's dependencies must adhere to an MSRV, as validated by the `msrv.yml` GitHub workflow. -Increasing the MSRV is considered a breaking change and warrants a major version bump itself for stable crates and a minor version bump for IDP crates. +Increasing the MSRV is *not* considered a breaking change like is the case for most other crates in the community. Please let us know if you have other requirement and we see if we can provide stability guarantees for it or reduce the MSRV to a given version. diff --git a/build.rs b/build.rs new file mode 100644 index 00000000000..31619ef07f3 --- /dev/null +++ b/build.rs @@ -0,0 +1,17 @@ +use std::process::Command; + +fn main() { + let version = Command::new(if cfg!(windows) { "git.exe" } else { "git" }) + .args(["describe", "--match=v*\\.*\\.*"]) + .output() + .ok() + .and_then(|out| parse_describe(&out.stdout)) + .unwrap_or_else(|| env!("CARGO_PKG_VERSION").into()); + + println!("cargo:rustc-env=GITOXIDE_VERSION={version}"); +} + +fn parse_describe(input: &[u8]) -> Option { + let input = std::str::from_utf8(input).ok()?; + input.trim().to_owned().into() +} diff --git a/cargo-smart-release/build.rs b/cargo-smart-release/build.rs new file mode 100644 index 00000000000..20ecf3f7c0e --- /dev/null +++ b/cargo-smart-release/build.rs @@ -0,0 +1,17 @@ +use std::process::Command; + +fn main() { + let version = Command::new(if cfg!(windows) { "git.exe" } else { "git" }) + .args(["describe", "--match=cargo-smart-release-*"]) + .output() + .ok() + .and_then(|out| parse_describe(&out.stdout)) + .unwrap_or_else(|| env!("CARGO_PKG_VERSION").into()); + + println!("cargo:rustc-env=CARGO_SMART_RELEASE_VERSION={version}"); +} + +fn parse_describe(input: &[u8]) -> Option { + let input = std::str::from_utf8(input).ok()?; + input.trim().to_owned().into() +} diff --git a/cargo-smart-release/src/cli/options.rs b/cargo-smart-release/src/cli/options.rs index d1617c89eff..026900d2ce1 100644 --- a/cargo-smart-release/src/cli/options.rs +++ b/cargo-smart-release/src/cli/options.rs @@ -13,7 +13,7 @@ pub struct Args { #[derive(clap::Parser)] pub enum SubCommands { - #[clap(name = "smart-release", version = clap::crate_version!())] + #[clap(name = "smart-release", version = env!("CARGO_SMART_RELEASE_VERSION"))] /// Release workspace crates fearlessly. /// /// Use --execute to actually perform the operation. @@ -162,7 +162,7 @@ pub enum SubCommands { #[clap(long, help_heading = Some("CHANGELOG"))] capitalize_commit: bool, }, - #[clap(name = "changelog", version = clap::crate_version!())] + #[clap(name = "changelog", version = env!("CARGO_SMART_RELEASE_VERSION"))] /// Generate changelogs from commit histories, non-destructively. /// /// Use --write to actually write generated changelogs diff --git a/clippy.toml b/clippy.toml index 22fd4be7375..e034672c769 100644 --- a/clippy.toml +++ b/clippy.toml @@ -1 +1 @@ -msrv = "1.64.0" +msrv = "1.65.0" diff --git a/gitoxide-core/Cargo.toml b/gitoxide-core/Cargo.toml index 3dc0dd5ed63..b814f130a42 100644 --- a/gitoxide-core/Cargo.toml +++ b/gitoxide-core/Cargo.toml @@ -21,6 +21,9 @@ organize = ["dep:gix-url", "dep:jwalk"] estimate-hours = ["dep:itertools", "dep:fs-err", "dep:crossbeam-channel", "dep:smallvec"] ## Gather information about repositories and store it in a database for easy querying. query = ["dep:rusqlite"] +## Run algorithms on a corpus of repositories and store their results for later comparison and intelligence gathering. +## *Note that* `organize` we need for finding git repositories fast. +corpus = [ "dep:rusqlite", "dep:sysinfo", "organize", "dep:crossbeam-channel", "dep:serde_json", "dep:tracing-forest", "dep:tracing-subscriber", "dep:tracing" ] #! ### Mutually Exclusive Networking #! If both are set, _blocking-client_ will take precedence, allowing `--all-features` to be used. @@ -33,7 +36,7 @@ async-client = ["gix/async-network-client-async-std", "gix-transport-configurati #! ### Other ## Data structures implement `serde::Serialize` and `serde::Deserialize`. -serde = ["gix/serde", "serde_json", "dep:serde", "bytesize/serde"] +serde = ["gix/serde", "dep:serde_json", "dep:serde", "bytesize/serde"] [dependencies] @@ -45,7 +48,6 @@ serde = { version = "1.0.114", optional = true, default-features = false, featur anyhow = "1.0.42" thiserror = "1.0.34" bytesize = "1.0.1" -serde_json = { version = "1.0.65", optional = true } tempfile = "3.1.0" # for async-client @@ -66,9 +68,16 @@ fs-err = { version = "2.6.0", optional = true } crossbeam-channel = { version = "0.5.6", optional = true } smallvec = { version = "1.10.0", optional = true } -# for 'query' +# for 'query' and 'corpus' rusqlite = { version = "0.29.0", optional = true, features = ["bundled"] } +# for 'corpus' +sysinfo = { version = "0.29.2", optional = true, default-features = false } +serde_json = { version = "1.0.65", optional = true } +tracing-forest = { version = "0.1.5", features = ["serde"], optional = true } +tracing-subscriber = { version = "0.3.17", optional = true } +tracing = { version = "0.1.37", optional = true } + # for svg graph output layout-rs = "0.1.1" open = "4.1.0" diff --git a/gitoxide-core/src/corpus/db.rs b/gitoxide-core/src/corpus/db.rs new file mode 100644 index 00000000000..b861b070e24 --- /dev/null +++ b/gitoxide-core/src/corpus/db.rs @@ -0,0 +1,213 @@ +use crate::corpus::{Engine, Run}; +use anyhow::{bail, Context}; +use bytesize::ByteSize; +use rusqlite::{params, OptionalExtension}; +use std::path::{Path, PathBuf}; +use sysinfo::{CpuExt, CpuRefreshKind, RefreshKind, SystemExt}; + +pub(crate) type Id = u32; + +/// a husk of a repository +pub(crate) struct Repo { + pub(crate) id: Id, + /// The full path to the repository on disk, not yet validated to exist. + pub(crate) path: PathBuf, + /// The size of the object database, counted quickly by packs only. + pub(crate) odb_size: ByteSize, + /// The amount of objects stored in the object database. + pub(crate) num_objects: u64, + /// The total amount of references, no matter which type. + pub(crate) num_references: usize, +} + +impl Repo { + pub(crate) fn try_from(repo: &gix::Repository) -> anyhow::Result { + let num_references = repo.refs.iter()?.all()?.count(); + let num_objects = repo.objects.packed_object_count()?; + let odb_size = ByteSize( + std::fs::read_dir(repo.objects.store_ref().path().join("pack")) + .map(|dir| { + dir.filter_map(Result::ok) + .filter_map(|e| e.metadata().ok()) + .filter_map(|m| m.is_file().then_some(m.len())) + .sum() + }) + .unwrap_or_default(), + ); + + Ok(Repo { + id: 0, + path: repo.path().to_owned(), + odb_size, + num_objects, + num_references, + }) + } +} + +/// A version to be incremented whenever the database layout is changed, to refresh it automatically. +const VERSION: usize = 1; + +pub fn create(path: impl AsRef) -> anyhow::Result { + let path = path.as_ref(); + let con = rusqlite::Connection::open(path)?; + let meta_table = r#" + CREATE TABLE if not exists meta( + version int + )"#; + con.execute_batch(meta_table)?; + let version: Option = con.query_row("SELECT version FROM meta", [], |r| r.get(0)).optional()?; + match version { + None => { + con.execute("INSERT into meta(version) values(?)", params![VERSION])?; + } + Some(version) if version != VERSION => match con.close() { + Ok(()) => { + bail!("Cannot handle database with version {version}, cannot yet migrate to {VERSION} - maybe migrate by hand?"); + } + Err((_, err)) => return Err(err.into()), + }, + _ => {} + } + con.execute_batch("PRAGMA synchronous = OFF; PRAGMA journal_mode = WAL; PRAGMA wal_checkpoint(FULL); ")?; + con.execute_batch( + r#" + CREATE TABLE if not exists runner( + id integer PRIMARY KEY, + vendor text, + brand text, + host_name text, -- this is just to help ID the runner + UNIQUE (vendor, brand) + ) + "#, + )?; + con.execute_batch( + r#" + CREATE TABLE if not exists corpus( + id integer PRIMARY KEY, + root text UNIQUE -- the root path of all repositories we want to consider, as canonicalized path + ) + "#, + )?; + con.execute_batch( + r#" + CREATE TABLE if not exists repository( + id integer PRIMARY KEY, + rela_path text, -- the path to the repository on disk, relative to the corpus root path, without leading `./` or `.\` + corpus integer, + odb_size integer, -- the object database size in bytes + num_references integer, -- the total amount of references + num_objects integer, -- the total amount of objects + FOREIGN KEY (corpus) REFERENCES corpus (id) + UNIQUE (rela_path, corpus) + ) + "#, + )?; + con.execute_batch( + r#" + CREATE TABLE if not exists gitoxide_version( + id integer PRIMARY KEY, + version text UNIQUE -- the unique git version via gix describe + ) + "#, + )?; + con.execute_batch( + r#" + CREATE TABLE if not exists task( + id integer PRIMARY KEY, + short_name UNIQUE, -- the unique and permanent identifier for the task + description text UNIQUE -- the descriptive name of the task, it can be changed at will + ) + "#, + )?; + con.execute_batch( + r#" + CREATE TABLE if not exists run( + id integer PRIMARY KEY, + repository integer, + runner integer, + task integer, + gitoxide_version integer, + insertion_time integer NOT NULL, -- in seconds since UNIX epoch + duration real, -- in seconds or NULL if not yet finished (either successfull or with failure) + error text, -- or NULL if there was no error + spans_json text, -- all spans collecteted while performing the run + FOREIGN KEY (repository) REFERENCES repository (id), + FOREIGN KEY (task) REFERENCES task (id), + FOREIGN KEY (runner) REFERENCES runner (id), + FOREIGN KEY (gitoxide_version) REFERENCES gitoxide_version (id) + ) + "#, + )?; + + Ok(con) +} + +/// Utilities +impl Engine { + pub(crate) fn runner_id_or_insert(&self) -> anyhow::Result { + let sys = + sysinfo::System::new_with_specifics(RefreshKind::new().with_cpu(CpuRefreshKind::new().with_frequency())); + let cpu = &sys.cpus()[0]; + let vendor = Some(cpu.vendor_id().to_owned()); + let host = sys.host_name(); + let brand = Some(cpu.brand().to_owned()); + Ok(self.con.query_row( + "INSERT INTO runner (vendor, brand, host_name) VALUES (?1, ?2, ?3) \ + ON CONFLICT DO UPDATE SET vendor = vendor, brand = brand, host_name = ?3 RETURNING id", + [vendor.as_deref(), brand.as_deref(), host.as_deref()], + |r| r.get(0), + )?) + } + pub(crate) fn corpus_id_or_insert(&self, path: &Path) -> anyhow::Result { + let path = path.to_str().context("corpus root cannot contain illformed UTF-8")?; + Ok(self.con.query_row( + "INSERT INTO corpus (root) VALUES (?1) \ + ON CONFLICT DO UPDATE SET root = root RETURNING id", + [path], + |r| r.get(0), + )?) + } + pub(crate) fn gitoxide_version_id_or_insert(&self) -> anyhow::Result { + Ok(self + .con + .query_row( + "INSERT INTO gitoxide_version (version) VALUES (?1) ON CONFLICT DO UPDATE SET version = version RETURNING id", + [&self.gitoxide_version], + |r| r.get(0), + )?) + } + pub(crate) fn tasks_or_insert(&self) -> anyhow::Result> { + let mut out: Vec<_> = super::run::ALL.iter().map(|task| (0, task)).collect(); + for (id, task) in &mut out { + *id = self.con.query_row( + "INSERT INTO task (short_name, description) VALUES (?1, ?2) ON CONFLICT DO UPDATE SET short_name = short_name, description = ?2 RETURNING id", + [task.short_name, task.description], + |r| r.get(0), + )?; + } + Ok(out) + } + pub(crate) fn insert_run( + con: &rusqlite::Connection, + gitoxide_version: Id, + runner: Id, + task: Id, + repository: Id, + ) -> anyhow::Result { + let insertion_time = std::time::UNIX_EPOCH.elapsed()?.as_secs(); + let id = con.query_row("INSERT INTO run (gitoxide_version, runner, task, repository, insertion_time) VALUES (?1, ?2, ?3, ?4, ?5) RETURNING id", params![gitoxide_version, runner, task, repository, insertion_time], |r| r.get(0))?; + Ok(Run { + id, + duration: Default::default(), + error: None, + }) + } + pub(crate) fn update_run(con: &rusqlite::Connection, run: Run) -> anyhow::Result<()> { + con.execute( + "UPDATE run SET duration = ?2, error = ?3 WHERE id = ?1", + params![run.id, run.duration.as_secs_f64(), run.error.as_deref()], + )?; + Ok(()) + } +} diff --git a/gitoxide-core/src/corpus/engine.rs b/gitoxide-core/src/corpus/engine.rs new file mode 100644 index 00000000000..85c43236b02 --- /dev/null +++ b/gitoxide-core/src/corpus/engine.rs @@ -0,0 +1,277 @@ +use super::db; +use crate::corpus; +use crate::corpus::{Engine, Task}; +use crate::organize::find_git_repository_workdirs; +use anyhow::{bail, Context}; +use bytesize::ByteSize; +use gix::Progress; +use rusqlite::params; +use std::path::{Path, PathBuf}; +use std::sync::atomic::Ordering; +use std::time::{Duration, Instant}; + +impl Engine { + /// Open the corpus DB or create it. + pub fn open_or_create(db: PathBuf, gitoxide_version: String, progress: corpus::Progress) -> anyhow::Result { + let con = crate::corpus::db::create(db).context("Could not open or create database")?; + Ok(Engine { + progress, + con, + gitoxide_version, + }) + } + + /// Run on the existing set of repositories we have already seen or obtain them from `path` if there is none yet. + pub fn run(&mut self, corpus_path: PathBuf, threads: Option) -> anyhow::Result<()> { + let (corpus_path, corpus_id) = self.prepare_corpus_path(corpus_path)?; + let gitoxide_id = self.gitoxide_version_id_or_insert()?; + let runner_id = self.runner_id_or_insert()?; + let repos = self.find_repos_or_insert(&corpus_path, corpus_id)?; + let tasks = self.tasks_or_insert()?; + self.perform_run(&corpus_path, gitoxide_id, runner_id, &tasks, repos, threads) + } + + pub fn refresh(&mut self, corpus_path: PathBuf) -> anyhow::Result<()> { + let (corpus_path, corpus_id) = self.prepare_corpus_path(corpus_path)?; + let repos = self.refresh_repos(&corpus_path, corpus_id)?; + self.progress.set_name("refresh repos"); + self.progress.info(format!( + "Added or updated {} repositories under {corpus_path:?}", + repos.len() + )); + Ok(()) + } +} + +impl Engine { + fn perform_run( + &mut self, + corpus_path: &Path, + gitoxide_id: db::Id, + runner_id: db::Id, + tasks: &[(db::Id, &'static Task)], + mut repos: Vec, + threads: Option, + ) -> anyhow::Result<()> { + let start = Instant::now(); + let task_progress = &mut self.progress; + task_progress.set_name("run"); + task_progress.init(Some(tasks.len()), gix::progress::count("tasks")); + let threads = gix::parallel::num_threads(threads); + let db_path = self.con.path().expect("opened from path on disk").to_owned(); + for (task_id, task) in tasks { + let task_start = Instant::now(); + let mut repo_progress = task_progress.add_child(format!("run '{}'", task.short_name)); + repo_progress.init(Some(repos.len()), gix::progress::count("repos")); + + if task.execute_exclusive || threads == 1 { + let mut run_progress = repo_progress.add_child("set later"); + let (_guard, current_id) = corpus::trace::override_thread_subscriber(db_path.as_str())?; + + for repo in &repos { + if gix::interrupt::is_triggered() { + bail!("interrupted by user"); + } + run_progress.set_name(format!( + "{}", + repo.path + .strip_prefix(corpus_path) + .expect("corpus contains repo") + .display() + )); + + // TODO: wait for new release to be able to provide run_id via span attributes + let mut run = Self::insert_run(&self.con, gitoxide_id, runner_id, *task_id, repo.id)?; + current_id.store(run.id, Ordering::SeqCst); + tracing::info_span!("run", run_id = run.id).in_scope(|| { + task.perform( + &mut run, + &repo.path, + &mut run_progress, + Some(threads), + &gix::interrupt::IS_INTERRUPTED, + ); + }); + Self::update_run(&self.con, run)?; + repo_progress.inc(); + } + repo_progress.show_throughput(task_start); + } else { + let counter = repo_progress.counter(); + let repo_progress = gix::threading::OwnShared::new(gix::threading::Mutable::new(repo_progress)); + gix::parallel::in_parallel_with_slice( + &mut repos, + Some(threads), + { + let shared_repo_progress = repo_progress.clone(); + let db_path = db_path.clone(); + move |tid| { + ( + corpus::trace::override_thread_subscriber(db_path.as_str()), + gix::threading::lock(&shared_repo_progress).add_child(format!("{tid}")), + rusqlite::Connection::open(&db_path), + ) + } + }, + |repo, (subscriber, progress, con), _threads_left, should_interrupt| -> anyhow::Result<()> { + progress.set_name(format!( + "{}", + repo.path + .strip_prefix(corpus_path) + .expect("corpus contains repo") + .display() + )); + let current_id = match subscriber { + Ok((_guard, current_id)) => current_id, + Err(err) => { + progress.fail(format!("{err:#?}")); + should_interrupt.store(true, Ordering::SeqCst); + return Ok(()); + } + }; + let con = match con { + Ok(con) => con, + Err(err) => { + progress.fail(format!("{err:#?}")); + should_interrupt.store(true, Ordering::SeqCst); + return Ok(()); + } + }; + let mut run = Self::insert_run(con, gitoxide_id, runner_id, *task_id, repo.id)?; + current_id.store(run.id, Ordering::SeqCst); + tracing::info_span!("run", run_id = run.id).in_scope(|| { + task.perform(&mut run, &repo.path, progress, Some(1), should_interrupt); + }); + Self::update_run(con, run)?; + if let Some(counter) = counter.as_ref() { + counter.fetch_add(1, Ordering::SeqCst); + } + Ok(()) + }, + || (!gix::interrupt::is_triggered()).then(|| Duration::from_millis(100)), + std::convert::identity, + )?; + gix::threading::lock(&repo_progress).show_throughput(task_start); + } + + task_progress.inc(); + } + task_progress.show_throughput(start); + Ok(()) + } + + fn prepare_corpus_path(&self, corpus_path: PathBuf) -> anyhow::Result<(PathBuf, db::Id)> { + let corpus_path = gix::path::realpath(corpus_path)?; + let corpus_id = self.corpus_id_or_insert(&corpus_path)?; + Ok((corpus_path, corpus_id)) + } + + fn find_repos(&mut self, corpus_path: &Path, corpus_id: db::Id) -> anyhow::Result> { + self.progress.set_name("query db-repos"); + self.progress.init(None, gix::progress::count("repos")); + + Ok(self + .con + .prepare("SELECT id, rela_path, odb_size, num_objects, num_references FROM repository WHERE corpus = ?1")? + .query_map([corpus_id], |r| { + Ok(db::Repo { + id: r.get(0)?, + path: corpus_path.join(r.get::<_, String>(1)?), + odb_size: ByteSize(r.get(2)?), + num_objects: r.get(3)?, + num_references: r.get(4)?, + }) + })? + .inspect(|_| self.progress.inc()) + .collect::>()?) + } + + fn refresh_repos(&mut self, corpus_path: &Path, corpus_id: db::Id) -> anyhow::Result> { + let start = Instant::now(); + self.progress.set_name("refresh"); + self.progress.init(None, gix::progress::count("repos")); + + let repos = std::thread::scope({ + let progress = &mut self.progress; + let con = &mut self.con; + |scope| -> anyhow::Result<_> { + let threads = std::thread::available_parallelism() + .map(std::num::NonZeroUsize::get) + .ok() + .unwrap_or(1); + let (path_tx, repo_rx) = { + let (path_tx, path_rx) = crossbeam_channel::bounded(threads * 2); + let (repo_tx, repo_rx) = std::sync::mpsc::channel::<(PathBuf, anyhow::Result)>(); + (0..threads).for_each(|_| { + scope.spawn({ + let path_rx = path_rx.clone(); + let repo_tx = repo_tx.clone(); + move || -> anyhow::Result<_> { + for repo_path in path_rx { + let res = (|| { + let repo = gix::open_opts(&repo_path, gix::open::Options::isolated())?; + db::Repo::try_from(&repo) + })(); + repo_tx.send((repo_path, res))?; + } + Ok(()) + } + }); + }); + (path_tx, repo_rx) + }; + + let find_progress = progress.add_child("find"); + let write_db = scope.spawn(move || -> anyhow::Result> { + progress.set_name("write to DB"); + progress.init(None, gix::progress::count("repos")); + + let mut out = Vec::new(); + let transaction = con.transaction()?; + let mut statement = transaction.prepare("INSERT INTO repository (rela_path, corpus, odb_size, num_objects, num_references) VALUES (?1, ?2, ?3, ?4, ?5)\ + ON CONFLICT DO UPDATE SET rela_path = rela_path, corpus = corpus, odb_size = ?3, num_objects = ?4, num_references = ?5\ + RETURNING id")?; + for (repo_path, repo_res) in repo_rx { + match repo_res { + Ok(mut repo) => { + let rela_path = repo.path.strip_prefix(corpus_path)?; + repo.id = statement.query_row(params![rela_path.to_str().context("only valid UTF8 is allowed for repository paths")?, corpus_id, repo.odb_size.as_u64(), repo.num_objects, repo.num_references], |r| r.get(0))?; + out.push(repo); + progress.inc(); + } + Err(err) => progress.fail(format!("{repo_path:?}: {err:#?}")), + } + } + statement.finalize()?; + transaction.commit()?; + progress.show_throughput(start); + Ok(out) + }); + + let repos = gix::interrupt::Iter::new( + find_git_repository_workdirs(corpus_path, find_progress, false, Some(threads)), + || anyhow::anyhow!("interrupted by user"), + ); + for res in repos { + let (repo_path, _kind) = res?; + path_tx.send(repo_path)?; + } + drop(path_tx); + write_db.join().expect("no panic") + } + })?; + + Ok(repos) + } + + fn find_repos_or_insert(&mut self, corpus_path: &Path, corpus_id: db::Id) -> anyhow::Result> { + let start = Instant::now(); + let repos = self.find_repos(corpus_path, corpus_id)?; + if repos.is_empty() { + self.refresh_repos(corpus_path, corpus_id) + } else { + self.progress.show_throughput(start); + Ok(repos) + } + } +} diff --git a/gitoxide-core/src/corpus/mod.rs b/gitoxide-core/src/corpus/mod.rs new file mode 100644 index 00000000000..c6608a272b5 --- /dev/null +++ b/gitoxide-core/src/corpus/mod.rs @@ -0,0 +1,137 @@ +pub const PROGRESS_RANGE: std::ops::RangeInclusive = 0..=3; +pub(crate) type Progress = gix::progress::DoOrDiscard; + +pub struct Engine { + progress: Progress, + con: rusqlite::Connection, + gitoxide_version: String, +} + +pub struct RunOutcome { + /// the relative path to the repositories that could not be found on disk + pub missing_repos_rela_paths: usize, +} + +pub(crate) mod db; +pub(crate) mod engine; + +/// Contains all information necessary to run a task. +pub(crate) struct Task { + /// The unique name of the task, which must not be changed after creating it. + /// + /// However, if it is changed it will be treated as new kind of task entirely and won't compare + /// to previous runs of the task. + short_name: &'static str, + /// Explain in greater detail what the task is doing. + description: &'static str, + /// `true` if the task cannot be run in parallel as it needs all resources by itself. + execute_exclusive: bool, + /// The actual implementation + execute: &'static (dyn run::Execute + Send + Sync), +} + +pub(crate) struct Run { + /// Our own ID for finding the respective database row. + id: db::Id, + /// The time at which the run was inserted. + duration: std::time::Duration, + error: Option, +} + +pub(crate) mod trace { + use rusqlite::params; + use std::path::Path; + use std::sync::atomic::{AtomicU32, Ordering}; + use std::sync::{Arc, Mutex}; + use tracing_forest::tree::Tree; + use tracing_subscriber::layer::SubscriberExt; + + pub fn override_thread_subscriber( + db_path: impl AsRef, + ) -> anyhow::Result<(tracing::subscriber::DefaultGuard, Arc)> { + let current_id = Arc::new(AtomicU32::default()); + let processor = tracing_forest::Printer::new().formatter(StoreTreeToDb { + con: Arc::new(Mutex::new(rusqlite::Connection::open(&db_path)?)), + run_id: current_id.clone(), + }); + let subscriber = tracing_subscriber::Registry::default().with(tracing_forest::ForestLayer::from(processor)); + let guard = tracing::subscriber::set_default(subscriber); + Ok((guard, current_id)) + } + + pub struct StoreTreeToDb { + pub con: Arc>, + pub run_id: Arc, + } + impl tracing_forest::printer::Formatter for StoreTreeToDb { + type Error = rusqlite::Error; + + fn fmt(&self, tree: &Tree) -> Result { + let json = serde_json::to_string_pretty(&tree).expect("serialization to string always works"); + let run_id = self.run_id.load(Ordering::SeqCst); + self.con + .lock() + .unwrap() + .execute("UPDATE run SET spans_json = ?1 WHERE id = ?2", params![json, run_id])?; + Ok(String::new()) + } + } +} + +pub(crate) mod run { + use crate::corpus; + use crate::corpus::{Run, Task}; + use std::path::Path; + use std::sync::atomic::AtomicBool; + + impl Task { + pub fn perform( + &self, + run: &mut Run, + repo: &Path, + progress: &mut corpus::Progress, + threads: Option, + should_interrupt: &AtomicBool, + ) { + let start = std::time::Instant::now(); + if let Err(err) = self.execute.execute(repo, progress, threads, should_interrupt) { + run.error = Some(format!("{err:#?}")) + } + run.duration = start.elapsed(); + } + } + + /// Note that once runs have been recorded, the implementation must not change anymore to keep it comparable. + /// If changes have be done, rather change the name of the owning task to start a new kind of task. + pub(crate) trait Execute { + fn execute( + &self, + repo: &Path, + progress: &mut corpus::Progress, + threads: Option, + should_interrupt: &AtomicBool, + ) -> anyhow::Result<()>; + } + + pub(crate) static ALL: &[Task] = &[Task { + short_name: "OPNR", + description: "open repository (isolated)", + execute_exclusive: false, + execute: &OpenRepo, + }]; + + struct OpenRepo; + + impl Execute for OpenRepo { + fn execute( + &self, + repo: &Path, + _progress: &mut corpus::Progress, + _threads: Option, + _should_interrupt: &AtomicBool, + ) -> anyhow::Result<()> { + gix::open_opts(repo, gix::open::Options::isolated())?; + Ok(()) + } + } +} diff --git a/gitoxide-core/src/lib.rs b/gitoxide-core/src/lib.rs index ebba4f69b76..58e688ea983 100644 --- a/gitoxide-core/src/lib.rs +++ b/gitoxide-core/src/lib.rs @@ -64,6 +64,8 @@ impl FromStr for OutputFormat { } pub mod commitgraph; +#[cfg(feature = "corpus")] +pub mod corpus; pub mod net; #[cfg(feature = "estimate-hours")] diff --git a/gitoxide-core/src/organize.rs b/gitoxide-core/src/organize.rs index 25964db9f4a..7a9809ef006 100644 --- a/gitoxide-core/src/organize.rs +++ b/gitoxide-core/src/organize.rs @@ -12,7 +12,7 @@ pub enum Mode { Simulate, } -fn find_git_repository_workdirs( +pub fn find_git_repository_workdirs( root: impl AsRef, mut progress: impl Progress, debug: bool, diff --git a/gitoxide-core/src/repository/odb.rs b/gitoxide-core/src/repository/odb.rs index 1ecbdf20b39..1d3a08b6232 100644 --- a/gitoxide-core/src/repository/odb.rs +++ b/gitoxide-core/src/repository/odb.rs @@ -166,7 +166,7 @@ pub fn statistics( cancelled, ), thread_limit, - move |_| (repo.objects.clone().into_inner(), counter.clone()), + move |_| (repo.objects.clone().into_inner(), counter), |ids, (handle, counter)| { let ids = ids?; if let Some(counter) = counter { diff --git a/gix-actor/Cargo.toml b/gix-actor/Cargo.toml index 4525fdf408a..4e24ae852d3 100644 --- a/gix-actor/Cargo.toml +++ b/gix-actor/Cargo.toml @@ -7,7 +7,7 @@ repository = "https://github.com/Byron/gitoxide" license = "MIT/Apache-2.0" edition = "2021" include = ["src/**/*", "LICENSE-*", "CHANGELOG.md"] -rust-version = "1.64" +rust-version = "1.65" [lib] doctest = false diff --git a/gix-archive/Cargo.toml b/gix-archive/Cargo.toml index 8b691b84484..69615656cf2 100644 --- a/gix-archive/Cargo.toml +++ b/gix-archive/Cargo.toml @@ -6,7 +6,7 @@ license = "MIT/Apache-2.0" description = "implements archive generation from of a tree" authors = ["Sebastian Thiel "] edition = "2021" -rust-version = "1.64" +rust-version = "1.65" [lib] doctest = false diff --git a/gix-attributes/Cargo.toml b/gix-attributes/Cargo.toml index 21ab13e6399..273c5c3fb5b 100644 --- a/gix-attributes/Cargo.toml +++ b/gix-attributes/Cargo.toml @@ -7,7 +7,7 @@ description = "A WIP crate of the gitoxide project dealing .gitattributes files" authors = ["Sebastian Thiel "] edition = "2021" include = ["src/**/*", "LICENSE-*", "CHANGELOG.md"] -rust-version = "1.64" +rust-version = "1.65" [lib] doctest = false diff --git a/gix-bitmap/Cargo.toml b/gix-bitmap/Cargo.toml index b53eff32bae..4673aa66ad0 100644 --- a/gix-bitmap/Cargo.toml +++ b/gix-bitmap/Cargo.toml @@ -6,7 +6,7 @@ license = "MIT/Apache-2.0" description = "A WIP crate of the gitoxide project dedicated implementing the standard git bitmap format" authors = ["Sebastian Thiel "] edition = "2021" -rust-version = "1.64" +rust-version = "1.65" [lib] doctest = false diff --git a/gix-chunk/Cargo.toml b/gix-chunk/Cargo.toml index 464b27c3883..292a03438af 100644 --- a/gix-chunk/Cargo.toml +++ b/gix-chunk/Cargo.toml @@ -8,7 +8,7 @@ documentation = "https://github.com/git/git/blob/seen/Documentation/technical/ch license = "MIT/Apache-2.0" edition = "2021" include = ["src/**/*", "LICENSE-*", "CHANGELOG.md"] -rust-version = "1.64" +rust-version = "1.65" [lib] doctest = false diff --git a/gix-command/Cargo.toml b/gix-command/Cargo.toml index feef6cc1f7c..0104bcf275e 100644 --- a/gix-command/Cargo.toml +++ b/gix-command/Cargo.toml @@ -6,7 +6,7 @@ license = "MIT/Apache-2.0" description = "A WIP crate of the gitoxide project handling internal git command execution" authors = ["Sebastian Thiel "] edition = "2021" -rust-version = "1.64" +rust-version = "1.65" [lib] doctest = false diff --git a/gix-commitgraph/Cargo.toml b/gix-commitgraph/Cargo.toml index e6f0fb2add7..913667d5d08 100644 --- a/gix-commitgraph/Cargo.toml +++ b/gix-commitgraph/Cargo.toml @@ -8,7 +8,7 @@ description = "Read-only access to the git commitgraph file format" authors = ["Conor Davis ", "Sebastian Thiel "] edition = "2021" include = ["src/**/*", "LICENSE-*", "CHANGELOG.md"] -rust-version = "1.64" +rust-version = "1.65" [lib] doctest = false diff --git a/gix-config-value/Cargo.toml b/gix-config-value/Cargo.toml index b1042869780..f7f330c9cd7 100644 --- a/gix-config-value/Cargo.toml +++ b/gix-config-value/Cargo.toml @@ -6,7 +6,7 @@ license = "MIT/Apache-2.0" description = "A crate of the gitoxide project providing gix-config value parsing" authors = ["Sebastian Thiel "] edition = "2021" -rust-version = "1.64" +rust-version = "1.65" [lib] doctest = false diff --git a/gix-config/Cargo.toml b/gix-config/Cargo.toml index d6931079f1c..223eec3b008 100644 --- a/gix-config/Cargo.toml +++ b/gix-config/Cargo.toml @@ -9,7 +9,7 @@ edition = "2021" keywords = ["gix-config", "git", "config", "gitoxide"] categories = ["config", "parser-implementations"] include = ["src/**/*", "LICENSE-*", "README.md", "CHANGELOG.md"] -rust-version = "1.64" +rust-version = "1.65" autotests = false [features] diff --git a/gix-config/tests/Cargo.toml b/gix-config/tests/Cargo.toml index 4d389ed75a8..90d039f7fec 100644 --- a/gix-config/tests/Cargo.toml +++ b/gix-config/tests/Cargo.toml @@ -9,7 +9,7 @@ edition = "2021" keywords = ["gix-config", "git", "config", "gitoxide"] categories = ["config", "parser-implementations"] include = ["src/**/*", "LICENSE-*", "README.md", "CHANGELOG.md"] -rust-version = "1.64" +rust-version = "1.65" publish = false diff --git a/gix-credentials/Cargo.toml b/gix-credentials/Cargo.toml index 54549e5603c..157d90cde88 100644 --- a/gix-credentials/Cargo.toml +++ b/gix-credentials/Cargo.toml @@ -6,7 +6,7 @@ license = "MIT/Apache-2.0" description = "A WIP crate of the gitoxide project to interact with git credentials helpers" authors = ["Sebastian Thiel "] edition = "2021" -rust-version = "1.64" +rust-version = "1.65" [lib] doctest = false diff --git a/gix-date/Cargo.toml b/gix-date/Cargo.toml index aa9336eaccc..bdf855579c9 100644 --- a/gix-date/Cargo.toml +++ b/gix-date/Cargo.toml @@ -7,7 +7,7 @@ description = "A WIP crate of the gitoxide project parsing dates the way git doe authors = ["Sebastian Thiel "] edition = "2021" include = ["src/**/*", "LICENSE-*", "CHANGELOG.md"] -rust-version = "1.64" +rust-version = "1.65" [lib] doctest = false diff --git a/gix-diff/Cargo.toml b/gix-diff/Cargo.toml index bd3245ff4e1..1c6f2bd9bbe 100644 --- a/gix-diff/Cargo.toml +++ b/gix-diff/Cargo.toml @@ -7,7 +7,7 @@ description = "Calculate differences between various git objects" authors = ["Sebastian Thiel "] edition = "2021" include = ["src/**/*", "LICENSE-*", "CHANGELOG.md"] -rust-version = "1.64" +rust-version = "1.65" autotests = false [features] diff --git a/gix-diff/tests/Cargo.toml b/gix-diff/tests/Cargo.toml index 48e2818b75d..bb0ec4b8eb8 100644 --- a/gix-diff/tests/Cargo.toml +++ b/gix-diff/tests/Cargo.toml @@ -8,7 +8,7 @@ description = "Please use `gix-` instead ('git' -> 'gix')" authors = ["Sebastian Thiel "] edition = "2021" include = ["src/**/*"] -rust-version = "1.64" +rust-version = "1.65" [features] serde = ["gix-diff/serde", "gix-hash/serde", "gix-object/serde"] diff --git a/gix-discover/Cargo.toml b/gix-discover/Cargo.toml index 0c67c2dc75e..03badcaa3c4 100644 --- a/gix-discover/Cargo.toml +++ b/gix-discover/Cargo.toml @@ -7,7 +7,7 @@ description = "Discover git repositories and check if a directory is a git repos authors = ["Sebastian Thiel "] edition = "2021" include = ["src/**/*", "LICENSE-*", "CHANGELOG.md"] -rust-version = "1.64" +rust-version = "1.65" [lib] doctest = false diff --git a/gix-features/Cargo.toml b/gix-features/Cargo.toml index 05f752d6379..5ee5360546b 100644 --- a/gix-features/Cargo.toml +++ b/gix-features/Cargo.toml @@ -6,7 +6,7 @@ version = "0.30.0" authors = ["Sebastian Thiel "] license = "MIT/Apache-2.0" edition = "2021" -rust-version = "1.64" +rust-version = "1.65" [lib] doctest = false @@ -26,6 +26,15 @@ progress-unit-bytes = ["dep:bytesize", "prodash?/unit-bytes"] ## If set, walkdir iterators will be multi-threaded. fs-walkdir-parallel = [ "dep:jwalk" ] +## Implement `tracing` with `tracing-core`, which provides applications with valuable performance details if they opt-in to it. +## +## Note that this may have overhead as well, thus instrumentations should be used stategically, only providing coarse tracing by default and adding details +## only where needed while marking them with the appropriate level. +tracing = [ "gix-trace/tracing" ] + +## If enabled, detailed tracing is also emitted, which can greatly increase insights but at a cost. +tracing-detail = [ "gix-trace/tracing-detail" ] + ## Use scoped threads and channels to parallelize common workloads on multiple objects. If enabled, it is used everywhere ## where it makes sense. ## As caches are likely to be used and instantiated per thread, more memory will be used on top of the costs for threads. @@ -104,11 +113,8 @@ path = "tests/pipe.rs" required-features = ["io-pipe"] [dependencies] -#! ### Optional Dependencies - gix-hash = { version = "^0.11.2", path = "../gix-hash" } - - +gix-trace = { version = "^0.1.0", path = "../gix-trace" } # 'parallel' feature crossbeam-channel = { version = "0.5.0", optional = true } diff --git a/gix-features/src/lib.rs b/gix-features/src/lib.rs index 643320c0f1b..f343b264719 100644 --- a/gix-features/src/lib.rs +++ b/gix-features/src/lib.rs @@ -27,6 +27,8 @@ pub mod parallel; #[cfg(feature = "progress")] pub mod progress; pub mod threading; +pub use gix_trace as trace; + /// #[cfg(feature = "zlib")] pub mod zlib; diff --git a/gix-features/src/parallel/in_parallel.rs b/gix-features/src/parallel/in_parallel.rs index 241565b62d7..927d2a0614e 100644 --- a/gix-features/src/parallel/in_parallel.rs +++ b/gix-features/src/parallel/in_parallel.rs @@ -49,7 +49,7 @@ pub fn build_thread() -> std::thread::Builder { pub fn in_parallel( input: impl Iterator + Send, thread_limit: Option, - new_thread_state: impl Fn(usize) -> S + Send + Clone, + new_thread_state: impl FnOnce(usize) -> S + Send + Clone, consume: impl FnMut(I, &mut S) -> O + Send + Clone, mut reducer: R, ) -> Result<::Output, ::Error> @@ -117,7 +117,7 @@ where pub fn in_parallel_with_slice( input: &mut [I], thread_limit: Option, - new_thread_state: impl FnMut(usize) -> S + Send + Clone, + new_thread_state: impl FnOnce(usize) -> S + Send + Clone, consume: impl FnMut(&mut I, &mut S, &AtomicIsize, &AtomicBool) -> Result<(), E> + Send + Clone, mut periodic: impl FnMut() -> Option + Send, state_to_rval: impl FnOnce(S) -> R + Send + Clone, @@ -168,7 +168,7 @@ where std::thread::Builder::new() .name(format!("gitoxide.in_parallel_with_slice.produce.{thread_id}")) .spawn_scoped(s, { - let mut new_thread_state = new_thread_state.clone(); + let new_thread_state = new_thread_state.clone(); let state_to_rval = state_to_rval.clone(); let mut consume = consume.clone(); let input = Input(input as *mut [I]); diff --git a/gix-features/src/parallel/serial.rs b/gix-features/src/parallel/serial.rs index 3511c73e3e9..f6f3c9088c9 100644 --- a/gix-features/src/parallel/serial.rs +++ b/gix-features/src/parallel/serial.rs @@ -94,7 +94,7 @@ mod not_parallel { pub fn in_parallel_with_slice( input: &mut [I], _thread_limit: Option, - mut new_thread_state: impl FnMut(usize) -> S + Clone, + new_thread_state: impl FnOnce(usize) -> S + Clone, mut consume: impl FnMut(&mut I, &mut S, &AtomicIsize, &AtomicBool) -> Result<(), E> + Clone, mut periodic: impl FnMut() -> Option, state_to_rval: impl FnOnce(S) -> R + Clone, @@ -128,7 +128,7 @@ pub use not_parallel::{build_thread, in_parallel_with_slice, join, threads, Scop pub fn in_parallel( input: impl Iterator, _thread_limit: Option, - new_thread_state: impl Fn(usize) -> S, + new_thread_state: impl FnOnce(usize) -> S, mut consume: impl FnMut(I, &mut S) -> O, mut reducer: R, ) -> Result<::Output, ::Error> diff --git a/gix-features/tests/features.rs b/gix-features/tests/features.rs new file mode 100644 index 00000000000..fc1f25c367b --- /dev/null +++ b/gix-features/tests/features.rs @@ -0,0 +1 @@ +mod trace; diff --git a/gix-features/tests/trace/mod.rs b/gix-features/tests/trace/mod.rs new file mode 100644 index 00000000000..614a0bb62db --- /dev/null +++ b/gix-features/tests/trace/mod.rs @@ -0,0 +1,15 @@ +use gix_features::trace::{coarse, detail, span}; +#[test] +fn span() { + let _x = span!(gix_features::trace::Level::Coarse, "hello"); + span!(gix_features::trace::Level::Coarse, "hello", x = "value", y = 42); + span!(target: "other", gix_features::trace::Level::Coarse, "hello", x = "value", y = 42); + + let _x = coarse!("hello"); + coarse!("hello", x = "value", y = 42); + coarse!(target: "other", "hello", x = "value", y = 42); + + let _y = detail!("hello"); + detail!("hello", x = "value", y = 42); + detail!(target: "other", "hello", x = "value", y = 42); +} diff --git a/gix-fetchhead/Cargo.toml b/gix-fetchhead/Cargo.toml index 0ed9042d566..00b3473d7b9 100644 --- a/gix-fetchhead/Cargo.toml +++ b/gix-fetchhead/Cargo.toml @@ -6,7 +6,7 @@ license = "MIT/Apache-2.0" description = "A WIP crate of the gitoxide project to read and write .git/FETCH_HEAD" authors = ["Sebastian Thiel "] edition = "2021" -rust-version = "1.64" +rust-version = "1.65" [lib] doctest = false diff --git a/gix-filter/Cargo.toml b/gix-filter/Cargo.toml index 327ce3b1685..5423c02be6c 100644 --- a/gix-filter/Cargo.toml +++ b/gix-filter/Cargo.toml @@ -6,7 +6,7 @@ license = "MIT/Apache-2.0" description = "A WIP crate of the gitoxide project implementing git filters" authors = ["Sebastian Thiel "] edition = "2021" -rust-version = "1.64" +rust-version = "1.65" [lib] doctest = false diff --git a/gix-fs/Cargo.toml b/gix-fs/Cargo.toml index bd268cd2e3b..af65127e494 100644 --- a/gix-fs/Cargo.toml +++ b/gix-fs/Cargo.toml @@ -6,7 +6,7 @@ license = "MIT/Apache-2.0" description = "A crate providing file system specific utilities to `gitoxide`" authors = ["Sebastian Thiel "] edition = "2021" -rust-version = "1.64" +rust-version = "1.65" [lib] doctest = false diff --git a/gix-glob/Cargo.toml b/gix-glob/Cargo.toml index 2934facb38f..07aa0db17e2 100644 --- a/gix-glob/Cargo.toml +++ b/gix-glob/Cargo.toml @@ -6,7 +6,7 @@ license = "MIT/Apache-2.0" description = "A WIP crate of the gitoxide project dealing with pattern matching" authors = ["Sebastian Thiel "] edition = "2021" -rust-version = "1.64" +rust-version = "1.65" [lib] doctest = false diff --git a/gix-hash/Cargo.toml b/gix-hash/Cargo.toml index 189c90413d5..8798b212233 100644 --- a/gix-hash/Cargo.toml +++ b/gix-hash/Cargo.toml @@ -7,7 +7,7 @@ repository = "https://github.com/Byron/gitoxide" license = "MIT/Apache-2.0" edition = "2021" include = ["src/**/*", "LICENSE-*", "CHANGELOG.md"] -rust-version = "1.64" +rust-version = "1.65" [lib] doctest = false diff --git a/gix-hashtable/Cargo.toml b/gix-hashtable/Cargo.toml index 3d2ade13601..ed109e5341d 100644 --- a/gix-hashtable/Cargo.toml +++ b/gix-hashtable/Cargo.toml @@ -7,7 +7,7 @@ description = "A crate that provides hashtable based data structures optimized t authors = ["Pascal Kuthe "] edition = "2021" include = ["src/**/*", "LICENSE-*", "CHANGELOG.md"] -rust-version = "1.64" +rust-version = "1.65" [lib] doctest = false diff --git a/gix-ignore/Cargo.toml b/gix-ignore/Cargo.toml index 975e3f91978..5ebdffa5722 100644 --- a/gix-ignore/Cargo.toml +++ b/gix-ignore/Cargo.toml @@ -7,7 +7,7 @@ description = "A WIP crate of the gitoxide project dealing .gitignore files" authors = ["Sebastian Thiel "] edition = "2021" include = ["src/**/*", "LICENSE-*", "CHANGELOG.md"] -rust-version = "1.64" +rust-version = "1.65" [lib] doctest = false diff --git a/gix-index/Cargo.toml b/gix-index/Cargo.toml index 0c6650900ba..4448ff2ee60 100644 --- a/gix-index/Cargo.toml +++ b/gix-index/Cargo.toml @@ -7,7 +7,7 @@ description = "A work-in-progress crate of the gitoxide project dedicated implem authors = ["Sebastian Thiel "] edition = "2021" include = ["src/**/*", "LICENSE-*", "README.md", "CHANGELOG.md"] -rust-version = "1.64" +rust-version = "1.65" autotests = false diff --git a/gix-index/src/decode/mod.rs b/gix-index/src/decode/mod.rs index f51a5d5e965..70a65a880b0 100644 --- a/gix-index/src/decode/mod.rs +++ b/gix-index/src/decode/mod.rs @@ -65,6 +65,7 @@ impl State { expected_checksum, }: Options, ) -> Result<(Self, gix_hash::ObjectId), Error> { + let _span = gix_features::trace::detail!("gix_index::State::from_bytes()"); let (version, num_entries, post_header_data) = header::decode(data, object_hash)?; let start_of_extensions = extension::end_of_index_entry::decode(data, object_hash); diff --git a/gix-index/src/file/init.rs b/gix-index/src/file/init.rs index 534f1f08b14..a61c7cfff60 100644 --- a/gix-index/src/file/init.rs +++ b/gix-index/src/file/init.rs @@ -46,6 +46,7 @@ impl File { /// Open an index file at `path` with `options`, assuming `object_hash` is used throughout the file. pub fn at(path: impl Into, object_hash: gix_hash::Kind, options: decode::Options) -> Result { + let _span = gix_features::trace::detail!("gix_index::File::at()"); let path = path.into(); let (data, mtime) = { // SAFETY: we have to take the risk of somebody changing the file underneath. Git never writes into the same file. diff --git a/gix-index/src/write.rs b/gix-index/src/write.rs index 43f9b3255c2..29066a35e9a 100644 --- a/gix-index/src/write.rs +++ b/gix-index/src/write.rs @@ -55,6 +55,7 @@ pub struct Options { impl State { /// Serialize this instance to `out` with [`options`][Options]. pub fn write_to(&self, out: impl std::io::Write, Options { extensions }: Options) -> std::io::Result { + let _span = gix_features::trace::detail!("gix_index::State::write()"); let version = self.detect_required_version(); let mut write = CountBytes::new(out); diff --git a/gix-index/tests/Cargo.toml b/gix-index/tests/Cargo.toml index 3d220e67abf..91490e57496 100644 --- a/gix-index/tests/Cargo.toml +++ b/gix-index/tests/Cargo.toml @@ -8,7 +8,7 @@ description = "Please use `gix-` instead ('git' -> 'gix')" authors = ["Sebastian Thiel "] edition = "2021" include = ["src/**/*", "README.md", "CHANGELOG.md"] -rust-version = "1.64" +rust-version = "1.65" [[test]] name = "multi-threaded" diff --git a/gix-lfs/Cargo.toml b/gix-lfs/Cargo.toml index f1dc0a05df9..2eb13d970c1 100644 --- a/gix-lfs/Cargo.toml +++ b/gix-lfs/Cargo.toml @@ -6,7 +6,7 @@ license = "MIT/Apache-2.0" description = "A WIP crate of the gitoxide project dealing with handling git large file support" authors = ["Sebastian Thiel "] edition = "2021" -rust-version = "1.64" +rust-version = "1.65" [lib] doctest = false diff --git a/gix-lock/Cargo.toml b/gix-lock/Cargo.toml index 138fe568ccc..471dfbc09aa 100644 --- a/gix-lock/Cargo.toml +++ b/gix-lock/Cargo.toml @@ -7,7 +7,7 @@ description = "A git-style lock-file implementation" authors = ["Sebastian Thiel "] edition = "2021" include = ["src/**/*", "LICENSE-*", "README.md", "CHANGELOG.md"] -rust-version = "1.64" +rust-version = "1.65" [lib] doctest = false diff --git a/gix-mailmap/Cargo.toml b/gix-mailmap/Cargo.toml index 5e58a12e96e..d1856299bdc 100644 --- a/gix-mailmap/Cargo.toml +++ b/gix-mailmap/Cargo.toml @@ -6,7 +6,7 @@ license = "MIT/Apache-2.0" description = "A WIP crate of the gitoxide project for parsing mailmap files" authors = ["Sebastian Thiel "] edition = "2021" -rust-version = "1.64" +rust-version = "1.65" [lib] doctest = false diff --git a/gix-negotiate/Cargo.toml b/gix-negotiate/Cargo.toml index 23f5bf029c9..13264f1a3cd 100644 --- a/gix-negotiate/Cargo.toml +++ b/gix-negotiate/Cargo.toml @@ -6,7 +6,7 @@ license = "MIT/Apache-2.0" description = "A crate of the gitoxide project implementing negotiation algorithms" authors = ["Sebastian Thiel "] edition = "2021" -rust-version = "1.64" +rust-version = "1.65" [lib] doctest = false diff --git a/gix-note/Cargo.toml b/gix-note/Cargo.toml index 5d3f3349fac..d6a79767417 100644 --- a/gix-note/Cargo.toml +++ b/gix-note/Cargo.toml @@ -6,7 +6,7 @@ license = "MIT/Apache-2.0" description = "A WIP crate of the gitoxide project dealing with git notes" authors = ["Sebastian Thiel "] edition = "2021" -rust-version = "1.64" +rust-version = "1.65" [lib] doctest = false diff --git a/gix-object/Cargo.toml b/gix-object/Cargo.toml index b3785d8c885..c4e6d167347 100644 --- a/gix-object/Cargo.toml +++ b/gix-object/Cargo.toml @@ -7,7 +7,7 @@ repository = "https://github.com/Byron/gitoxide" license = "MIT/Apache-2.0" edition = "2021" include = ["src/**/*", "LICENSE-*", "CHANGELOG.md"] -rust-version = "1.64" +rust-version = "1.65" [lib] doctest = false diff --git a/gix-odb/Cargo.toml b/gix-odb/Cargo.toml index d7ce92202f6..d1e904c5df2 100644 --- a/gix-odb/Cargo.toml +++ b/gix-odb/Cargo.toml @@ -7,7 +7,7 @@ license = "MIT/Apache-2.0" description = "Implements various git object databases" edition = "2021" include = ["src/**/*", "LICENSE-*", "CHANGELOG.md"] -rust-version = "1.64" +rust-version = "1.65" [lib] doctest = false diff --git a/gix-odb/src/store_impls/dynamic/init.rs b/gix-odb/src/store_impls/dynamic/init.rs index 5e272dcffe1..22a53ae1278 100644 --- a/gix-odb/src/store_impls/dynamic/init.rs +++ b/gix-odb/src/store_impls/dynamic/init.rs @@ -79,6 +79,7 @@ impl Store { current_dir, }: Options, ) -> std::io::Result { + let _span = gix_features::trace::detail!("gix_odb::Store::at()"); let objects_dir = objects_dir.into(); let current_dir = current_dir.map_or_else(std::env::current_dir, Ok)?; if !objects_dir.is_dir() { diff --git a/gix-odb/src/store_impls/dynamic/prefix.rs b/gix-odb/src/store_impls/dynamic/prefix.rs index c0edeba3f91..4e08ae04f1e 100644 --- a/gix-odb/src/store_impls/dynamic/prefix.rs +++ b/gix-odb/src/store_impls/dynamic/prefix.rs @@ -85,6 +85,7 @@ where match *count { Some(count) => Ok(count), None => { + let _span = gix_features::trace::detail!("gix_odb::Handle::packed_object_count()"); let mut snapshot = self.snapshot.borrow_mut(); *snapshot = self.store.load_all_indices()?; let mut obj_count = 0; diff --git a/gix-odb/src/store_impls/dynamic/structure.rs b/gix-odb/src/store_impls/dynamic/structure.rs index 687e74d6a52..8e5adc23c35 100644 --- a/gix-odb/src/store_impls/dynamic/structure.rs +++ b/gix-odb/src/store_impls/dynamic/structure.rs @@ -52,6 +52,7 @@ impl Store { /// implementation. The likelihood of actual changes is low though as these still depend on something /// changing on disk and somebody reading at the same time. pub fn structure(&self) -> Result, load_index::Error> { + let _span = gix_features::trace::detail!("gix_odb::Store::structure()"); let index = self.index.load(); if !index.is_initialized() { self.consolidate_with_disk_state(true, false /*load one new index*/)?; diff --git a/gix-pack/Cargo.toml b/gix-pack/Cargo.toml index f33de0af51c..b0f61114d21 100644 --- a/gix-pack/Cargo.toml +++ b/gix-pack/Cargo.toml @@ -7,7 +7,7 @@ license = "MIT/Apache-2.0" description = "Implements git packs and related data structures" edition = "2021" include = ["src/**/*", "LICENSE-*", "CHANGELOG.md"] -rust-version = "1.64" +rust-version = "1.65" autotests = false [lib] diff --git a/gix-pack/src/bundle/write/mod.rs b/gix-pack/src/bundle/write/mod.rs index 103a0034b5c..fa6e0402ffa 100644 --- a/gix-pack/src/bundle/write/mod.rs +++ b/gix-pack/src/bundle/write/mod.rs @@ -70,6 +70,7 @@ impl crate::Bundle { thin_pack_base_object_lookup_fn: Option, options: Options, ) -> Result { + let _span = gix_features::trace::coarse!("gix_pack::Bundle::write_to_directory()"); let mut read_progress = progress.add_child_with_id("read pack", ProgressId::ReadPackBytes.into()); read_progress.init(None, progress::bytes()); let pack = progress::Read { @@ -183,6 +184,7 @@ impl crate::Bundle { P: Progress, P::SubProgress: 'static, { + let _span = gix_features::trace::coarse!("gix_pack::Bundle::write_to_directory_eagerly()"); let mut read_progress = progress.add_child_with_id("read pack", ProgressId::ReadPackBytes.into()); /* Bundle Write Read pack Bytes*/ read_progress.init(pack_size.map(|s| s as usize), progress::bytes()); let pack = progress::Read { diff --git a/gix-pack/tests/Cargo.toml b/gix-pack/tests/Cargo.toml index a8da05db6c0..b3183d2c333 100644 --- a/gix-pack/tests/Cargo.toml +++ b/gix-pack/tests/Cargo.toml @@ -7,7 +7,7 @@ license = "MIT/Apache-2.0" description = "Please use `gix-` instead ('git' -> 'gix')" edition = "2018" include = ["src/**/*", "CHANGELOG.md"] -rust-version = "1.64" +rust-version = "1.65" [features] diff --git a/gix-packetline/Cargo.toml b/gix-packetline/Cargo.toml index 2618388cb19..9f299474b9c 100644 --- a/gix-packetline/Cargo.toml +++ b/gix-packetline/Cargo.toml @@ -7,7 +7,7 @@ description = "A WIP crate of the gitoxide project implementing the pkt-line ser authors = ["Sebastian Thiel "] edition = "2021" include = ["src/**/*", "LICENSE-*", "CHANGELOG.md"] -rust-version = "1.64" +rust-version = "1.65" [lib] doctest = false diff --git a/gix-path/Cargo.toml b/gix-path/Cargo.toml index e795be6ab32..c423af3e1ef 100644 --- a/gix-path/Cargo.toml +++ b/gix-path/Cargo.toml @@ -7,12 +7,13 @@ description = "A WIP crate of the gitoxide project dealing paths and their conve authors = ["Sebastian Thiel "] edition = "2021" include = ["src/**/*", "LICENSE-*", "CHANGELOG.md"] -rust-version = "1.64" +rust-version = "1.65" [lib] doctest = false [dependencies] +gix-trace = { version = "^0.1.0", path = "../gix-trace" } bstr = { version = "1.3.0", default-features = false, features = ["std"] } thiserror = "1.0.26" once_cell = "1.17.1" diff --git a/gix-path/src/env/git.rs b/gix-path/src/env/git.rs index 6b1663a1ccd..b8a9bc0d59f 100644 --- a/gix-path/src/env/git.rs +++ b/gix-path/src/env/git.rs @@ -8,6 +8,7 @@ use bstr::{BStr, BString, ByteSlice}; /// Returns the file that contains git configuration coming with the installation of the `git` file in the current `PATH`, or `None` /// if no `git` executable was found or there were other errors during execution. pub(crate) fn install_config_path() -> Option<&'static BStr> { + let _span = gix_trace::detail!("gix_path::git::install_config_path()"); static PATH: once_cell::sync::Lazy> = once_cell::sync::Lazy::new(|| { // Shortcut: in Msys shells this variable is set which allows to deduce the installation directory // so we can save the `git` invocation. diff --git a/gix-pathspec/Cargo.toml b/gix-pathspec/Cargo.toml index 862a8531f0b..fc801c0b6a6 100644 --- a/gix-pathspec/Cargo.toml +++ b/gix-pathspec/Cargo.toml @@ -6,7 +6,7 @@ license = "MIT/Apache-2.0" description = "A WIP crate of the gitoxide project dealing magical pathspecs" authors = ["Sebastian Thiel "] edition = "2021" -rust-version = "1.64" +rust-version = "1.65" [lib] doctest = false diff --git a/gix-prompt/Cargo.toml b/gix-prompt/Cargo.toml index 90cde4aa3f8..d2206a609dc 100644 --- a/gix-prompt/Cargo.toml +++ b/gix-prompt/Cargo.toml @@ -7,7 +7,7 @@ description = "A crate of the gitoxide project for handling prompts in the termi authors = ["Sebastian Thiel "] edition = "2021" include = ["src/**/*", "LICENSE-*", "README.md", "CHANGELOG.md"] -rust-version = "1.64" +rust-version = "1.65" [lib] doctest = false diff --git a/gix-protocol/Cargo.toml b/gix-protocol/Cargo.toml index 5f4e0bc7bbb..a9b0e4a3f54 100644 --- a/gix-protocol/Cargo.toml +++ b/gix-protocol/Cargo.toml @@ -7,7 +7,7 @@ description = "A WIP crate of the gitoxide project for implementing git protocol authors = ["Sebastian Thiel "] edition = "2021" include = ["src/**/*", "LICENSE-*", "CHANGELOG.md", "!**/tests/**/*"] -rust-version = "1.64" +rust-version = "1.65" [lib] doctest = false diff --git a/gix-quote/Cargo.toml b/gix-quote/Cargo.toml index 8eae6e1ca18..6534295646a 100644 --- a/gix-quote/Cargo.toml +++ b/gix-quote/Cargo.toml @@ -6,7 +6,7 @@ license = "MIT/Apache-2.0" description = "A WIP crate of the gitoxide project dealing with various quotations used by git" authors = ["Sebastian Thiel "] edition = "2021" -rust-version = "1.64" +rust-version = "1.65" [lib] doctest = false diff --git a/gix-rebase/Cargo.toml b/gix-rebase/Cargo.toml index 38395c00e1d..a7231a193b1 100644 --- a/gix-rebase/Cargo.toml +++ b/gix-rebase/Cargo.toml @@ -6,7 +6,7 @@ license = "MIT/Apache-2.0" description = "A WIP crate of the gitoxide project dealing rebases" authors = ["Sebastian Thiel "] edition = "2021" -rust-version = "1.64" +rust-version = "1.65" [lib] doctest = false diff --git a/gix-ref/Cargo.toml b/gix-ref/Cargo.toml index 5bb5cf580eb..58fe39e0cda 100644 --- a/gix-ref/Cargo.toml +++ b/gix-ref/Cargo.toml @@ -7,7 +7,7 @@ description = "A crate to handle git references" authors = ["Sebastian Thiel "] edition = "2021" include = ["src/**/*", "LICENSE-*", "CHANGELOG.md"] -rust-version = "1.64" +rust-version = "1.65" autotests = false [lib] diff --git a/gix-ref/tests/Cargo.toml b/gix-ref/tests/Cargo.toml index 0d4834e1bb9..39f077b2007 100644 --- a/gix-ref/tests/Cargo.toml +++ b/gix-ref/tests/Cargo.toml @@ -8,7 +8,7 @@ description = "Please use `gix-` instead ('git' -> 'gix')" authors = ["Sebastian Thiel "] edition = "2021" include = ["src/**/*"] -rust-version = "1.64" +rust-version = "1.65" [features] ## Data structures implement `serde::Serialize` and `serde::Deserialize`. diff --git a/gix-refspec/Cargo.toml b/gix-refspec/Cargo.toml index 0a7727e0a7a..2f4f2be8d20 100644 --- a/gix-refspec/Cargo.toml +++ b/gix-refspec/Cargo.toml @@ -7,7 +7,7 @@ description = "A WIP crate of the gitoxide project for parsing and representing authors = ["Sebastian Thiel "] edition = "2021" include = ["src/**/*", "LICENSE-*", "CHANGELOG.md", "README.md"] -rust-version = "1.64" +rust-version = "1.65" [lib] doctest = false diff --git a/gix-revision/Cargo.toml b/gix-revision/Cargo.toml index f988cb5676a..17a3d76dabb 100644 --- a/gix-revision/Cargo.toml +++ b/gix-revision/Cargo.toml @@ -7,7 +7,7 @@ description = "A WIP crate of the gitoxide project dealing with finding names fo authors = ["Sebastian Thiel "] edition = "2021" include = ["src/**/*", "LICENSE-*", "CHANGELOG.md", "README.md"] -rust-version = "1.64" +rust-version = "1.65" [lib] doctest = false diff --git a/gix-revwalk/Cargo.toml b/gix-revwalk/Cargo.toml index bf77a9597c6..1931ad28fec 100644 --- a/gix-revwalk/Cargo.toml +++ b/gix-revwalk/Cargo.toml @@ -7,7 +7,7 @@ description = "A crate providing utilities for walking the revision graph" authors = ["Sebastian Thiel "] edition = "2021" include = ["src/**/*", "LICENSE-*", "CHANGELOG.md"] -rust-version = "1.64" +rust-version = "1.65" [lib] doctest = false diff --git a/gix-sec/Cargo.toml b/gix-sec/Cargo.toml index fb875782881..a7c5df5c588 100644 --- a/gix-sec/Cargo.toml +++ b/gix-sec/Cargo.toml @@ -7,7 +7,7 @@ description = "A WIP crate of the gitoxide project providing a shared trust mode authors = ["Sebastian Thiel "] edition = "2021" include = ["src/**/*", "LICENSE-*", "CHANGELOG.md"] -rust-version = "1.64" +rust-version = "1.65" [lib] doctest = false diff --git a/gix-sequencer/Cargo.toml b/gix-sequencer/Cargo.toml index e0f8d2fe9ef..c2055c33c45 100644 --- a/gix-sequencer/Cargo.toml +++ b/gix-sequencer/Cargo.toml @@ -6,7 +6,7 @@ license = "MIT/Apache-2.0" description = "A WIP crate of the gitoxide project handling sequences of human-aided operations" authors = ["Sebastian Thiel "] edition = "2021" -rust-version = "1.64" +rust-version = "1.65" [lib] doctest = false diff --git a/gix-submodule/Cargo.toml b/gix-submodule/Cargo.toml index 17c1d2bfeb4..61de1fbf1fd 100644 --- a/gix-submodule/Cargo.toml +++ b/gix-submodule/Cargo.toml @@ -6,7 +6,7 @@ license = "MIT/Apache-2.0" description = "A WIP crate of the gitoxide project dealing git submodules" authors = ["Sebastian Thiel "] edition = "2021" -rust-version = "1.64" +rust-version = "1.65" [lib] doctest = false diff --git a/gix-tempfile/Cargo.toml b/gix-tempfile/Cargo.toml index 08fd04d55cb..81818d64de1 100644 --- a/gix-tempfile/Cargo.toml +++ b/gix-tempfile/Cargo.toml @@ -7,7 +7,7 @@ description = "A tempfile implementation with a global registry to assure cleanu authors = ["Sebastian Thiel "] edition = "2021" include = ["src/**/*", "LICENSE-*", "README.md", "CHANGELOG.md"] -rust-version = "1.64" +rust-version = "1.65" [[example]] name = "delete-tempfiles-on-sigterm" diff --git a/gix-tix/Cargo.toml b/gix-tix/Cargo.toml index 82c047711bb..258fbc9343e 100644 --- a/gix-tix/Cargo.toml +++ b/gix-tix/Cargo.toml @@ -6,7 +6,7 @@ license = "MIT/Apache-2.0" description = "A tool like `tig`, but minimal, fast and efficient" authors = ["Sebastian Thiel "] edition = "2021" -rust-version = "1.64" +rust-version = "1.65" [lib] doctest = false diff --git a/gix-trace/CHANGELOG.md b/gix-trace/CHANGELOG.md new file mode 100644 index 00000000000..eb4c125abe0 --- /dev/null +++ b/gix-trace/CHANGELOG.md @@ -0,0 +1,37 @@ +# Changelog + +All notable changes to this project will be documented in this file. + +The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), +and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). + +## v0.1.0 (2023-06-16) + +### New Features + + - add `tracing` feature toggle to provide minimal tracing API + This API is based on `tracing-core`, not on tracing, and provides a limited + API that is always available, while being a no-op if `tracing` isn't enabled. + + That way, plumbing crates can add instrumentation at will. + +### Commit Statistics + + + + - 3 commits contributed to the release. + - 1 commit was understood as [conventional](https://www.conventionalcommits.org). + - 0 issues like '(#ID)' were seen in commit messages + +### Commit Details + + + +
view details + + * **Uncategorized** + - Add changelog prior to release of `gix-trace` ([`e1305c3`](https://github.com/Byron/gitoxide/commit/e1305c34092cdb067fbe597050bba4927cff491c)) + - Change MSRV to 1.65 ([`4f635fc`](https://github.com/Byron/gitoxide/commit/4f635fc4429350bae2582d25de86429969d28f30)) + - Add `tracing` feature toggle to provide minimal tracing API ([`093efaf`](https://github.com/Byron/gitoxide/commit/093efafa7c39aa03bfef4894779cca6e3716f471)) +
+ diff --git a/gix-trace/Cargo.toml b/gix-trace/Cargo.toml new file mode 100644 index 00000000000..a2dbafeaae7 --- /dev/null +++ b/gix-trace/Cargo.toml @@ -0,0 +1,38 @@ +[package] +name = "gix-trace" +description = "A crate to provide minimal `tracing` support that can be turned off to zero cost" +repository = "https://github.com/Byron/gitoxide" +version = "0.1.0" +authors = ["Sebastian Thiel "] +license = "MIT/Apache-2.0" +edition = "2021" +rust-version = "1.65" + +[lib] +doctest = false +test = false + +[features] + +## Note that there is no default feature, as the application is supposed to opt-in via `gix-features` or using this crate directly. +default = [] + +## Implement `tracing` with `tracing-core`, which provides applications with valuable performance details if they opt-in to it. +## +## Note that this may have overhead as well, thus instrumentations should be used stategically, only providing coarse tracing by default and adding details +## only where needed while marking them with the appropriate level. +tracing = [ "dep:tracing-core" ] + +## If enabled, detailed tracing is also emitted, which can greatly increase insights but at a cost. +tracing-detail = [ ] + + +[dependencies] +tracing-core = { version = "0.1.31", optional = true } + +document-features = { version = "0.2.0", optional = true } + +[package.metadata.docs.rs] +all-features = true +features = ["document-features"] +rustdoc-args = ["--cfg", "docsrs"] diff --git a/gix-trace/LICENSE-APACHE b/gix-trace/LICENSE-APACHE new file mode 120000 index 00000000000..965b606f331 --- /dev/null +++ b/gix-trace/LICENSE-APACHE @@ -0,0 +1 @@ +../LICENSE-APACHE \ No newline at end of file diff --git a/gix-trace/LICENSE-MIT b/gix-trace/LICENSE-MIT new file mode 120000 index 00000000000..76219eb72e8 --- /dev/null +++ b/gix-trace/LICENSE-MIT @@ -0,0 +1 @@ +../LICENSE-MIT \ No newline at end of file diff --git a/gix-trace/src/lib.rs b/gix-trace/src/lib.rs new file mode 100644 index 00000000000..08b4a914476 --- /dev/null +++ b/gix-trace/src/lib.rs @@ -0,0 +1,443 @@ +//! A crate providing macros for creating spans in various detail levels. `coarse!` shoudl be used for top-level operations, whereas +//! `detail!` should be used in plumbing crates unless their operations are likely to cost a lot of time. +//! +//! The application is supposed to explicitly turn on tracing via `gix-features`. +//! Crates that use `gix-features` should use `gix_features::trace`, and those who don't can use `gix_trace` directly. +//! ## Feature Flags +#![cfg_attr( + feature = "document-features", + cfg_attr(doc, doc = ::document_features::document_features!()) +)] +#![cfg_attr(docsrs, feature(doc_cfg, doc_auto_cfg))] +#![deny(missing_docs, rust_2018_idioms, unsafe_code)] + +/// The level at which the tracing item should be created. +/// +/// It's used to filter items early. +#[derive(Debug, Copy, Clone, PartialEq, Eq, Ord, PartialOrd)] +pub enum Level { + /// A coarse-grained trace level, one that should span entire operations with low frequency. + Coarse = 1, + /// Finer grained trace level that further subdivides coarse-level traces. + /// + /// Note that these should only be created for areas of the code which have significant cost. + Detail = 2, +} + +/// The maximum allowed level for tracing items, as compiled in. +#[cfg(feature = "tracing-detail")] +pub const MAX_LEVEL: Level = Level::Detail; +/// The maximum allowed level for tracing items, as compiled in. +#[cfg(not(feature = "tracing-detail"))] +pub const MAX_LEVEL: Level = Level::Coarse; + +#[cfg(feature = "tracing")] +mod enabled { + use tracing_core::{dispatcher::get_default as with_dispatcher, span::Id, Dispatch}; + + // these are used later in macros. + pub use tracing_core::{field, metadata, Metadata}; + + /// An entered span which will exit on drop. + pub struct Span { + id: Option<(Id, Dispatch)>, + } + + impl Span { + #[allow(missing_docs)] + pub fn new( + level: crate::Level, + meta: &'static Metadata<'static>, + values: &tracing_core::field::ValueSet<'_>, + ) -> Self { + if level > crate::MAX_LEVEL { + Self { id: None } + } else { + with_dispatcher(|dispatch| { + let id = dispatch.new_span(&tracing_core::span::Attributes::new(meta, values)); + dispatch.enter(&id); + Self { + id: Some((id, dispatch.clone())), + } + }) + } + } + } + + impl Drop for Span { + fn drop(&mut self) { + if let Some((id, dispatch)) = self.id.take() { + dispatch.exit(&id); + dispatch.try_close(id); + } + } + } + + #[doc(hidden)] + pub struct MetaOnlyCallsite(pub &'static Metadata<'static>); + + impl tracing_core::callsite::Callsite for MetaOnlyCallsite { + fn set_interest(&self, _: tracing_core::subscriber::Interest) {} + + fn metadata(&self) -> &Metadata<'_> { + self.0 + } + } + + #[doc(hidden)] + impl crate::Level { + pub const fn into_tracing_level(self) -> tracing_core::Level { + match self { + crate::Level::Coarse => tracing_core::Level::INFO, + crate::Level::Detail => tracing_core::Level::DEBUG, + } + } + } +} +#[cfg(feature = "tracing")] +pub use enabled::{MetaOnlyCallsite, Span}; + +#[cfg(feature = "tracing")] +#[doc(hidden)] +pub use enabled::{field, metadata, Metadata}; + +/// A macro to create a span. +#[cfg(feature = "tracing")] +#[macro_export] +macro_rules! span { + (target: $target:expr, $lvl:expr, $name:expr, $($fields:tt)*) => { + { + static META: $crate::Metadata<'static> = { + $crate::metadata! { + name: $name, + target: $target, + level: $lvl.into_tracing_level(), + fields: $crate::fieldset!( $($fields)* ), + callsite: &$crate::MetaOnlyCallsite(&META), + kind: $crate::metadata::Kind::SPAN, + } + }; + + $crate::Span::new( + $lvl, + &META, + &$crate::valueset!(META.fields(), $($fields)*), + ) + } + }; + (target: $target:expr, $lvl:expr, $name:expr) => { + $crate::span!(target: $target, $lvl, $name,) + }; + ($lvl:expr, $name:expr, $($fields:tt)*) => { + $crate::span!( + target: module_path!(), + $lvl, + $name, + $($fields)* + ) + }; + ($lvl:expr, $name:expr) => { + $crate::span!( + target: module_path!(), + $lvl, + $name, + ) + }; +} + +/// Create a new [coarse][Level::Coarse] span. +#[macro_export] +macro_rules! coarse { + (target: $target:expr, $name:expr, $($field:tt)*) => { + $crate::span!( + target: $target, + $crate::Level::Coarse, + $name, + $($field)* + ) + }; + (target: $target:expr, $name:expr) => { + $crate::coarse!(target: $target, $name,) + }; + ($name:expr, $($field:tt)*) => { + $crate::span!( + target: module_path!(), + $crate::Level::Coarse, + $name, + $($field)* + ) + }; + ($name:expr) => {$crate::coarse!($name,)}; +} + +/// Create a new [detail][Level::Detail] span. +#[macro_export] +macro_rules! detail { + (target: $target:expr, $name:expr, $($field:tt)*) => { + $crate::span!( + target: $target, + $crate::Level::Detail, + $name, + $($field)* + ) + }; + (target: $target:expr, $name:expr) => { + $crate::detail!(target: $target, $name,) + }; + ($name:expr, $($field:tt)*) => { + $crate::span!( + target: module_path!(), + $crate::Level::Detail, + $name, + $($field)* + ) + }; + ($name:expr) => {$crate::coarse!($name,)}; +} + +// Copied from`tracing`, would be nice to have it in `tracing-core`. +#[cfg(feature = "tracing")] +#[doc(hidden)] +#[macro_export] +macro_rules! fieldset { + // == base case == + (@ { $(,)* $($out:expr),* $(,)* } $(,)*) => { + &[ $($out),* ] + }; + + // == recursive cases (more tts) == + (@ { $(,)* $($out:expr),* } $($k:ident).+ = ?$val:expr, $($rest:tt)*) => { + $crate::fieldset!(@ { $($out),*, stringify!($($k).+) } $($rest)*) + }; + (@ { $(,)* $($out:expr),* } $($k:ident).+ = %$val:expr, $($rest:tt)*) => { + $crate::fieldset!(@ { $($out),*, stringify!($($k).+) } $($rest)*) + }; + (@ { $(,)* $($out:expr),* } $($k:ident).+ = $val:expr, $($rest:tt)*) => { + $crate::fieldset!(@ { $($out),*, stringify!($($k).+) } $($rest)*) + }; + // TODO(#1138): determine a new syntax for uninitialized span fields, and + // re-enable this. + // (@ { $($out:expr),* } $($k:ident).+ = _, $($rest:tt)*) => { + // $crate::fieldset!(@ { $($out),*, stringify!($($k).+) } $($rest)*) + // }; + (@ { $(,)* $($out:expr),* } ?$($k:ident).+, $($rest:tt)*) => { + $crate::fieldset!(@ { $($out),*, stringify!($($k).+) } $($rest)*) + }; + (@ { $(,)* $($out:expr),* } %$($k:ident).+, $($rest:tt)*) => { + $crate::fieldset!(@ { $($out),*, stringify!($($k).+) } $($rest)*) + }; + (@ { $(,)* $($out:expr),* } $($k:ident).+, $($rest:tt)*) => { + $crate::fieldset!(@ { $($out),*, stringify!($($k).+) } $($rest)*) + }; + + // Handle literal names + (@ { $(,)* $($out:expr),* } $k:literal = ?$val:expr, $($rest:tt)*) => { + $crate::fieldset!(@ { $($out),*, $k } $($rest)*) + }; + (@ { $(,)* $($out:expr),* } $k:literal = %$val:expr, $($rest:tt)*) => { + $crate::fieldset!(@ { $($out),*, $k } $($rest)*) + }; + (@ { $(,)* $($out:expr),* } $k:literal = $val:expr, $($rest:tt)*) => { + $crate::fieldset!(@ { $($out),*, $k } $($rest)*) + }; + + // Remainder is unparseable, but exists --- must be format args! + (@ { $(,)* $($out:expr),* } $($rest:tt)+) => { + $crate::fieldset!(@ { "message", $($out),*, }) + }; + + // == entry == + ($($args:tt)*) => { + $crate::fieldset!(@ { } $($args)*,) + }; +} + +// Copied from`tracing`, would be nice to have it in `tracing-core`. +#[cfg(feature = "tracing")] +#[doc(hidden)] +#[macro_export] +macro_rules! valueset { + + // === base case === + (@ { $(,)* $($val:expr),* $(,)* }, $next:expr $(,)*) => { + &[ $($val),* ] + }; + + // === recursive case (more tts) === + + // TODO(#1138): determine a new syntax for uninitialized span fields, and + // re-enable this. + // (@{ $(,)* $($out:expr),* }, $next:expr, $($k:ident).+ = _, $($rest:tt)*) => { + // $crate::valueset!(@ { $($out),*, (&$next, None) }, $next, $($rest)*) + // }; + (@ { $(,)* $($out:expr),* }, $next:expr, $($k:ident).+ = ?$val:expr, $($rest:tt)*) => { + $crate::valueset!( + @ { $($out),*, (&$next, Some(&debug(&$val) as &dyn Value)) }, + $next, + $($rest)* + ) + }; + (@ { $(,)* $($out:expr),* }, $next:expr, $($k:ident).+ = %$val:expr, $($rest:tt)*) => { + $crate::valueset!( + @ { $($out),*, (&$next, Some(&display(&$val) as &dyn Value)) }, + $next, + $($rest)* + ) + }; + (@ { $(,)* $($out:expr),* }, $next:expr, $($k:ident).+ = $val:expr, $($rest:tt)*) => { + $crate::valueset!( + @ { $($out),*, (&$next, Some(&$val as &dyn Value)) }, + $next, + $($rest)* + ) + }; + (@ { $(,)* $($out:expr),* }, $next:expr, $($k:ident).+, $($rest:tt)*) => { + $crate::valueset!( + @ { $($out),*, (&$next, Some(&$($k).+ as &dyn Value)) }, + $next, + $($rest)* + ) + }; + (@ { $(,)* $($out:expr),* }, $next:expr, ?$($k:ident).+, $($rest:tt)*) => { + $crate::valueset!( + @ { $($out),*, (&$next, Some(&debug(&$($k).+) as &dyn Value)) }, + $next, + $($rest)* + ) + }; + (@ { $(,)* $($out:expr),* }, $next:expr, %$($k:ident).+, $($rest:tt)*) => { + $crate::valueset!( + @ { $($out),*, (&$next, Some(&display(&$($k).+) as &dyn Value)) }, + $next, + $($rest)* + ) + }; + (@ { $(,)* $($out:expr),* }, $next:expr, $($k:ident).+ = ?$val:expr) => { + $crate::valueset!( + @ { $($out),*, (&$next, Some(&debug(&$val) as &dyn Value)) }, + $next, + ) + }; + (@ { $(,)* $($out:expr),* }, $next:expr, $($k:ident).+ = %$val:expr) => { + $crate::valueset!( + @ { $($out),*, (&$next, Some(&display(&$val) as &dyn Value)) }, + $next, + ) + }; + (@ { $(,)* $($out:expr),* }, $next:expr, $($k:ident).+ = $val:expr) => { + $crate::valueset!( + @ { $($out),*, (&$next, Some(&$val as &dyn Value)) }, + $next, + ) + }; + (@ { $(,)* $($out:expr),* }, $next:expr, $($k:ident).+) => { + $crate::valueset!( + @ { $($out),*, (&$next, Some(&$($k).+ as &dyn Value)) }, + $next, + ) + }; + (@ { $(,)* $($out:expr),* }, $next:expr, ?$($k:ident).+) => { + $crate::valueset!( + @ { $($out),*, (&$next, Some(&debug(&$($k).+) as &dyn Value)) }, + $next, + ) + }; + (@ { $(,)* $($out:expr),* }, $next:expr, %$($k:ident).+) => { + $crate::valueset!( + @ { $($out),*, (&$next, Some(&display(&$($k).+) as &dyn Value)) }, + $next, + ) + }; + + // Handle literal names + (@ { $(,)* $($out:expr),* }, $next:expr, $k:literal = ?$val:expr, $($rest:tt)*) => { + $crate::valueset!( + @ { $($out),*, (&$next, Some(&debug(&$val) as &dyn Value)) }, + $next, + $($rest)* + ) + }; + (@ { $(,)* $($out:expr),* }, $next:expr, $k:literal = %$val:expr, $($rest:tt)*) => { + $crate::valueset!( + @ { $($out),*, (&$next, Some(&display(&$val) as &dyn Value)) }, + $next, + $($rest)* + ) + }; + (@ { $(,)* $($out:expr),* }, $next:expr, $k:literal = $val:expr, $($rest:tt)*) => { + $crate::valueset!( + @ { $($out),*, (&$next, Some(&$val as &dyn Value)) }, + $next, + $($rest)* + ) + }; + (@ { $(,)* $($out:expr),* }, $next:expr, $k:literal = ?$val:expr) => { + $crate::valueset!( + @ { $($out),*, (&$next, Some(&debug(&$val) as &dyn Value)) }, + $next, + ) + }; + (@ { $(,)* $($out:expr),* }, $next:expr, $k:literal = %$val:expr) => { + $crate::valueset!( + @ { $($out),*, (&$next, Some(&display(&$val) as &dyn Value)) }, + $next, + ) + }; + (@ { $(,)* $($out:expr),* }, $next:expr, $k:literal = $val:expr) => { + $crate::valueset!( + @ { $($out),*, (&$next, Some(&$val as &dyn Value)) }, + $next, + ) + }; + + // Remainder is unparsable, but exists --- must be format args! + (@ { $(,)* $($out:expr),* }, $next:expr, $($rest:tt)+) => { + $crate::valueset!(@ { (&$next, Some(&format_args!($($rest)+) as &dyn Value)), $($out),* }, $next, ) + }; + + // === entry === + ($fields:expr, $($kvs:tt)+) => { + { + #[allow(unused_imports)] + use $crate::field::{debug, display, Value}; + let mut iter = $fields.iter(); + $fields.value_set($crate::valueset!( + @ { }, + iter.next().expect("FieldSet corrupted (this is a bug)"), + $($kvs)+ + )) + } + }; + ($fields:expr,) => { + { + $fields.value_set(&[]) + } + }; +} + +/// A macro to create a span. +#[cfg(not(feature = "tracing"))] +#[macro_export] +macro_rules! span { + (target: $target:expr, $lvl:expr, $name:expr, $($fields:tt)*) => { + () + }; + (target: $target:expr, $lvl:expr, $name:expr) => { + $crate::span!(target: $target, $lvl, $name,) + }; + ($lvl:expr, $name:expr, $($fields:tt)*) => { + $crate::span!( + target: module_path!(), + $lvl, + $name, + $($fields)* + ) + }; + ($lvl:expr, $name:expr) => { + $crate::span!( + target: module_path!(), + $lvl, + $name, + ) + }; +} diff --git a/gix-trace/tests/trace.rs b/gix-trace/tests/trace.rs new file mode 100644 index 00000000000..cda2cbc712a --- /dev/null +++ b/gix-trace/tests/trace.rs @@ -0,0 +1,21 @@ +use gix_trace::{coarse, detail, span}; +#[test] +fn span() { + let _x = span!(gix_trace::Level::Coarse, "hello"); + span!(gix_trace::Level::Coarse, "hello", x = "value", y = 42); + span!(target: "other", gix_trace::Level::Coarse, "hello", x = "value", y = 42); +} + +#[test] +fn coarse() { + let _x = coarse!("hello"); + coarse!("hello", x = "value", y = 42); + coarse!(target: "other", "hello", x = "value", y = 42); +} + +#[test] +fn detail() { + let _y = detail!("hello"); + detail!("hello", x = "value", y = 42); + detail!(target: "other", "hello", x = "value", y = 42); +} diff --git a/gix-transport/Cargo.toml b/gix-transport/Cargo.toml index 8f2a1bde185..d979b984c76 100644 --- a/gix-transport/Cargo.toml +++ b/gix-transport/Cargo.toml @@ -7,7 +7,7 @@ description = "A WIP crate of the gitoxide project dedicated to implementing the authors = ["Sebastian Thiel "] edition = "2021" include = ["src/**/*", "LICENSE-*", "CHANGELOG.md"] -rust-version = "1.64" +rust-version = "1.65" [lib] doctest = false diff --git a/gix-traverse/Cargo.toml b/gix-traverse/Cargo.toml index d478ab6015d..8684e16635f 100644 --- a/gix-traverse/Cargo.toml +++ b/gix-traverse/Cargo.toml @@ -7,7 +7,7 @@ description = "A WIP crate of the gitoxide project" authors = ["Sebastian Thiel "] edition = "2021" include = ["src/**/*", "LICENSE-*", "CHANGELOG.md"] -rust-version = "1.64" +rust-version = "1.65" autotests = false [lib] diff --git a/gix-traverse/tests/Cargo.toml b/gix-traverse/tests/Cargo.toml index 3b50a811b49..27f3054c8e7 100644 --- a/gix-traverse/tests/Cargo.toml +++ b/gix-traverse/tests/Cargo.toml @@ -7,7 +7,7 @@ description = "Please use `gix-` instead ('git' -> 'gix')" authors = ["Sebastian Thiel "] edition = "2021" include = ["src/**/*"] -rust-version = "1.64" +rust-version = "1.65" [[test]] name ="test" diff --git a/gix-tui/Cargo.toml b/gix-tui/Cargo.toml index 0255687e628..fb08a73960a 100644 --- a/gix-tui/Cargo.toml +++ b/gix-tui/Cargo.toml @@ -6,7 +6,7 @@ license = "MIT/Apache-2.0" description = "A WIP crate of the gitoxide project dedicated to a terminal user interface to interact with git repositories" authors = ["Sebastian Thiel "] edition = "2021" -rust-version = "1.64" +rust-version = "1.65" [[bin]] name = "gixi" diff --git a/gix-url/Cargo.toml b/gix-url/Cargo.toml index 12cc6e18a63..5b726561cc7 100644 --- a/gix-url/Cargo.toml +++ b/gix-url/Cargo.toml @@ -7,7 +7,7 @@ description = "A WIP crate of the gitoxide project implementing parsing and seri authors = ["Sebastian Thiel "] edition = "2021" include = ["src/**/*", "LICENSE-*", "CHANGELOG.md"] -rust-version = "1.64" +rust-version = "1.65" [lib] doctest = false diff --git a/gix-utils/Cargo.toml b/gix-utils/Cargo.toml index d8f1c2f8b82..e37f33c2b51 100644 --- a/gix-utils/Cargo.toml +++ b/gix-utils/Cargo.toml @@ -6,7 +6,7 @@ license = "MIT/Apache-2.0" description = "A crate with `gitoxide` utilities that don't need feature toggles" authors = ["Sebastian Thiel "] edition = "2021" -rust-version = "1.64" +rust-version = "1.65" [lib] doctest = false diff --git a/gix-validate/Cargo.toml b/gix-validate/Cargo.toml index 653b54b7491..ab27a2c1398 100644 --- a/gix-validate/Cargo.toml +++ b/gix-validate/Cargo.toml @@ -7,7 +7,7 @@ description = "Validation functions for various kinds of names in git" authors = ["Sebastian Thiel "] edition = "2021" include = ["src/**/*", "LICENSE-*", "CHANGELOG.md"] -rust-version = "1.64" +rust-version = "1.65" [lib] doctest = false diff --git a/gix-worktree/Cargo.toml b/gix-worktree/Cargo.toml index 3e8fe5aa6af..af0797e7423 100644 --- a/gix-worktree/Cargo.toml +++ b/gix-worktree/Cargo.toml @@ -7,7 +7,7 @@ description = "A WIP crate of the gitoxide project dedicated implementing everyt authors = ["Sebastian Thiel "] edition = "2021" include = ["src/**/*", "LICENSE-*", "CHANGELOG.md"] -rust-version = "1.64" +rust-version = "1.65" [lib] doctest = false diff --git a/gix/Cargo.toml b/gix/Cargo.toml index 155eb73d7a3..941d88c9bb4 100644 --- a/gix/Cargo.toml +++ b/gix/Cargo.toml @@ -7,7 +7,7 @@ version = "0.46.0" authors = ["Sebastian Thiel "] edition = "2021" include = ["src/**/*", "LICENSE-*", "CHANGELOG.md"] -rust-version = "1.64" +rust-version = "1.65" [lib] doctest = false @@ -141,6 +141,7 @@ gix-transport = { version = "^0.32.0", path = "../gix-transport", optional = tru gix-diff = { version = "^0.30.1", path = "../gix-diff" } gix-mailmap = { version = "^0.13.0", path = "../gix-mailmap" } gix-features = { version = "^0.30.0", path = "../gix-features", features = ["progress", "once_cell"] } +gix-trace = { version = "^0.1.0", path = "../gix-trace" } gix-attributes = { version = "^0.13.1", path = "../gix-attributes" } gix-ignore = { version = "^0.3.0", path = "../gix-ignore" } diff --git a/gix/src/clone/checkout.rs b/gix/src/clone/checkout.rs index 82300555118..572dcc4261e 100644 --- a/gix/src/clone/checkout.rs +++ b/gix/src/clone/checkout.rs @@ -69,6 +69,7 @@ pub mod main_worktree { mut progress: impl crate::Progress, should_interrupt: &AtomicBool, ) -> Result<(Repository, gix_worktree::checkout::Outcome), Error> { + let _span = gix_trace::coarse!("gix::clone::PrepareCheckout::main_worktree()"); let repo = self .repo .as_ref() diff --git a/gix/src/discover.rs b/gix/src/discover.rs index fa0edfd5fb9..da43092c318 100644 --- a/gix/src/discover.rs +++ b/gix/src/discover.rs @@ -36,6 +36,7 @@ impl ThreadSafeRepository { options: upwards::Options<'_>, trust_map: gix_sec::trust::Mapping, ) -> Result { + let _span = gix_trace::coarse!("ThreadSafeRepository::discover()"); let (path, trust) = upwards_opts(directory, options)?; let (git_dir, worktree_dir) = path.into_repository_and_work_tree_directories(); let mut options = trust_map.into_value_by_level(trust); diff --git a/gix/src/lib.rs b/gix/src/lib.rs index 5808fa4eb61..87fb60f3823 100644 --- a/gix/src/lib.rs +++ b/gix/src/lib.rs @@ -93,6 +93,7 @@ pub use gix_ref as refs; pub use gix_refspec as refspec; pub use gix_sec as sec; pub use gix_tempfile as tempfile; +pub use gix_trace as trace; pub use gix_traverse as traverse; pub use gix_url as url; #[doc(inline)] diff --git a/gix/src/open/repository.rs b/gix/src/open/repository.rs index e89fdc4306c..4ebc835efe8 100644 --- a/gix/src/open/repository.rs +++ b/gix/src/open/repository.rs @@ -51,6 +51,7 @@ impl ThreadSafeRepository { /// /// Note that you should use [`crate::discover()`] if security should be adjusted by ownership. pub fn open_opts(path: impl Into, mut options: Options) -> Result { + let _span = gix_trace::coarse!("ThreadSafeRepository::open()"); let (path, kind) = { let path = path.into(); let looks_like_git_dir = @@ -103,6 +104,7 @@ impl ThreadSafeRepository { fallback_directory: impl Into, trust_map: gix_sec::trust::Mapping, ) -> Result { + let _span = gix_trace::coarse!("ThreadSafeRepository::open_with_environment_overrides()"); let overrides = EnvironmentOverrides::from_env()?; let (path, path_kind): (PathBuf, _) = match overrides.git_dir { Some(git_dir) => gix_discover::is_git(&git_dir) @@ -139,6 +141,7 @@ impl ThreadSafeRepository { mut worktree_dir: Option, options: Options, ) -> Result { + let _span = gix_trace::detail!("open_from_paths()"); let Options { git_dir_trust, object_store_slots, @@ -238,6 +241,7 @@ impl ThreadSafeRepository { refs.write_reflog = config::cache::util::reflog_or_default(config.reflog, worktree_dir.is_some()); let replacements = replacement_objects_refs_prefix(&config.resolved, lenient_config, filter_config_section)? .and_then(|prefix| { + let _span = gix_trace::detail!("find replacement objects"); let platform = refs.iter().ok()?; let iter = platform.prefixed(&prefix).ok()?; let prefix = prefix.to_str()?; diff --git a/gix/src/remote/connection/fetch/receive_pack.rs b/gix/src/remote/connection/fetch/receive_pack.rs index ddb28203717..a4e1a053f79 100644 --- a/gix/src/remote/connection/fetch/receive_pack.rs +++ b/gix/src/remote/connection/fetch/receive_pack.rs @@ -78,6 +78,7 @@ where P: Progress, P::SubProgress: 'static, { + let _span = gix_trace::coarse!("fetch::Prepare::receive()"); let mut con = self.con.take().expect("receive() can only be called once"); let handshake = &self.ref_map.handshake; @@ -115,6 +116,7 @@ where }); } + let negotiate_span = gix_trace::detail!("negotiate"); let mut negotiator = repo .config .resolved @@ -217,6 +219,8 @@ where }; let graph = graph.detach(); drop(graph_repo); + drop(negotiate_span); + let previous_response = previous_response.expect("knowledge of a pack means a response was received"); if !previous_response.shallow_updates().is_empty() && shallow_lock.is_none() { let reject_shallow_remote = repo diff --git a/gix/src/remote/connection/fetch/update_refs/mod.rs b/gix/src/remote/connection/fetch/update_refs/mod.rs index 334dbd9269c..f92a0cf5b6b 100644 --- a/gix/src/remote/connection/fetch/update_refs/mod.rs +++ b/gix/src/remote/connection/fetch/update_refs/mod.rs @@ -53,6 +53,7 @@ pub(crate) fn update( dry_run: fetch::DryRun, write_packed_refs: fetch::WritePackedRefs, ) -> Result { + let _span = gix_trace::detail!("update_refs()"); let mut edits = Vec::new(); let mut updates = Vec::new(); diff --git a/src/plumbing/main.rs b/src/plumbing/main.rs index 115253dd178..306b9eae51a 100644 --- a/src/plumbing/main.rs +++ b/src/plumbing/main.rs @@ -64,6 +64,13 @@ pub fn main() -> Result<()> { let verbose = args.verbose; let format = args.format; let cmd = args.cmd; + #[cfg_attr(not(feature = "tracing"), allow(unused_mut))] + #[cfg_attr(feature = "tracing", allow(unused_assignments))] + let mut trace = false; + #[cfg(feature = "tracing")] + { + trace = args.trace + } let object_hash = args.object_hash; let config = args.config; let repository = args.repository; @@ -128,9 +135,26 @@ pub fn main() -> Result<()> { })?; match cmd { + #[cfg(feature = "gitoxide-core-tools-corpus")] + Subcommands::Corpus(crate::plumbing::options::corpus::Platform { db, path, cmd }) => prepare_and_run( + "corpus", + trace, + auto_verbose, + progress, + progress_keep_open, + core::corpus::PROGRESS_RANGE, + move |progress, _out, _err| { + let mut engine = core::corpus::Engine::open_or_create(db, env!("GITOXIDE_VERSION").into(), progress)?; + match cmd { + crate::plumbing::options::corpus::SubCommands::Run => engine.run(path, thread_limit), + crate::plumbing::options::corpus::SubCommands::Refresh => engine.refresh(path), + } + }, + ), Subcommands::CommitGraph(cmd) => match cmd { commitgraph::Subcommands::List { spec } => prepare_and_run( "commitgraph-list", + trace, auto_verbose, progress, progress_keep_open, @@ -142,6 +166,7 @@ pub fn main() -> Result<()> { .map(|_| ()), commitgraph::Subcommands::Verify { statistics } => prepare_and_run( "commitgraph-verify", + trace, auto_verbose, progress, progress_keep_open, @@ -178,6 +203,7 @@ pub fn main() -> Result<()> { }; prepare_and_run( "clone", + trace, auto_verbose, progress, progress_keep_open, @@ -207,6 +233,7 @@ pub fn main() -> Result<()> { }; prepare_and_run( "fetch", + trace, auto_verbose, progress, progress_keep_open, @@ -253,6 +280,7 @@ pub fn main() -> Result<()> { { prepare_and_run( "remote-refs", + trace, auto_verbose, progress, progress_keep_open, @@ -290,6 +318,7 @@ pub fn main() -> Result<()> { } Subcommands::Config(config::Platform { filter }) => prepare_and_run( "config-list", + trace, verbose, progress, progress_keep_open, @@ -309,6 +338,7 @@ pub fn main() -> Result<()> { free::Subcommands::CommitGraph(cmd) => match cmd { free::commitgraph::Subcommands::Verify { path, statistics } => prepare_and_run( "commitgraph-verify", + trace, auto_verbose, progress, progress_keep_open, @@ -338,6 +368,7 @@ pub fn main() -> Result<()> { file, } => prepare_and_run( "index-from-list", + trace, verbose, progress, progress_keep_open, @@ -351,6 +382,7 @@ pub fn main() -> Result<()> { keep_going, } => prepare_and_run( "index-checkout", + trace, auto_verbose, progress, progress_keep_open, @@ -374,6 +406,7 @@ pub fn main() -> Result<()> { ), free::index::Subcommands::Info { no_details } => prepare_and_run( "index-entries", + trace, verbose, progress, progress_keep_open, @@ -392,6 +425,7 @@ pub fn main() -> Result<()> { ), free::index::Subcommands::Verify => prepare_and_run( "index-verify", + trace, auto_verbose, progress, progress_keep_open, @@ -406,6 +440,7 @@ pub fn main() -> Result<()> { } => match cmd { free::mailmap::Subcommands::Verify => prepare_and_run( "mailmap-verify", + trace, auto_verbose, progress, progress_keep_open, @@ -429,6 +464,7 @@ pub fn main() -> Result<()> { let has_tips = !tips.is_empty(); prepare_and_run( "pack-create", + trace, verbose, progress, progress_keep_open, @@ -490,6 +526,7 @@ pub fn main() -> Result<()> { refs_directory, } => prepare_and_run( "pack-receive", + trace, verbose, progress, progress_keep_open, @@ -521,6 +558,7 @@ pub fn main() -> Result<()> { verify, } => prepare_and_run( "pack-explode", + trace, auto_verbose, progress, progress_keep_open, @@ -553,6 +591,7 @@ pub fn main() -> Result<()> { path, } => prepare_and_run( "pack-verify", + trace, auto_verbose, progress, progress_keep_open, @@ -581,6 +620,7 @@ pub fn main() -> Result<()> { match cmd { free::pack::multi_index::Subcommands::Entries => prepare_and_run( "pack-multi-index-entries", + trace, verbose, progress, progress_keep_open, @@ -589,6 +629,7 @@ pub fn main() -> Result<()> { ), free::pack::multi_index::Subcommands::Info => prepare_and_run( "pack-multi-index-info", + trace, verbose, progress, progress_keep_open, @@ -599,6 +640,7 @@ pub fn main() -> Result<()> { ), free::pack::multi_index::Subcommands::Verify => prepare_and_run( "pack-multi-index-verify", + trace, auto_verbose, progress, progress_keep_open, @@ -609,6 +651,7 @@ pub fn main() -> Result<()> { ), free::pack::multi_index::Subcommands::Create { index_paths } => prepare_and_run( "pack-multi-index-create", + trace, verbose, progress, progress_keep_open, @@ -632,6 +675,7 @@ pub fn main() -> Result<()> { directory, } => prepare_and_run( "pack-index-create", + trace, verbose, progress, progress_keep_open, @@ -677,6 +721,7 @@ pub fn main() -> Result<()> { }, } => prepare_and_run( "verify", + trace, auto_verbose, progress, progress_keep_open, @@ -699,6 +744,7 @@ pub fn main() -> Result<()> { Subcommands::Revision(cmd) => match cmd { revision::Subcommands::List { spec, svg, limit } => prepare_and_run( "revision-list", + trace, auto_verbose, progress, progress_keep_open, @@ -721,6 +767,7 @@ pub fn main() -> Result<()> { ), revision::Subcommands::PreviousBranches => prepare_and_run( "revision-previousbranches", + trace, verbose, progress, progress_keep_open, @@ -731,6 +778,7 @@ pub fn main() -> Result<()> { ), revision::Subcommands::Explain { spec } => prepare_and_run( "revision-explain", + trace, verbose, progress, progress_keep_open, @@ -743,6 +791,7 @@ pub fn main() -> Result<()> { cat_file, } => prepare_and_run( "revision-parse", + trace, verbose, progress, progress_keep_open, @@ -773,6 +822,7 @@ pub fn main() -> Result<()> { rev_spec, } => prepare_and_run( "commit-describe", + trace, verbose, progress, progress_keep_open, @@ -803,6 +853,7 @@ pub fn main() -> Result<()> { extended, } => prepare_and_run( "tree-entries", + trace, verbose, progress, progress_keep_open, @@ -820,6 +871,7 @@ pub fn main() -> Result<()> { ), tree::Subcommands::Info { treeish, extended } => prepare_and_run( "tree-info", + trace, verbose, progress, progress_keep_open, @@ -839,6 +891,7 @@ pub fn main() -> Result<()> { Subcommands::Odb(cmd) => match cmd { odb::Subcommands::Stats => prepare_and_run( "odb-stats", + trace, auto_verbose, progress, progress_keep_open, @@ -855,6 +908,7 @@ pub fn main() -> Result<()> { ), odb::Subcommands::Entries => prepare_and_run( "odb-entries", + trace, verbose, progress, progress_keep_open, @@ -863,6 +917,7 @@ pub fn main() -> Result<()> { ), odb::Subcommands::Info => prepare_and_run( "odb-info", + trace, verbose, progress, progress_keep_open, @@ -873,6 +928,7 @@ pub fn main() -> Result<()> { Subcommands::Mailmap(cmd) => match cmd { mailmap::Subcommands::Entries => prepare_and_run( "mailmap-entries", + trace, verbose, progress, progress_keep_open, @@ -885,6 +941,7 @@ pub fn main() -> Result<()> { Subcommands::Attributes(cmd) => match cmd { attributes::Subcommands::Query { statistics, pathspecs } => prepare_and_run( "attributes-query", + trace, verbose, progress, progress_keep_open, @@ -911,6 +968,7 @@ pub fn main() -> Result<()> { ), attributes::Subcommands::ValidateBaseline { statistics, no_ignore } => prepare_and_run( "attributes-validate-baseline", + trace, auto_verbose, progress, progress_keep_open, @@ -945,6 +1003,7 @@ pub fn main() -> Result<()> { show_ignore_patterns, } => prepare_and_run( "exclude-query", + trace, verbose, progress, progress_keep_open, @@ -982,6 +1041,7 @@ pub fn main() -> Result<()> { statistics, } => prepare_and_run( "index-entries", + trace, verbose, progress, progress_keep_open, @@ -1013,6 +1073,7 @@ pub fn main() -> Result<()> { spec, } => prepare_and_run( "index-from-tree", + trace, verbose, progress, progress_keep_open, diff --git a/src/plumbing/options/mod.rs b/src/plumbing/options/mod.rs index 4a9ce607ae2..db4f6306d26 100644 --- a/src/plumbing/options/mod.rs +++ b/src/plumbing/options/mod.rs @@ -4,7 +4,7 @@ use gitoxide_core as core; use gix::bstr::BString; #[derive(Debug, clap::Parser)] -#[clap(name = "gix-plumbing", about = "The git underworld", version = clap::crate_version!())] +#[clap(name = "gix", about = "The git underworld", version = env!("GITOXIDE_VERSION"))] #[clap(subcommand_required = true)] #[clap(arg_required_else_help = true)] pub struct Args { @@ -29,6 +29,11 @@ pub struct Args { #[clap(long, short = 'v')] pub verbose: bool, + /// Display structured `tracing` output in a tree-like structure. + #[clap(long)] + #[cfg(feature = "tracing")] + pub trace: bool, + /// Turn off verbose message display for commands where these are shown by default. #[clap(long, conflicts_with("verbose"))] pub no_verbose: bool, @@ -117,11 +122,39 @@ pub enum Subcommands { /// Show which git configuration values are used or planned. ConfigTree, Config(config::Platform), + #[cfg(feature = "gitoxide-core-tools-corpus")] + Corpus(corpus::Platform), /// Subcommands that need no git repository to run. #[clap(subcommand)] Free(free::Subcommands), } +#[cfg(feature = "gitoxide-core-tools-corpus")] +pub mod corpus { + use std::path::PathBuf; + + #[derive(Debug, clap::Parser)] + #[command(about = "run algorithms on a corpus of git repositories and store their results for later analysis")] + pub struct Platform { + /// The path to the database to read and write depending on the sub-command. + #[arg(long, default_value = "corpus.db")] + pub db: PathBuf, + /// The path to the root of the corpus to search repositories in. + #[arg(long, short = 'p', default_value = ".")] + pub path: PathBuf, + #[clap(subcommand)] + pub cmd: SubCommands, + } + + #[derive(Debug, clap::Subcommand)] + pub enum SubCommands { + /// Perform a corpus run on all registered repositories. + Run, + /// Re-read all repositories under the corpus directory, and add or update them. + Refresh, + } +} + pub mod config { use gix::bstr::BString; diff --git a/src/porcelain/main.rs b/src/porcelain/main.rs index 7e8b8d1d666..43ed3e2f5ef 100644 --- a/src/porcelain/main.rs +++ b/src/porcelain/main.rs @@ -24,6 +24,7 @@ pub fn main() -> Result<()> { let should_interrupt = Arc::clone(&should_interrupt); move || should_interrupt.store(true, Ordering::SeqCst) })?; + let trace = false; let verbose = !args.quiet; let progress = args.progress; #[cfg(feature = "gitoxide-core-tools")] @@ -34,6 +35,7 @@ pub fn main() -> Result<()> { #[cfg(debug_assertions)] Subcommands::Panic => prepare_and_run( "panic-behaviour", + trace, verbose, progress, progress_keep_open, @@ -53,6 +55,7 @@ pub fn main() -> Result<()> { use gitoxide_core::query; prepare_and_run( "query", + trace, verbose, progress, progress_keep_open, @@ -92,6 +95,7 @@ pub fn main() -> Result<()> { use gitoxide_core::hours; prepare_and_run( "estimate-hours", + trace, verbose, progress, progress_keep_open, @@ -118,6 +122,7 @@ pub fn main() -> Result<()> { use gitoxide_core::organize; prepare_and_run( "find", + trace, verbose, progress, progress_keep_open, @@ -141,6 +146,7 @@ pub fn main() -> Result<()> { use gitoxide_core::organize; prepare_and_run( "organize", + trace, verbose, progress, progress_keep_open, diff --git a/src/porcelain/options.rs b/src/porcelain/options.rs index 1ae734bf8c0..784e112a0f2 100644 --- a/src/porcelain/options.rs +++ b/src/porcelain/options.rs @@ -1,7 +1,7 @@ use std::path::PathBuf; #[derive(Debug, clap::Parser)] -#[clap(about = "The rusty git", version = clap::crate_version!())] +#[clap(about = "The rusty git", version = env!("GITOXIDE_VERSION"))] #[clap(subcommand_required = true)] pub struct Args { /// Do not display verbose messages and progress information @@ -94,7 +94,6 @@ pub mod tools { #[derive(Debug, clap::Parser)] #[command( about = "a database accelerated engine to extract information and query it", - version = clap::crate_version!(), visible_alias = "q" )] pub struct Query { @@ -135,7 +134,6 @@ pub mod tools { #[clap( about = "Estimate hours worked based on a commit history", long_about = "See https://github.com/kimmobrunfeldt/git-hours#how-it-works for details", - version = clap::crate_version!(), visible_alias = "h", visible_alias = "hours" )] diff --git a/src/shared.rs b/src/shared.rs index 0133bcf939e..fb0ed271413 100644 --- a/src/shared.rs +++ b/src/shared.rs @@ -55,6 +55,7 @@ pub mod pretty { #[cfg(feature = "small")] pub fn prepare_and_run( name: &str, + _trace: bool, verbose: bool, progress: bool, #[cfg_attr(not(feature = "prodash-render-tui"), allow(unused_variables))] progress_keep_open: bool, @@ -95,9 +96,44 @@ pub mod pretty { } } + #[cfg(feature = "tracing")] + fn init_tracing( + enable: bool, + reverse_lines: bool, + progress: &gix::progress::prodash::tree::Root, + ) -> anyhow::Result { + Ok(if enable { + let processor = tracing_forest::Printer::new().formatter({ + let progress = std::sync::Mutex::new(progress.add_child("tracing")); + move |tree: &tracing_forest::tree::Tree| -> Result { + use gix::Progress; + use tracing_forest::Formatter; + let tree = tracing_forest::printer::Pretty.fmt(tree)?; + let progress = &mut progress.lock().unwrap(); + if reverse_lines { + for line in tree.lines().rev() { + progress.info(line); + } + } else { + for line in tree.lines() { + progress.info(line); + } + } + Ok(String::new()) + } + }); + use tracing_subscriber::layer::SubscriberExt; + let subscriber = tracing_subscriber::Registry::default().with(tracing_forest::ForestLayer::from(processor)); + tracing::subscriber::set_default(subscriber) + } else { + tracing::subscriber::set_default(tracing_subscriber::Registry::default()) + }) + } + #[cfg(not(feature = "small"))] pub fn prepare_and_run( name: &str, + trace: bool, verbose: bool, progress: bool, #[cfg_attr(not(feature = "prodash-render-tui"), allow(unused_variables))] progress_keep_open: bool, @@ -122,12 +158,18 @@ pub mod pretty { use crate::shared::{self, STANDARD_RANGE}; let progress = shared::progress_tree(); let sub_progress = progress.add_child(name); + let _trace = init_tracing(trace, false, &progress)?; let handle = shared::setup_line_renderer_range(&progress, range.into().unwrap_or(STANDARD_RANGE)); let mut out = Vec::::new(); let mut err = Vec::::new(); + + let span = gix::trace::coarse!("run"); let res = run(progress::DoOrDiscard::from(Some(sub_progress)), &mut out, &mut err); + #[cfg(feature = "tracing")] + drop(span); + handle.shutdown_and_wait(); std::io::Write::write_all(&mut stdout(), &out)?; std::io::Write::write_all(&mut stderr(), &err)?; @@ -149,6 +191,7 @@ pub mod pretty { } let progress = prodash::tree::Root::new(); let sub_progress = progress.add_child(name); + let render_tui = prodash::render::tui( stdout(), std::sync::Arc::downgrade(&progress), @@ -169,12 +212,19 @@ pub mod pretty { tx.send(Event::UiDone).ok(); } }); - let thread = std::thread::spawn(move || { - // We might have something interesting to show, which would be hidden by the alternate screen if there is a progress TUI - // We know that the printing happens at the end, so this is fine. - let mut out = Vec::new(); - let res = run(progress::DoOrDiscard::from(Some(sub_progress)), &mut out, &mut stderr()); - tx.send(Event::ComputationDone(res, out)).ok(); + let thread = std::thread::spawn({ + let name = name.to_owned(); + move || { + let _trace = init_tracing(trace, true, &progress).ok(); + // We might have something interesting to show, which would be hidden by the alternate screen if there is a progress TUI + // We know that the printing happens at the end, so this is fine. + let mut out = Vec::new(); + let span = gix::trace::coarse!("run", name = name); + let res = run(progress::DoOrDiscard::from(Some(sub_progress)), &mut out, &mut stderr()); + #[cfg(feature = "tracing")] + drop(span); + tx.send(Event::ComputationDone(res, out)).ok(); + } }); loop { match rx.recv() { diff --git a/tests/snapshots/panic-behaviour/expected-failure b/tests/snapshots/panic-behaviour/expected-failure index 1dafa93b97b..c09ee20e7bb 100644 --- a/tests/snapshots/panic-behaviour/expected-failure +++ b/tests/snapshots/panic-behaviour/expected-failure @@ -1,2 +1,2 @@ -thread 'main' panicked at 'something went very wrong', src/porcelain/main.rs:41:42 +thread 'main' panicked at 'something went very wrong', src/porcelain/main.rs:43:42 note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace \ No newline at end of file diff --git a/tests/snapshots/panic-behaviour/expected-failure-in-thread b/tests/snapshots/panic-behaviour/expected-failure-in-thread index b99a2650670..3c81842d3fe 100644 --- a/tests/snapshots/panic-behaviour/expected-failure-in-thread +++ b/tests/snapshots/panic-behaviour/expected-failure-in-thread @@ -1,3 +1,3 @@ -thread 'main' panicked at 'something went very wrong', src/porcelain/main.rs:41:42 +thread 'main' panicked at 'something went very wrong', src/porcelain/main.rs:43:42 note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace  \ No newline at end of file diff --git a/tests/snapshots/panic-behaviour/expected-failure-in-thread-with-progress b/tests/snapshots/panic-behaviour/expected-failure-in-thread-with-progress index c892c1ea47d..c1649532e46 100644 --- a/tests/snapshots/panic-behaviour/expected-failure-in-thread-with-progress +++ b/tests/snapshots/panic-behaviour/expected-failure-in-thread-with-progress @@ -1,3 +1,3 @@ -[?1049h[?25lthread '' panicked at 'something went very wrong', src/porcelain/main.rs:41:42 +[?1049h[?25lthread '' panicked at 'something went very wrong', src/porcelain/main.rs:43:42 note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace [?25h[?1049l \ No newline at end of file