From c1669f346bccb837b5f101de8d9ad09cf5d7643b Mon Sep 17 00:00:00 2001 From: Sebastian Thiel Date: Mon, 25 Sep 2023 21:14:46 +0200 Subject: [PATCH] Migrate from `git2` to `gix` (#531) * replace `git2` with `gix` * upgrade tame-index to unify `gix` versions --------- Co-authored-by: Predrag Gruevski <2348618+obi1kenobi@users.noreply.github.com> --- Cargo.lock | 613 +++++++++++++-------------------------------- Cargo.toml | 7 +- src/rustdoc_gen.rs | 87 ++++--- 3 files changed, 218 insertions(+), 489 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 1b019f70..9f227173 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -17,18 +17,6 @@ version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" -[[package]] -name = "ahash" -version = "0.8.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2c99f64d1e06488f620f932677e24bc6e2897582980441ae90a671415bd7ec2f" -dependencies = [ - "cfg-if", - "getrandom", - "once_cell", - "version_check", -] - [[package]] name = "aho-corasick" version = "1.0.5" @@ -158,17 +146,6 @@ dependencies = [ "serde_json", ] -[[package]] -name = "async-trait" -version = "0.1.73" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bc00ceb34980c03614e35a3a4e218276a0a824e911d07651cd0d858a51e8c0f0" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.31", -] - [[package]] name = "atty" version = "0.2.14" @@ -320,7 +297,7 @@ dependencies = [ "clap-cargo", "clap-verbosity-flag", "directories", - "git2", + "gix", "handlebars", "human-panic", "ignore", @@ -386,7 +363,6 @@ version = "1.0.83" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f1174fb0b6ec23863f8b971027804a42614e347eafb0a95bf0b12cdae21fc4d0" dependencies = [ - "jobserver", "libc", ] @@ -465,6 +441,15 @@ version = "0.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b8191fa7302e03607ff0e237d4246cc043ff5b3cb9409d995172ba3bea16b807" +[[package]] +name = "cmake" +version = "0.1.50" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a31c789563b815f77f4250caee12365734369f942439b7defd71e18a48197130" +dependencies = [ + "cc", +] + [[package]] name = "colorchoice" version = "1.0.0" @@ -578,12 +563,6 @@ dependencies = [ "typenum", ] -[[package]] -name = "data-encoding" -version = "2.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c2e66c9d817f1720209181c316d28635c050fa304f9c79e47a520882661b7308" - [[package]] name = "deranged" version = "0.3.8" @@ -660,18 +639,6 @@ dependencies = [ "cfg-if", ] -[[package]] -name = "enum-as-inner" -version = "0.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c9720bba047d567ffc8a3cba48bf19126600e249ab7f128e9233e6376976a116" -dependencies = [ - "heck", - "proc-macro2", - "quote", - "syn 1.0.109", -] - [[package]] name = "equivalent" version = "1.0.1" @@ -733,6 +700,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c6c98ee8095e9d1dcbf2fcc6d95acccb90d1c81db1e44725c6a984b1dbdfb010" dependencies = [ "crc32fast", + "libz-ng-sys", "miniz_oxide", ] @@ -860,24 +828,11 @@ dependencies = [ "syn 1.0.109", ] -[[package]] -name = "git2" -version = "0.17.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7b989d6a7ca95a362cf2cfc5ad688b3a467be1f87e480b8dad07fee8c79b0044" -dependencies = [ - "bitflags 1.3.2", - "libc", - "libgit2-sys", - "log", - "url", -] - [[package]] name = "gix" -version = "0.50.1" +version = "0.53.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "275b1bfa0d6f6ed31a2e2e878a4539f4994eac8840546283ab3aebbd8fcaa42d" +checksum = "06a8c9f9452078f474fecd2880de84819b8c77224ab62273275b646bf785f906" dependencies = [ "gix-actor", "gix-attributes", @@ -896,18 +851,21 @@ dependencies = [ "gix-ignore", "gix-index", "gix-lock", - "gix-mailmap", + "gix-macros", "gix-negotiate", "gix-object", "gix-odb", "gix-pack", "gix-path", + "gix-pathspec", "gix-prompt", "gix-protocol", "gix-ref", "gix-refspec", "gix-revision", + "gix-revwalk", "gix-sec", + "gix-submodule", "gix-tempfile", "gix-trace", "gix-transport", @@ -916,10 +874,8 @@ dependencies = [ "gix-utils", "gix-validate", "gix-worktree", - "log", "once_cell", - "reqwest", - "signal-hook", + "parking_lot", "smallvec", "thiserror", "unicode-normalization", @@ -927,30 +883,30 @@ dependencies = [ [[package]] name = "gix-actor" -version = "0.24.2" +version = "0.26.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "abd2566c12095a584716f2c16f051850bd8987f57556f1fef4a7cce0300b83d0" +checksum = "8e8c6778cc03bca978b2575a03e04e5ba6f430a9dd9b0f1259f0a8a9a5e5cc66" dependencies = [ "bstr 1.6.2", "btoi", "gix-date", "itoa", - "nom", "thiserror", + "winnow", ] [[package]] name = "gix-attributes" -version = "0.16.0" +version = "0.18.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "63a134a674e39e238bd273326a9815296cc71f867ad5466518da71392cff98ce" +checksum = "d3548b76829d33a7160a4685134df16de0cc3b77418302e8a9969f0b662e698f" dependencies = [ "bstr 1.6.2", "gix-glob", "gix-path", "gix-quote", + "gix-trace", "kstring", - "log", "smallvec", "thiserror", "unicode-bom", @@ -985,9 +941,9 @@ dependencies = [ [[package]] name = "gix-commitgraph" -version = "0.18.2" +version = "0.20.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8219fe6f39588a29dbfb8d1c244b07ee653126edc5b6f3860752c3b5454fa10b" +checksum = "4676ede3a7d37e7028e2889830349a6aca22efc1d2f2dd9fa3351c1a8ddb0c6a" dependencies = [ "bstr 1.6.2", "gix-chunk", @@ -999,9 +955,9 @@ dependencies = [ [[package]] name = "gix-config" -version = "0.26.2" +version = "0.29.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2135b921a699a4c36167148193bea23c653a16ef0686f6a280e383469709a773" +checksum = "1108c4ac88248dd25cc8ab0d0dae796e619fb72d92f88e30e00b29d61bb93cc4" dependencies = [ "bstr 1.6.2", "gix-config-value", @@ -1010,7 +966,6 @@ dependencies = [ "gix-path", "gix-ref", "gix-sec", - "log", "memchr", "once_cell", "smallvec", @@ -1021,9 +976,9 @@ dependencies = [ [[package]] name = "gix-config-value" -version = "0.12.5" +version = "0.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6e874f41437441c02991dcea76990b9058fadfc54b02ab4dd06ab2218af43897" +checksum = "ea7505b97f4d8e7933e29735a568ba2f86d8de466669d9f0e8321384f9972f47" dependencies = [ "bitflags 2.4.0", "bstr 1.6.2", @@ -1034,9 +989,9 @@ dependencies = [ [[package]] name = "gix-credentials" -version = "0.17.1" +version = "0.19.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "307d91ec5f7c8e9bfaa217fe30c2e0099101cbe83dbed27a222dbb6def38725f" +checksum = "363e16428096b7311c380afe972831ea8b58fc1a1d1621dbdd865caf34921a54" dependencies = [ "bstr 1.6.2", "gix-command", @@ -1050,9 +1005,9 @@ dependencies = [ [[package]] name = "gix-date" -version = "0.7.4" +version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0a825babda995d788e30d306a49dacd1e93d5f5d33d53c7682d0347cef40333c" +checksum = "fc7df669639582dc7c02737642f76890b03b5544e141caba68a7d6b4eb551e0d" dependencies = [ "bstr 1.6.2", "itoa", @@ -1062,21 +1017,20 @@ dependencies = [ [[package]] name = "gix-diff" -version = "0.33.1" +version = "0.35.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9a49d7a9a9ed5ec3428c3061da45d0fc5f50b3c07b91ea4e7ec4959668f25f6c" +checksum = "b45e342d148373bd9070d557e6fb1280aeae29a3e05e32506682d027278501eb" dependencies = [ "gix-hash", "gix-object", - "imara-diff", "thiserror", ] [[package]] name = "gix-discover" -version = "0.22.1" +version = "0.24.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "041480eb03d8aa0894d9b73d25d182d51bc4d0ea8925a6ee0c971262bbc7715e" +checksum = "da4cacda5ee9dd1b38b0e2506834e40e66c08cf050ef55c344334c76745f277b" dependencies = [ "bstr 1.6.2", "dunce", @@ -1089,9 +1043,9 @@ dependencies = [ [[package]] name = "gix-features" -version = "0.32.1" +version = "0.34.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "882695cccf38da4c3cc7ee687bdb412cf25e37932d7f8f2c306112ea712449f1" +checksum = "f414c99e1a7abc69b21f3225a6539d203b0513f1d1d448607c4ea81cdcf9ee59" dependencies = [ "bytes", "crc32fast", @@ -1104,6 +1058,7 @@ dependencies = [ "once_cell", "parking_lot", "prodash", + "sha1", "sha1_smol", "thiserror", "walkdir", @@ -1111,9 +1066,9 @@ dependencies = [ [[package]] name = "gix-filter" -version = "0.2.0" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ef4d4d61f2ab07de4612f8e078d7f1a443c7ab5c40f382784c8eacdf0fd172b9" +checksum = "afbdb2ffae9e595d70f8c7b40953a82706d536bb8107874c258fe6368389832b" dependencies = [ "bstr 1.6.2", "encoding_rs", @@ -1131,18 +1086,18 @@ dependencies = [ [[package]] name = "gix-fs" -version = "0.4.1" +version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4d5b6e9d34a2c61ea4a02bbca94c409ab6dbbca1348cbb67298cd7fed8758761" +checksum = "404795da3d4c660c9ab6c3b2ad76d459636d1e1e4b37b0c7ff68eee898c298d4" dependencies = [ "gix-features", ] [[package]] name = "gix-glob" -version = "0.10.2" +version = "0.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b7255c717f49a556fa5029f6d9f2b3c008b4dd016c87f23c2ab8ca9636d5fade" +checksum = "e3ac79c444193b0660fe0c0925d338bd338bd643e32138784dccfb12c628b892" dependencies = [ "bitflags 2.4.0", "bstr 1.6.2", @@ -1152,19 +1107,19 @@ dependencies = [ [[package]] name = "gix-hash" -version = "0.11.4" +version = "0.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4b422ff2ad9a0628baaad6da468cf05385bf3f5ab495ad5a33cce99b9f41092f" +checksum = "2ccf425543779cddaa4a7c62aba3fa9d90ea135b160be0a72dd93c063121ad4a" dependencies = [ - "hex", + "faster-hex", "thiserror", ] [[package]] name = "gix-hashtable" -version = "0.2.4" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "385f4ce6ecf3692d313ca3aa9bd3b3d8490de53368d6d94bedff3af8b6d9c58d" +checksum = "409268480841ad008e81c17ca5a293393fbf9f2b6c2f85b8ab9de1f0c5176a16" dependencies = [ "gix-hash", "hashbrown 0.14.0", @@ -1173,9 +1128,9 @@ dependencies = [ [[package]] name = "gix-ignore" -version = "0.5.1" +version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a88b95ceb3bc45abcab6eb55ef4e0053e58b4df0712d3f9aec7d0ca990952603" +checksum = "04ff3ec0fd9fb5bb0ae36b252976b0bc94b45ba969b1639f7402425d9d6baf67" dependencies = [ "bstr 1.6.2", "gix-glob", @@ -1185,9 +1140,9 @@ dependencies = [ [[package]] name = "gix-index" -version = "0.21.1" +version = "0.24.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "732f61ec71576bd443a3c24f4716dc7eac180d8929e7bb8603c7310161507106" +checksum = "0e9599fc30b3d6aad231687a403f85dfa36ae37ccf1b68ee1f621ad5b7fc7a0d" dependencies = [ "bitflags 2.4.0", "bstr 1.6.2", @@ -1208,9 +1163,9 @@ dependencies = [ [[package]] name = "gix-lock" -version = "7.0.2" +version = "9.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7e82ec23c8a281f91044bf3ed126063b91b59f9c9340bf0ae746f385cc85a6fa" +checksum = "1568c3d90594c60d52670f325f5db88c2d572e85c8dd45fabc23d91cadb0fd52" dependencies = [ "gix-tempfile", "gix-utils", @@ -1218,22 +1173,21 @@ dependencies = [ ] [[package]] -name = "gix-mailmap" -version = "0.16.1" +name = "gix-macros" +version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7fc0dbbf35d29639770af68d7ff55924d83786c8924b0e6a1766af1a98b7d58b" +checksum = "9d8acb5ee668d55f0f2d19a320a3f9ef67a6999ad483e11135abcc2464ed18b6" dependencies = [ - "bstr 1.6.2", - "gix-actor", - "gix-date", - "thiserror", + "proc-macro2", + "quote", + "syn 2.0.31", ] [[package]] name = "gix-negotiate" -version = "0.5.1" +version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ce0061b7ae867e830c77b1ecfc5875f0d042aebb3d7e6014d04fd86ca6c71d59" +checksum = "208b25af0e59d04e7313479fc949bd68e11a065b51718995139cefac498e24df" dependencies = [ "bitflags 2.4.0", "gix-commitgraph", @@ -1247,9 +1201,9 @@ dependencies = [ [[package]] name = "gix-object" -version = "0.33.2" +version = "0.36.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bfdd87520c71a19afecfa616863a4b761621074878f5a3999243b3e37e233943" +checksum = "3e5528d5b2c984044d547e696e44a8c45fa122e83cd8c2ac1da69bd474336be8" dependencies = [ "bstr 1.6.2", "btoi", @@ -1258,18 +1212,17 @@ dependencies = [ "gix-features", "gix-hash", "gix-validate", - "hex", "itoa", - "nom", "smallvec", "thiserror", + "winnow", ] [[package]] name = "gix-odb" -version = "0.50.2" +version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e827dbda6d3dabadb94cd437d0e0fe8c314a60d136a3235fc6f5bf7b96b976ac" +checksum = "d0446eca295459deb3d6dd6ed7d44a631479f1b7381d8087166605c7a9f717c6" dependencies = [ "arc-swap", "gix-date", @@ -1286,20 +1239,18 @@ dependencies = [ [[package]] name = "gix-pack" -version = "0.40.2" +version = "0.42.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "46f029a4dce9ac91da35c968c3abdcae573b3e52c123be86cbab3011599de533" +checksum = "be19ee650300d7cbac5829b637685ec44a8d921a7c2eaff8a245d8f2f008870c" dependencies = [ "clru", "gix-chunk", - "gix-diff", "gix-features", "gix-hash", "gix-hashtable", "gix-object", "gix-path", "gix-tempfile", - "gix-traverse", "memmap2", "parking_lot", "smallvec", @@ -1309,9 +1260,9 @@ dependencies = [ [[package]] name = "gix-packetline" -version = "0.16.5" +version = "0.16.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2a374cb5eba089e3c123df4d996eb00da411bb90ec92cb35bffeeb2d22ee106a" +checksum = "d6df0b75361353e7c0a6d72d49617a37379a7a22cba4569ae33a7720a4c8755a" dependencies = [ "bstr 1.6.2", "faster-hex", @@ -1320,9 +1271,9 @@ dependencies = [ [[package]] name = "gix-packetline-blocking" -version = "0.16.5" +version = "0.16.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e39142400d3faa7057680ed3947c3b70e46b6a0b16a7c242ec8f0249e37518ba" +checksum = "7d8395f7501c84d6a1fe902035fdfd8cd86d89e2dd6be0200ec1a72fd3c92d39" dependencies = [ "bstr 1.6.2", "faster-hex", @@ -1331,9 +1282,9 @@ dependencies = [ [[package]] name = "gix-path" -version = "0.8.4" +version = "0.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "18609c8cbec8508ea97c64938c33cd305b75dfc04a78d0c3b78b8b3fd618a77c" +checksum = "6a1d370115171e3ae03c5c6d4f7d096f2981a40ddccb98dfd704c773530ba73b" dependencies = [ "bstr 1.6.2", "gix-trace", @@ -1342,11 +1293,26 @@ dependencies = [ "thiserror", ] +[[package]] +name = "gix-pathspec" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "90a7885b4ccdc8c80740e465747bf961a8110043fdc1fda3ee80bc81885f42df" +dependencies = [ + "bitflags 2.4.0", + "bstr 1.6.2", + "gix-attributes", + "gix-config-value", + "gix-glob", + "gix-path", + "thiserror", +] + [[package]] name = "gix-prompt" -version = "0.5.5" +version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2c22decaf4a063ccae2b2108820c8630c01bd6756656df3fe464b32b8958a5ea" +checksum = "5c9a913769516f5e9d937afac206fb76428e3d7238e538845842887fda584678" dependencies = [ "gix-command", "gix-config-value", @@ -1357,9 +1323,9 @@ dependencies = [ [[package]] name = "gix-protocol" -version = "0.36.1" +version = "0.39.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f8cf8b48ad5510a6ea3c8b529f51fd0f31009a2e46579f3a0ed917669035170" +checksum = "5d6ee7fc3f80140ea0651d483ecb9e680403be244849c16237fce45ac80163df" dependencies = [ "bstr 1.6.2", "btoi", @@ -1369,8 +1335,8 @@ dependencies = [ "gix-hash", "gix-transport", "maybe-async", - "nom", "thiserror", + "winnow", ] [[package]] @@ -1386,9 +1352,9 @@ dependencies = [ [[package]] name = "gix-ref" -version = "0.33.3" +version = "0.36.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "25db11edd78bf33043d1969fff51c567a4b30edd77ab44f6f8eb460a4c14985d" +checksum = "3cccbfa8d5cd9b86465f27a521e0c017de54b92d9fd37c143e49c658a2f04f3a" dependencies = [ "gix-actor", "gix-date", @@ -1401,15 +1367,15 @@ dependencies = [ "gix-tempfile", "gix-validate", "memmap2", - "nom", "thiserror", + "winnow", ] [[package]] name = "gix-refspec" -version = "0.14.1" +version = "0.17.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d19a02bf740b326d6c082a7d6f754ebe56eef900986c5e91be7cf000df9ea18d" +checksum = "678ba30d95baa5462df9875628ed40655d5f5b8aba7028de86ed57f36e762c6c" dependencies = [ "bstr 1.6.2", "gix-hash", @@ -1421,9 +1387,9 @@ dependencies = [ [[package]] name = "gix-revision" -version = "0.18.1" +version = "0.21.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38a13500890435e3b9e7746bceda248646bfc69e259210884c98e29bb7a1aa6f" +checksum = "b3e80a5992ae446fe1745dd26523b86084e3f1b6b3e35377fe09b4f35ac8f151" dependencies = [ "bstr 1.6.2", "gix-date", @@ -1431,14 +1397,15 @@ dependencies = [ "gix-hashtable", "gix-object", "gix-revwalk", + "gix-trace", "thiserror", ] [[package]] name = "gix-revwalk" -version = "0.4.1" +version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "71d4cbaf3cfbfde2b81b5ee8b469aff42c34693ce0fe17fc3c244d5085307f2c" +checksum = "b806349bc1f668e09035800e07ac8045da4e39a8925a245d93142c4802224ec1" dependencies = [ "gix-commitgraph", "gix-date", @@ -1451,9 +1418,9 @@ dependencies = [ [[package]] name = "gix-sec" -version = "0.8.4" +version = "0.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9615cbd6b456898aeb942cd75e5810c382fbfc48dbbff2fa23ebd2d33dcbe9c7" +checksum = "92b9542ac025a8c02ed5d17b3fc031a111a384e859d0be3532ec4d58c40a0f28" dependencies = [ "bitflags 2.4.0", "gix-path", @@ -1461,18 +1428,31 @@ dependencies = [ "windows", ] +[[package]] +name = "gix-submodule" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5ff6b99d735842a3a7fb162b660fa97acec39d576c0ca1700d9eff9344f8625d" +dependencies = [ + "bstr 1.6.2", + "gix-config", + "gix-path", + "gix-pathspec", + "gix-refspec", + "gix-url", + "thiserror", +] + [[package]] name = "gix-tempfile" -version = "7.0.2" +version = "9.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fa28d567848cec8fdd77d36ad4f5f78ecfaba7d78f647d4f63c8ae1a2cec7243" +checksum = "2762b91ff95e27ff3ea95758c0d4efacd7435a1be3629622928b8276de0f72a8" dependencies = [ "gix-fs", "libc", "once_cell", "parking_lot", - "signal-hook", - "signal-hook-registry", "tempfile", ] @@ -1484,9 +1464,9 @@ checksum = "96b6d623a1152c3facb79067d6e2ecdae48130030cf27d6eb21109f13bd7b836" [[package]] name = "gix-transport" -version = "0.34.2" +version = "0.36.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "640cf03acc506e0350bc434dd6d7093d91343ed508d2c2166a41da856ab6e5e3" +checksum = "95892eedefd65a6b4312aa5e166d2f740558adfb6854a2b7de73e82e54ef064c" dependencies = [ "base64", "bstr 1.6.2", @@ -1503,9 +1483,9 @@ dependencies = [ [[package]] name = "gix-traverse" -version = "0.30.1" +version = "0.32.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e12e0fe428394226c37dd686ad64b09a04b569fe157d638b125b4a4c1e7e2df0" +checksum = "3ec6358f8373fb018af8fc96c9d2ec6a5b66999e2377dc40b7801351fec409ed" dependencies = [ "gix-commitgraph", "gix-date", @@ -1519,9 +1499,9 @@ dependencies = [ [[package]] name = "gix-url" -version = "0.21.1" +version = "0.23.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4411bdbd1d46b35ae50e84c191660d437f89974e4236627785024be0b577170a" +checksum = "1c79d595b99a6c7ab274f3c991735a0c0f5a816a3da460f513c48edf1c7bf2cc" dependencies = [ "bstr 1.6.2", "gix-features", @@ -1542,9 +1522,9 @@ dependencies = [ [[package]] name = "gix-validate" -version = "0.7.7" +version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba9b3737b2cef3dcd014633485f0034b0f1a931ee54aeb7d8f87f177f3c89040" +checksum = "e05cab2b03a45b866156e052aa38619f4ece4adcb2f79978bfc249bc3b21b8c5" dependencies = [ "bstr 1.6.2", "thiserror", @@ -1552,15 +1532,13 @@ dependencies = [ [[package]] name = "gix-worktree" -version = "0.23.1" +version = "0.25.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9f8bb6dd57dc6c9dfa03cc2cf2cc0942edae405eb6dfd1c34dbd2be00a90cab2" +checksum = "addabd470ca4ce3ab893e32a5743971a530b8fc0eee5c23844849abf3c9ea6d6" dependencies = [ "bstr 1.6.2", - "filetime", "gix-attributes", "gix-features", - "gix-filter", "gix-fs", "gix-glob", "gix-hash", @@ -1568,8 +1546,6 @@ dependencies = [ "gix-index", "gix-object", "gix-path", - "io-close", - "thiserror", ] [[package]] @@ -1651,12 +1627,6 @@ version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "443144c8cdadd93ebf52ddb4056d257f5b52c04d3c804e657d19eb73fc33668b" -[[package]] -name = "hex" -version = "0.4.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" - [[package]] name = "home" version = "0.5.5" @@ -1666,17 +1636,6 @@ dependencies = [ "windows-sys 0.48.0", ] -[[package]] -name = "hostname" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c731c3e10504cc8ed35cfe2f1db4c9274c3d35fa486e3b31df46f068ef3e867" -dependencies = [ - "libc", - "match_cfg", - "winapi", -] - [[package]] name = "http" version = "0.2.9" @@ -1765,17 +1724,6 @@ dependencies = [ "tokio-rustls", ] -[[package]] -name = "idna" -version = "0.2.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "418a0a6fab821475f634efe3ccc45c013f742efe03d853e8d3355d5cb850ecf8" -dependencies = [ - "matches", - "unicode-bidi", - "unicode-normalization", -] - [[package]] name = "idna" version = "0.4.0" @@ -1803,16 +1751,6 @@ dependencies = [ "winapi-util", ] -[[package]] -name = "imara-diff" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e98c1d0ad70fc91b8b9654b1f33db55e59579d3b3de2bffdced0fdb810570cb8" -dependencies = [ - "ahash", - "hashbrown 0.12.3", -] - [[package]] name = "indexmap" version = "1.9.3" @@ -1834,28 +1772,6 @@ dependencies = [ "hashbrown 0.14.0", ] -[[package]] -name = "io-close" -version = "0.3.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9cadcf447f06744f8ce713d2d6239bb5bde2c357a452397a9ed90c625da390bc" -dependencies = [ - "libc", - "winapi", -] - -[[package]] -name = "ipconfig" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b58db92f96b720de98181bbbe63c831e87005ab460c1bf306eb2622b4707997f" -dependencies = [ - "socket2 0.5.3", - "widestring", - "windows-sys 0.48.0", - "winreg", -] - [[package]] name = "ipnet" version = "2.8.0" @@ -1897,15 +1813,6 @@ version = "1.0.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "af150ab688ff2122fcef229be89cb50dd66af9e01a4ff320cc137eecc9bacc38" -[[package]] -name = "jobserver" -version = "0.1.26" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "936cfd212a0155903bcbc060e316fb6cc7cbf2e1907329391ebadc1fe0ce77c2" -dependencies = [ - "libc", -] - [[package]] name = "js-sys" version = "0.3.64" @@ -1947,35 +1854,15 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b4668fb0ea861c1df094127ac5f1da3409a82116a4ba74fca2e58ef927159bb3" [[package]] -name = "libgit2-sys" -version = "0.15.2+1.6.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a80df2e11fb4a61f4ba2ab42dbe7f74468da143f1a75c74e11dee7c813f694fa" -dependencies = [ - "cc", - "libc", - "libz-sys", - "pkg-config", -] - -[[package]] -name = "libz-sys" +name = "libz-ng-sys" version = "1.1.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d97137b25e321a73eef1418d1d5d2eda4d77e12813f8e6dead84bc52c5870a7b" +checksum = "3dd9f43e75536a46ee0f92b758f6b63846e594e86638c61a9251338a65baea63" dependencies = [ - "cc", + "cmake", "libc", - "pkg-config", - "vcpkg", ] -[[package]] -name = "linked-hash-map" -version = "0.5.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0717cef1bc8b636c6e1c1bbdefc09e6322da8a9321966e8928ef80d20f7f770f" - [[package]] name = "linux-raw-sys" version = "0.4.5" @@ -1998,33 +1885,12 @@ version = "0.4.20" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b5e6163cb8c49088c2c36f57875e58ccd8c87c7427f7fbd50ea6710b2f3f2e8f" -[[package]] -name = "lru-cache" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "31e24f1ad8321ca0e8a1e0ac13f23cb668e6f5466c2c57319f6a5cf1cc8e3b1c" -dependencies = [ - "linked-hash-map", -] - [[package]] name = "maplit" version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3e2e65a1a2e43cfcb47a895c4c8b10d1f4a61097f9f254f183aee60cad9c651d" -[[package]] -name = "match_cfg" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ffbee8634e0d45d258acb448e7eaab3fce7a0a467395d4d9f228e3c1f01fb2e4" - -[[package]] -name = "matches" -version = "0.1.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2532096657941c2fea9c289d370a250971c689d4f143798ff67113ec042024a5" - [[package]] name = "maybe-async" version = "0.2.7" @@ -2066,12 +1932,6 @@ version = "0.3.17" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6877bb514081ee2a7ff5ef9de3281f14a4dd4bceac4c09388074a6b5df8a139a" -[[package]] -name = "minimal-lexical" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" - [[package]] name = "miniz_oxide" version = "0.7.1" @@ -2092,16 +1952,6 @@ dependencies = [ "windows-sys 0.48.0", ] -[[package]] -name = "nom" -version = "7.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d273983c5a657a70a3e8f2a01329822f3b8c8172b73826411a55751e404a0a4a" -dependencies = [ - "memchr", - "minimal-lexical", -] - [[package]] name = "num-traits" version = "0.2.16" @@ -2248,18 +2098,6 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" -[[package]] -name = "pkg-config" -version = "0.3.27" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26072860ba924cbfa98ea39c8c19b4dd6a4a25423dbdf219c1eca91aa0cf6964" - -[[package]] -name = "ppv-lite86" -version = "0.2.17" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de" - [[package]] name = "predicates" version = "3.0.3" @@ -2305,15 +2143,9 @@ dependencies = [ [[package]] name = "prodash" -version = "25.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1d67eb4220992a4a052a4bb03cf776e493ecb1a3a36bab551804153d63486af7" - -[[package]] -name = "quick-error" -version = "1.2.3" +version = "26.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1d01941d82fa2ab50be1e79e6714289dd7cde78eba4c074bc5a4374f650dfe0" +checksum = "50bcc40e3e88402f12b15f94d43a2c7673365e9601cc52795e119b95a266100c" [[package]] name = "quote" @@ -2324,36 +2156,6 @@ dependencies = [ "proc-macro2", ] -[[package]] -name = "rand" -version = "0.8.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" -dependencies = [ - "libc", - "rand_chacha", - "rand_core", -] - -[[package]] -name = "rand_chacha" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" -dependencies = [ - "ppv-lite86", - "rand_core", -] - -[[package]] -name = "rand_core" -version = "0.6.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" -dependencies = [ - "getrandom", -] - [[package]] name = "rayon" version = "1.7.0" @@ -2473,7 +2275,6 @@ dependencies = [ "tokio-rustls", "tokio-util", "tower-service", - "trust-dns-resolver", "url", "wasm-bindgen", "wasm-bindgen-futures", @@ -2482,16 +2283,6 @@ dependencies = [ "winreg", ] -[[package]] -name = "resolv-conf" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "52e44394d2086d010551b14b53b1f24e31647570cd1deb0379e2c21b329aba00" -dependencies = [ - "hostname", - "quick-error", -] - [[package]] name = "ring" version = "0.16.20" @@ -2706,6 +2497,27 @@ dependencies = [ "serde", ] +[[package]] +name = "sha1" +version = "0.10.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f04293dc80c3993519f2d7f6f511707ee7094fe0c6d3406feb330cdb3540eba3" +dependencies = [ + "cfg-if", + "cpufeatures", + "digest", + "sha1-asm", +] + +[[package]] +name = "sha1-asm" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2ba6947745e7f86be3b8af00b7355857085dbdf8901393c89514510eb61f4e21" +dependencies = [ + "cc", +] + [[package]] name = "sha1_smol" version = "1.0.0" @@ -2729,25 +2541,6 @@ version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "45bb67a18fa91266cc7807181f62f9178a6873bfad7dc788c42e6430db40184f" -[[package]] -name = "signal-hook" -version = "0.3.17" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8621587d4798caf8eb44879d42e56b9a93ea5dcd315a6487c357130095b62801" -dependencies = [ - "libc", - "signal-hook-registry", -] - -[[package]] -name = "signal-hook-registry" -version = "1.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d8229b473baa5980ac72ef434c4415e70c4b5e71b423043adb4ba059f89c99a1" -dependencies = [ - "libc", -] - [[package]] name = "similar" version = "2.2.1" @@ -2868,21 +2661,24 @@ dependencies = [ [[package]] name = "tame-index" -version = "0.2.5" +version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "93b8105f79989496b426b812cdbe61633dcb83f2b0b88b410949dc8b4d3f1c27" +checksum = "e6b3fea0e225ef36939de3613334dbbc02da041c1830e4a84260b0137b3bc0c7" dependencies = [ "camino", + "crossbeam-channel", "gix", "home", "http", "memchr", + "rayon", "reqwest", "semver", "serde", "serde_json", "smol_str", "thiserror", + "tokio", "toml", "twox-hash", ] @@ -3094,21 +2890,9 @@ checksum = "8ce8c33a8d48bd45d624a6e523445fd21ec13d3653cd51f681abf67418f54eb8" dependencies = [ "cfg-if", "pin-project-lite", - "tracing-attributes", "tracing-core", ] -[[package]] -name = "tracing-attributes" -version = "0.1.26" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f4f31f56159e98206da9efd823404b79b6ef3143b4a7ab76e67b1751b25a4ab" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.31", -] - [[package]] name = "tracing-core" version = "0.1.31" @@ -3118,51 +2902,6 @@ dependencies = [ "once_cell", ] -[[package]] -name = "trust-dns-proto" -version = "0.22.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4f7f83d1e4a0e4358ac54c5c3681e5d7da5efc5a7a632c90bb6d6669ddd9bc26" -dependencies = [ - "async-trait", - "cfg-if", - "data-encoding", - "enum-as-inner", - "futures-channel", - "futures-io", - "futures-util", - "idna 0.2.3", - "ipnet", - "lazy_static", - "rand", - "smallvec", - "thiserror", - "tinyvec", - "tokio", - "tracing", - "url", -] - -[[package]] -name = "trust-dns-resolver" -version = "0.22.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aff21aa4dcefb0a1afbfac26deb0adc93888c7d295fb63ab273ef276ba2b7cfe" -dependencies = [ - "cfg-if", - "futures-util", - "ipconfig", - "lazy_static", - "lru-cache", - "parking_lot", - "resolv-conf", - "smallvec", - "thiserror", - "tokio", - "tracing", - "trust-dns-proto", -] - [[package]] name = "trustfall" version = "0.6.1" @@ -3342,7 +3081,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "143b538f18257fac9cad154828a57c6bf5157e1aa604d4816b5995bf6de87ae5" dependencies = [ "form_urlencoded", - "idna 0.4.0", + "idna", "percent-encoding", ] @@ -3361,12 +3100,6 @@ dependencies = [ "getrandom", ] -[[package]] -name = "vcpkg" -version = "0.2.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426" - [[package]] name = "version_check" version = "0.9.4" @@ -3489,12 +3222,6 @@ version = "0.25.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "14247bb57be4f377dfb94c72830b8ce8fc6beac03cf4bf7b9732eadd414123fc" -[[package]] -name = "widestring" -version = "1.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "653f141f39ec16bba3c5abe400a0c60da7468261cc2cbf36805022876bc721a8" - [[package]] name = "winapi" version = "0.3.9" diff --git a/Cargo.toml b/Cargo.toml index c9cd80df..5cdec7b7 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -30,8 +30,11 @@ clap-cargo = { version = "0.10.0", features = ["cargo_metadata"] } ignore = "0.4.18" clap-verbosity-flag = "2.0.0" log = "0.4.17" -git2 = { version = "0.17.0", default-features = false } -tame-index = { version = "0.2", features = ["git", "sparse"] } +# Note that `tame-index` and `gix` must be upgraded in lock-step to retain the same `gix` +# minor version. Otherwise, one will compile `gix` two times in different minor versions. +gix = { version = "0.53.1", default-features = false, features = ["max-performance", "revision"] } +tame-index = { version = "0.6.0", features = ["git", "sparse"] } + human-panic = "1.0.3" bugreport = "0.5.0" itertools = "0.11.0" diff --git a/src/rustdoc_gen.rs b/src/rustdoc_gen.rs index e583a527..d4318239 100644 --- a/src/rustdoc_gen.rs +++ b/src/rustdoc_gen.rs @@ -1,6 +1,6 @@ use std::path::PathBuf; -use anyhow::Context as _; +use anyhow::{bail, Context as _}; use itertools::Itertools; use serde::Serialize; use sha2::{Digest, Sha256}; @@ -515,45 +515,38 @@ impl RustdocFromGitRevision { config: &mut GlobalConfig, ) -> anyhow::Result { config.shell_status("Cloning", rev)?; - let repo = git2::Repository::discover(source)?; + let repo = gix::discover(source)?; - let rev = repo.revparse_single(rev)?; - let rev_dir = target.join(rev.id().to_string()); + let tree_id = repo.rev_parse_single(&*format!("{rev}^{{tree}}"))?; + let tree_dir = target.join(tree_id.to_string()); - std::fs::create_dir_all(&rev_dir)?; - let tree = rev.peel_to_tree()?; - extract_tree(&repo, tree, &rev_dir)?; + std::fs::create_dir_all(&tree_dir)?; + extract_tree(tree_id, &tree_dir)?; - let path = RustdocFromProjectRoot::new(&rev_dir, target)?; + let path = RustdocFromProjectRoot::new(&tree_dir, target)?; Ok(Self { path }) } } -fn extract_tree( - repo: &git2::Repository, - tree: git2::Tree<'_>, - target: &std::path::Path, -) -> anyhow::Result<()> { - for entry in tree.iter() { - match entry.kind() { - Some(git2::ObjectType::Tree) => { - let object = entry.to_object(repo); - let tree = object.and_then(|o| o.peel_to_tree()); - if let Ok(tree) = tree { - let path = target.join(bytes2str(entry.name_bytes())); - std::fs::create_dir_all(&path)?; - extract_tree(repo, tree, &path)?; - } +fn extract_tree(tree: gix::Id<'_>, target: &std::path::Path) -> anyhow::Result<()> { + for entry in tree.object()?.try_into_tree()?.iter() { + let entry = entry?; + match entry.mode() { + gix::object::tree::EntryMode::Tree => { + let path = target.join(bytes2str(entry.filename())); + std::fs::create_dir_all(&path)?; + extract_tree(entry.id(), &path)?; } - Some(git2::ObjectType::Blob) => { - let object = entry.to_object(repo); - let blob = object.and_then(|o| o.peel_to_blob()); - if let Ok(blob) = blob { - let path = target.join(bytes2str(entry.name_bytes())); - let existing = std::fs::read(&path).ok(); - if existing.as_deref() != Some(blob.content()) { - std::fs::write(&path, blob.content())?; - } + gix::object::tree::EntryMode::Blob | gix::object::tree::EntryMode::BlobExecutable => { + let blob = entry.object()?; + assert!( + blob.kind.is_blob(), + "we are not working on a corrupted repository" + ); + let path = target.join(bytes2str(entry.filename())); + let existing = std::fs::read(&path).ok(); + if existing.as_deref() != Some(&blob.data) { + std::fs::write(&path, &blob.data)?; } } _ => {} @@ -655,6 +648,7 @@ impl RustdocFromRegistry { .context("failed to build HTTP client")?; index::RemoteSparseIndex::new(sparse, client).into() } + _ => bail!("encountered unknown cache type"), }; Ok(Self { @@ -683,6 +677,7 @@ fn choose_baseline_version( .map(|iv| (iv.version.clone(), iv.is_yanked())) // For unpublished changes when the user doesn't increment the version // post-release, allow using the current version as a baseline. + .filter_map(|(v, yanked)| semver::Version::parse(v.as_str()).ok().map(|v| (v, yanked))) .filter(|(v, _)| v <= current) .collect::>(); instances.sort(); @@ -700,16 +695,18 @@ fn choose_baseline_version( ) }) } else { - let instance = crate_ - .highest_normal_version() - .unwrap_or_else(|| { - // If there is no normal version (not yanked and not a pre-release) - // choosing the latest one anyway is more reasonable than throwing an - // error, as there is still a chance that it is what the user expects. - crate_.highest_version() - }) - .version - .clone(); + let instance = semver::Version::parse( + crate_ + .highest_normal_version() + .unwrap_or_else(|| { + // If there is no normal version (not yanked and not a pre-release) + // choosing the latest one anyway is more reasonable than throwing an + // error, as there is still a chance that it is what the user expects. + crate_.highest_version() + }) + .version + .as_str(), + )?; Ok(instance) } } @@ -751,7 +748,9 @@ impl RustdocGenerator for RustdocFromRegistry { let crate_ = crate_ .versions .iter() - .find(|v| v.version == base_version) + .find(|v| { + semver::Version::parse(v.version.as_str()).ok().as_ref() == Some(&base_version) + }) .with_context(|| { anyhow::format_err!( "Version {} of crate {} not found in registry", @@ -797,7 +796,7 @@ mod tests { use super::choose_baseline_version; fn new_mock_version(version: semver::Version, yanked: bool) -> IndexVersion { - let mut iv = IndexVersion::fake("test-crate", version); + let mut iv = IndexVersion::fake("test-crate", version.to_string()); iv.yanked = yanked; iv }