diff --git a/BUCK b/BUCK index c8c4f84a..c3a372c6 100644 --- a/BUCK +++ b/BUCK @@ -30,7 +30,6 @@ rust_library( "//third-party/rust/crates/ahash/0.8.12:ahash", "//third-party/rust/crates/async-trait/0.1.89:async-trait", "//third-party/rust/crates/axum/0.8.8:axum", - "//third-party/rust/crates/bincode/2.0.1:bincode", "//third-party/rust/crates/bstr/1.12.1:bstr", "//third-party/rust/crates/byteorder/1.5.0:byteorder", "//third-party/rust/crates/bytes/1.11.1:bytes", @@ -52,6 +51,7 @@ rust_library( "//third-party/rust/crates/path-absolutize/3.1.1:path-absolutize", "//third-party/rust/crates/rayon/1.11.0:rayon", "//third-party/rust/crates/ring/0.17.14:ring", + "//third-party/rust/crates/rkyv/0.8.15:rkyv", "//third-party/rust/crates/sea-orm/1.1.19:sea-orm", "//third-party/rust/crates/serde/1.0.228:serde", "//third-party/rust/crates/serde_json/1.0.149:serde_json", diff --git a/Cargo.lock b/Cargo.lock index 82712822..abb3b7b0 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -218,26 +218,6 @@ dependencies = [ "serde", ] -[[package]] -name = "bincode" -version = "2.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "36eaf5d7b090263e8150820482d5d93cd964a81e4019913c972f4edcc6edb740" -dependencies = [ - "bincode_derive", - "serde", - "unty", -] - -[[package]] -name = "bincode_derive" -version = "2.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bf95709a440f45e986983918d0e8a1f30a9b1df04918fc828670606804ac3c09" -dependencies = [ - "virtue", -] - [[package]] name = "bindgen" version = "0.72.1" @@ -341,8 +321,20 @@ version = "0.6.12" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "23cdc57ce23ac53c931e88a43d06d070a6fd142f2617be5855eb75efc9beb1c2" dependencies = [ - "bytecheck_derive", - "ptr_meta", + "bytecheck_derive 0.6.12", + "ptr_meta 0.1.4", + "simdutf8", +] + +[[package]] +name = "bytecheck" +version = "0.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0caa33a2c0edca0419d15ac723dff03f1956f7978329b1e3b5fdaaaed9d3ca8b" +dependencies = [ + "bytecheck_derive 0.8.2", + "ptr_meta 0.3.1", + "rancor", "simdutf8", ] @@ -357,6 +349,17 @@ dependencies = [ "syn 1.0.109", ] +[[package]] +name = "bytecheck_derive" +version = "0.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "89385e82b5d1821d2219e0b095efa2cc1f246cbf99080f3be46a1a85c0d392d9" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.111", +] + [[package]] name = "byteorder" version = "1.5.0" @@ -951,7 +954,6 @@ dependencies = [ "ahash 0.8.12", "async-trait", "axum", - "bincode", "bstr", "byteorder", "bytes", @@ -976,6 +978,7 @@ dependencies = [ "rand 0.10.0", "rayon", "ring", + "rkyv 0.8.15", "sea-orm", "serde", "serde_json", @@ -1547,6 +1550,26 @@ dependencies = [ "windows-sys 0.61.2", ] +[[package]] +name = "munge" +version = "0.4.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5e17401f259eba956ca16491461b6e8f72913a0a114e39736ce404410f915a0c" +dependencies = [ + "munge_macro", +] + +[[package]] +name = "munge_macro" +version = "0.4.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4568f25ccbd45ab5d5603dc34318c1ec56b117531781260002151b8530a9f931" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.111", +] + [[package]] name = "natord" version = "1.0.9" @@ -1886,7 +1909,16 @@ version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0738ccf7ea06b608c10564b31debd4f5bc5e197fc8bfe088f68ae5ce81e7a4f1" dependencies = [ - "ptr_meta_derive", + "ptr_meta_derive 0.1.4", +] + +[[package]] +name = "ptr_meta" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b9a0cf95a1196af61d4f1cbdab967179516d9a4a4312af1f31948f8f6224a79" +dependencies = [ + "ptr_meta_derive 0.3.1", ] [[package]] @@ -1900,6 +1932,17 @@ dependencies = [ "syn 1.0.109", ] +[[package]] +name = "ptr_meta_derive" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7347867d0a7e1208d93b46767be83e2b8f978c3dad35f775ac8d8847551d6fe1" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.111", +] + [[package]] name = "quickcheck" version = "1.1.0" @@ -1932,6 +1975,15 @@ version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "dc33ff2d4973d518d823d61aa239014831e521c75da58e3df4840d3f47749d09" +[[package]] +name = "rancor" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a063ea72381527c2a0561da9c80000ef822bdd7c3241b1cc1b12100e3df081ee" +dependencies = [ + "ptr_meta 0.3.1", +] + [[package]] name = "rand" version = "0.8.5" @@ -2043,7 +2095,16 @@ version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "71fe3824f5629716b1589be05dacd749f6aa084c87e00e016714a8cdfccc997c" dependencies = [ - "bytecheck", + "bytecheck 0.6.12", +] + +[[package]] +name = "rend" +version = "0.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cadadef317c2f20755a64d7fdc48f9e7178ee6b0e1f7fce33fa60f1d68a276e6" +dependencies = [ + "bytecheck 0.8.2", ] [[package]] @@ -2067,17 +2128,36 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9008cd6385b9e161d8229e1f6549dd23c3d022f132a2ea37ac3a10ac4935779b" dependencies = [ "bitvec", - "bytecheck", + "bytecheck 0.6.12", "bytes", "hashbrown 0.12.3", - "ptr_meta", - "rend", - "rkyv_derive", + "ptr_meta 0.1.4", + "rend 0.4.2", + "rkyv_derive 0.7.45", "seahash", "tinyvec", "uuid", ] +[[package]] +name = "rkyv" +version = "0.8.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1a30e631b7f4a03dee9056b8ef6982e8ba371dd5bedb74d3ec86df4499132c70" +dependencies = [ + "bytecheck 0.8.2", + "bytes", + "hashbrown 0.16.1", + "indexmap", + "munge", + "ptr_meta 0.3.1", + "rancor", + "rend 0.5.3", + "rkyv_derive 0.8.15", + "tinyvec", + "uuid", +] + [[package]] name = "rkyv_derive" version = "0.7.45" @@ -2089,6 +2169,17 @@ dependencies = [ "syn 1.0.109", ] +[[package]] +name = "rkyv_derive" +version = "0.8.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8100bb34c0a1d0f907143db3149e6b4eea3c33b9ee8b189720168e818303986f" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.111", +] + [[package]] name = "rsa" version = "0.9.10" @@ -2120,7 +2211,7 @@ dependencies = [ "bytes", "num-traits", "rand 0.8.5", - "rkyv", + "rkyv 0.7.45", "serde", "serde_json", ] @@ -3060,12 +3151,6 @@ version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8ecb6da28b8a351d773b68d5825ac39017e680750f980f3a1a85cd8dd28a47c1" -[[package]] -name = "unty" -version = "0.0.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6d49784317cd0d1ee7ec5c716dd598ec5b4483ea832a2dced265471cc0f690ae" - [[package]] name = "url" version = "2.5.7" @@ -3114,12 +3199,6 @@ version = "0.9.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0b928f33d975fc6ad9f86c8f283853ad26bdd5b10b7f1542aa2fa15e2289105a" -[[package]] -name = "virtue" -version = "0.0.18" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "051eb1abcf10076295e815102942cc58f9d5e3b4560e46e53c21e8ff6f3af7b1" - [[package]] name = "wasi" version = "0.11.1+wasi-snapshot-preview1" diff --git a/Cargo.toml b/Cargo.toml index 5cd30c60..c75be5e3 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -55,7 +55,7 @@ serde = { version = "1.0.228", features = ["derive"] } chrono = { version = "0.4.44", features = ["serde"] } uuid = { version = "1.22.0", features = ["serde", "v4", "v7"] } tokio = { version = "1.50.0", features = ["fs", "io-util"] } -bincode = { version = "2.0.1", features = ["serde"] } +rkyv = { version = "0.8.15", features = ["bytecheck"] } axum = { version = "0.8.8", features = ["macros", "json"] } [dev-dependencies] diff --git a/buckal.snap b/buckal.snap index 14abcc86..d1bc59e0 100644 --- a/buckal.snap +++ b/buckal.snap @@ -3,7 +3,7 @@ version = 2 [fingerprints] -"path+file://($WORKSPACE)#0.7.0" = "43cc83fd3f8b5f2e7ca904ae05cbc9215d8d66e741d114b25d302f71a9e3b94c" +"path+file://($WORKSPACE)#0.7.0" = "1fb44fb313a5a9a2781cd7295d057c7588363868554d5ed7387b46b0b6db76fc" "registry+https://github.com/rust-lang/crates.io-index#adler2@2.0.1" = "7081ce7693ca45bff0e855374e6b7f386805bba1de9f7c288b1c706b99abef7f" "registry+https://github.com/rust-lang/crates.io-index#ahash@0.7.8" = "263bbc26dec8ade458658cf9dae3ef8fc606e85f04c7b47abb4f9255319689ac" "registry+https://github.com/rust-lang/crates.io-index#ahash@0.8.12" = "a383722a12d8343396b1965bfe77f1cebeafb12ccc571747b2b54614e3e1a1ea" @@ -25,8 +25,6 @@ version = 2 "registry+https://github.com/rust-lang/crates.io-index#base64@0.22.1" = "515d0850a06d4dec36805d42bfd7cb6c8d287e894b16cf7ded43a3d1cdd98192" "registry+https://github.com/rust-lang/crates.io-index#base64ct@1.8.1" = "866a57dd8efb8c621bdf0d32f62488792eb50f0dcdf9374d1abc7a7a77d48182" "registry+https://github.com/rust-lang/crates.io-index#bigdecimal@0.4.9" = "f88bba28db672a65c61e84f5a91f481f570167555da21311619efea9efe3e4c5" -"registry+https://github.com/rust-lang/crates.io-index#bincode@2.0.1" = "c91b070a3a9668d0fe974d9525a85ae815338ac61d5097b5e8c6bff1f681ee76" -"registry+https://github.com/rust-lang/crates.io-index#bincode_derive@2.0.1" = "c8f177b67811abc8f1afb1461a99441f9c3d27323cffed8957d9d765368697f5" "registry+https://github.com/rust-lang/crates.io-index#bindgen@0.72.1" = "74d11d9944796413a022cf77d866b0cdd0ca26ba33c4a581c88338211f3f9504" "registry+https://github.com/rust-lang/crates.io-index#bitflags@2.10.0" = "d42a9d45fc396e87228b696c85657ce020419db6ceb6de8080b05b4b9fdc913a" "registry+https://github.com/rust-lang/crates.io-index#bitvec@1.0.1" = "dca0faeeba20245839115b4769219915d84fc18c99f9b0111faa6114bad5eec2" @@ -37,7 +35,9 @@ version = 2 "registry+https://github.com/rust-lang/crates.io-index#bstr@1.12.1" = "a8e3b544859f816c7e1f003ad685fb57a215996d6b24c6f1ed830fa43383180a" "registry+https://github.com/rust-lang/crates.io-index#bumpalo@3.19.0" = "b61fb56f898b27098f1ce33023e19e683996197a1e5dc7459a6e8105625be66b" "registry+https://github.com/rust-lang/crates.io-index#bytecheck@0.6.12" = "cc1c82108a15bfd9498f5e283fc52b0aa9ce22f82a010fe98960b5b3ee240e80" +"registry+https://github.com/rust-lang/crates.io-index#bytecheck@0.8.2" = "fa4a5bbc0e835970cfad6879ca949e96cf2603437b53c9194c4a3638a1d031b2" "registry+https://github.com/rust-lang/crates.io-index#bytecheck_derive@0.6.12" = "8b0c10e17c673205907d056bd4e31e3d89420ca4235e61c243a8892ebd295e77" +"registry+https://github.com/rust-lang/crates.io-index#bytecheck_derive@0.8.2" = "4df8e62ef9290647056eb9b39dab88a9a6c53321276e01689dadf0ef404171f4" "registry+https://github.com/rust-lang/crates.io-index#byteorder@1.5.0" = "759111df9ebe307cd1672921dd3a4f812a3a8fb2332bd830dd203ad528986268" "registry+https://github.com/rust-lang/crates.io-index#bytes@1.11.1" = "328316eb40f355e38e2f3ce3500b54390c55d1b69000bfe3a0e7483d52c0bd9c" "registry+https://github.com/rust-lang/crates.io-index#cc@1.2.49" = "a5fe9f33632d99e0bd2a6dac517ce1e8ba84b3133535819a6ec81000ed54b58b" @@ -161,6 +161,8 @@ version = 2 "registry+https://github.com/rust-lang/crates.io-index#minimal-lexical@0.2.1" = "8094ff1242ec4361f3e4a095c00361eae5975e5bffa058e8d372f8c9c0f952f7" "registry+https://github.com/rust-lang/crates.io-index#miniz_oxide@0.8.9" = "886746246ee7815375aee39029630fe4c34885a6c117fec279ac1ba3ca09d0ca" "registry+https://github.com/rust-lang/crates.io-index#mio@1.1.1" = "22bc7a128507a58764ee1b52d83f9ce7d6c080014b6a7fc6a571944ec15e6876" +"registry+https://github.com/rust-lang/crates.io-index#munge@0.4.7" = "f8c29089bd73db4a79b78cb0a74d74884e9d839fea63cfac2c9fee17e7ca0f12" +"registry+https://github.com/rust-lang/crates.io-index#munge_macro@0.4.7" = "f2acb587393837bf81b8c8c41038818b443dcc5efa3a2e6738baf11cc4a40815" "registry+https://github.com/rust-lang/crates.io-index#natord@1.0.9" = "c0227b24bcf1d15d97f25673ede276e2903ff6d31017d1be062a7a7b94599d05" "registry+https://github.com/rust-lang/crates.io-index#nom@7.1.3" = "a89f137cca41a2c803b582c5dc34193da86ceb9f2c3fdec6579cac083500bc3c" "registry+https://github.com/rust-lang/crates.io-index#nu-ansi-term@0.50.3" = "414b7230f93019dee6d24b817afcb96bf8eb0d2ea2ee4b830e5635d4bf3111bd" @@ -198,11 +200,14 @@ version = 2 "registry+https://github.com/rust-lang/crates.io-index#proc-macro2-diagnostics@0.10.1" = "87fc4d745d36a9bb32fbff2bc98f0c5431df0d53610a8219a3ce05fc1308b57d" "registry+https://github.com/rust-lang/crates.io-index#proc-macro2@1.0.103" = "9b25ba05e80fc659ff7d42f3d5606545aa8d189a21ef05aee1ad690ffa036123" "registry+https://github.com/rust-lang/crates.io-index#ptr_meta@0.1.4" = "a39cc9491aa20110894b613d62277e1d61df7a0d658e5228bd8657237cb04ad7" +"registry+https://github.com/rust-lang/crates.io-index#ptr_meta@0.3.1" = "54f0229311d4d496bf4eea9ca0d3e998e66d9250d8b48eebd03e5a93e53818fc" "registry+https://github.com/rust-lang/crates.io-index#ptr_meta_derive@0.1.4" = "9eb2472593a4173aba6a3c61291dd156933072eb2822ae7a1c9fdbae3461a1fc" +"registry+https://github.com/rust-lang/crates.io-index#ptr_meta_derive@0.3.1" = "e98c7436cd8a276511893accbf5e05d17da676604a855a8ab2c3d002998b4e3e" "registry+https://github.com/rust-lang/crates.io-index#quickcheck@1.1.0" = "fc3b0759c2206ac5c6fe56270efde7fe7e0cc8ce6c755ba8c7f5b4e476f63999" "registry+https://github.com/rust-lang/crates.io-index#quote@1.0.42" = "91c8d87ed79d624a31a96de45ffb568d706c6d680d9b059666c790d6b8df9a42" "registry+https://github.com/rust-lang/crates.io-index#r-efi@5.3.0" = "8b782f8b39e0573e49058548a27f0982ac72a7029326d2bc61b6df3c194cffaa" "registry+https://github.com/rust-lang/crates.io-index#radium@0.7.0" = "52ab1f0da4ca3712c10b6f2268313ee3f674dace171872ca510a78e825f01b90" +"registry+https://github.com/rust-lang/crates.io-index#rancor@0.1.1" = "16a163657e06c7a7fd1a9382dfa1ef0959d50274282c75ea52d0dd8c3cba4e7f" "registry+https://github.com/rust-lang/crates.io-index#rand@0.10.0" = "4c8d4b0559169936693413bb92d8eaef49a90de357ef12f1e52d148114d5c455" "registry+https://github.com/rust-lang/crates.io-index#rand@0.8.5" = "e6d182df64ee06bc76df421202bdb30272fc8dedb760388ec3f86cb753954214" "registry+https://github.com/rust-lang/crates.io-index#rand_chacha@0.3.1" = "08c84d54e52a16abda285b9ff0dc9ba53275ff0400893d18cadca9e62136117c" @@ -215,9 +220,12 @@ version = 2 "registry+https://github.com/rust-lang/crates.io-index#regex-syntax@0.8.8" = "b5bd7a8b232100b181ef43ff406fb2382e503828b02a43cd606f98d6ea0ad950" "registry+https://github.com/rust-lang/crates.io-index#regex@1.12.2" = "e640b9d3c534b375567bffc8c9cb989938f829ec848f620da291d305f375049e" "registry+https://github.com/rust-lang/crates.io-index#rend@0.4.2" = "e1477adda7718f5953efaa45ef12a2e30c0037c5723d544285f1d21d751a092b" +"registry+https://github.com/rust-lang/crates.io-index#rend@0.5.3" = "5cf67da2b5e904d5c60d95d27f069c786f48eb7d720d8326321d064f339996f1" "registry+https://github.com/rust-lang/crates.io-index#ring@0.17.14" = "32b156e24bca8e85f41473b54b727f2b5e35aac99300f6c3781fb3239ba7c549" "registry+https://github.com/rust-lang/crates.io-index#rkyv@0.7.45" = "3b6dac82b5ff286c8e17785f92161e369764979a16187de781a6e0de01db458d" +"registry+https://github.com/rust-lang/crates.io-index#rkyv@0.8.15" = "4bcb49b1540c5698e1fa3a19dacaa55b4a8d4787eb4cc5a6a1e983ff4889a74b" "registry+https://github.com/rust-lang/crates.io-index#rkyv_derive@0.7.45" = "ad51df9d2e223d73130300a8075a8eaeed101ff95d4c9ad1252498f7186db950" +"registry+https://github.com/rust-lang/crates.io-index#rkyv_derive@0.8.15" = "69fe36a095e6613c1bb25e249a1ec4b65929acff97aa1c9d4cce1d4b512c017e" "registry+https://github.com/rust-lang/crates.io-index#rsa@0.9.10" = "9e4146e51ce7cb3bfeca2da05259109f47b38350679c086df91d3c492e59a808" "registry+https://github.com/rust-lang/crates.io-index#rust_decimal@1.39.0" = "b6e5be3f346b31adf8bbe736cbe3ad02b7a47a279e61338ee89625c61bb50d4e" "registry+https://github.com/rust-lang/crates.io-index#rustc-hash@2.1.1" = "0679bb21a175710a797b96bedea9bb8d694b5c2110360190bb128ea90c196143" @@ -303,14 +311,12 @@ version = 2 "registry+https://github.com/rust-lang/crates.io-index#unicode-properties@0.1.4" = "cdf6d930a0dfc1acc3b026018d97c6bf20106eaecbdf5dceb3d7aaef1b4dbeb4" "registry+https://github.com/rust-lang/crates.io-index#unicode-xid@0.2.6" = "04c6fa64d1f26eb2c0594f87108dff265d17d747d21de7a9b240a4675ad7f2ef" "registry+https://github.com/rust-lang/crates.io-index#untrusted@0.9.0" = "0e5f903c4d858d56b064f2e47fd2b2e6d228f9404ceeef561b5cc4c0d77bec33" -"registry+https://github.com/rust-lang/crates.io-index#unty@0.0.4" = "5475cd4e774a5dff1d71ec84f3f46bbf2a1ce7ecae45e15713335645a8e14941" "registry+https://github.com/rust-lang/crates.io-index#url@2.5.7" = "41a06dd6e4a64931308619cd9143392e669fe55fff38850784e1a9a09b49bfc2" "registry+https://github.com/rust-lang/crates.io-index#utf8_iter@1.0.4" = "047f25b86fd5f1351043a8dde0aeed66f85eeca3ac56cbb7bec54ed6c023b16c" "registry+https://github.com/rust-lang/crates.io-index#uuid@1.22.0" = "9d78edb46ab75488038bd9bc89024abc587ad4c63cfb50a8451b62f933aa65f5" "registry+https://github.com/rust-lang/crates.io-index#valuable@0.1.1" = "756ad94b5effaecf9973461517320157d1ee5ab3ec28d86e1f99c4915851a45e" "registry+https://github.com/rust-lang/crates.io-index#vcpkg@0.2.15" = "719f7f17537403aaa321d268702fb5039de3e7c1993d88754cca070f8b597174" "registry+https://github.com/rust-lang/crates.io-index#version_check@0.9.5" = "5f3a662254d4a2b2e505904ada0ee24aa8376f7d08d71832a6a0f1ff04f1ad71" -"registry+https://github.com/rust-lang/crates.io-index#virtue@0.0.18" = "2d1376e442772102fce8b9b6635530fb12bdecc3fd3d2a3fef3636e442469f4a" "registry+https://github.com/rust-lang/crates.io-index#wasi@0.11.1+wasi-snapshot-preview1" = "9c7da0443e0bf7dff296b9c6a81a67964fa0290e311767101860356a664bc268" "registry+https://github.com/rust-lang/crates.io-index#wasip2@1.0.1+wasi-0.2.4" = "66e9546d4dcc87766fd72d8d5ef9987e133d78efc6834cd9b416a019e8098ff4" "registry+https://github.com/rust-lang/crates.io-index#wasip3@0.4.0+wasi-0.3.0-rc-2026-01-06" = "c534f9205391d698c6cc60c6bf660b07de4f4a8c8851a3bf0a7cdf43022b81d4" diff --git a/src/hash.rs b/src/hash.rs index 2fcc75a2..90b543a1 100644 --- a/src/hash.rs +++ b/src/hash.rs @@ -4,9 +4,7 @@ use std::{cell::RefCell, fmt::Display, hash::Hash, io, str::FromStr}; -use bincode::{Decode, Encode}; use colored::Colorize; -use serde::{Deserialize, Serialize}; use sha1::Digest; use crate::internal::object::types::ObjectType; @@ -24,10 +22,11 @@ use crate::internal::object::types::ObjectType; PartialOrd, Ord, Default, - Deserialize, - Serialize, - Encode, - Decode, + serde::Deserialize, + serde::Serialize, + rkyv::Archive, + rkyv::Serialize, + rkyv::Deserialize, )] pub enum HashKind { #[default] @@ -76,7 +75,19 @@ impl std::str::FromStr for HashKind { } #[derive( - Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, Deserialize, Serialize, Encode, Decode, + Clone, + Copy, + Debug, + PartialEq, + Eq, + Hash, + PartialOrd, + Ord, + serde::Deserialize, + serde::Serialize, + rkyv::Archive, + rkyv::Serialize, + rkyv::Deserialize, )] /// Concrete object ID value carrying the bytes for the selected algorithm (SHA-1 or SHA-256). /// Used for Git object hashes. diff --git a/src/internal/object/commit.rs b/src/internal/object/commit.rs index ba95a192..a88759b7 100644 --- a/src/internal/object/commit.rs +++ b/src/internal/object/commit.rs @@ -13,9 +13,7 @@ //! - The contents of the files in the repository at the time the commit was made. use std::{fmt::Display, str::FromStr}; -use bincode::{Decode, Encode}; use bstr::ByteSlice; -use serde::{Deserialize, Serialize}; use crate::{ errors::GitError, @@ -33,7 +31,16 @@ use crate::{ /// history of a repository with a single commit object at its root. /// - The author and committer fields contain the name, email address, timestamp and timezone. /// - The message field contains the commit message, which maybe include signed or DCO. -#[derive(Eq, Debug, Clone, Serialize, Deserialize, Decode, Encode)] +#[derive( + Eq, + Debug, + Clone, + serde::Serialize, + serde::Deserialize, + rkyv::Archive, + rkyv::Serialize, + rkyv::Deserialize, +)] pub struct Commit { pub id: ObjectHash, pub tree_id: ObjectHash, diff --git a/src/internal/object/note.rs b/src/internal/object/note.rs index 05892b82..46f05af5 100644 --- a/src/internal/object/note.rs +++ b/src/internal/object/note.rs @@ -12,9 +12,6 @@ use std::fmt::Display; -use bincode::{Decode, Encode}; -use serde::{Deserialize, Serialize}; - use crate::{ errors::GitError, hash::ObjectHash, @@ -26,7 +23,16 @@ use crate::{ /// A Note represents additional metadata attached to a Git object (typically a commit). /// The Note itself is stored as a Blob object in Git's object database, with the /// association managed through Git's reference system. -#[derive(Eq, Debug, Clone, Serialize, Deserialize, Decode, Encode)] +#[derive( + Eq, + Debug, + Clone, + serde::Serialize, + serde::Deserialize, + rkyv::Archive, + rkyv::Serialize, + rkyv::Deserialize, +)] pub struct Note { /// The ObjectHash of this Note object (same as the underlying Blob) pub id: ObjectHash, diff --git a/src/internal/object/signature.rs b/src/internal/object/signature.rs index 4962f83e..45b41057 100644 --- a/src/internal/object/signature.rs +++ b/src/internal/object/signature.rs @@ -11,10 +11,8 @@ //! use std::{fmt::Display, str::FromStr}; -use bincode::{Decode, Encode}; use bstr::ByteSlice; use chrono::Offset; -use serde::{Deserialize, Serialize}; use crate::errors::GitError; @@ -31,7 +29,17 @@ use crate::errors::GitError; /// ``` /// /// So, we design a `SignatureType` enum to indicate the signature type. -#[derive(PartialEq, Eq, Debug, Clone, Serialize, Deserialize, Decode, Encode)] +#[derive( + PartialEq, + Eq, + Debug, + Clone, + serde::Serialize, + serde::Deserialize, + rkyv::Archive, + rkyv::Serialize, + rkyv::Deserialize, +)] pub enum SignatureType { Author, Committer, @@ -78,7 +86,17 @@ impl SignatureType { } /// Represents a Git signature, including the author's name, email, timestamp, and timezone. -#[derive(PartialEq, Eq, Debug, Clone, Serialize, Deserialize, Decode, Encode)] +#[derive( + PartialEq, + Eq, + Debug, + Clone, + serde::Serialize, + serde::Deserialize, + rkyv::Archive, + rkyv::Serialize, + rkyv::Deserialize, +)] pub struct Signature { pub signature_type: SignatureType, pub name: String, diff --git a/src/internal/object/tree.rs b/src/internal/object/tree.rs index b942dfd9..9601c1eb 100644 --- a/src/internal/object/tree.rs +++ b/src/internal/object/tree.rs @@ -16,10 +16,8 @@ //! use std::fmt::Display; -use bincode::{Decode, Encode}; use colored::Colorize; use encoding_rs::GBK; -use serde::{Deserialize, Serialize}; use crate::{ errors::GitError, @@ -31,7 +29,19 @@ use crate::{ /// that entry. The mode is a three-digit octal number that encodes both the permissions and the /// type of the object. The first digit specifies the object type, and the remaining two digits /// specify the file mode or permissions. -#[derive(PartialEq, Eq, Debug, Clone, Copy, Serialize, Deserialize, Hash, Encode, Decode)] +#[derive( + PartialEq, + Eq, + Debug, + Clone, + Copy, + serde::Serialize, + serde::Deserialize, + Hash, + rkyv::Archive, + rkyv::Serialize, + rkyv::Deserialize, +)] pub enum TreeItemMode { Blob, BlobExecutable, @@ -132,7 +142,18 @@ impl TreeItemMode { /// 100644 hello-world\0 /// 040000 data\0 /// ``` -#[derive(PartialEq, Eq, Debug, Clone, Serialize, Deserialize, Hash, Encode, Decode)] +#[derive( + PartialEq, + Eq, + Debug, + Clone, + serde::Serialize, + serde::Deserialize, + Hash, + rkyv::Archive, + rkyv::Serialize, + rkyv::Deserialize, +)] pub struct TreeItem { pub mode: TreeItemMode, pub id: ObjectHash, @@ -229,7 +250,16 @@ impl TreeItem { /// A tree object is a Git object that represents a directory. It contains a list of entries, one /// for each file or directory in the tree. -#[derive(Eq, Debug, Clone, Serialize, Deserialize, Encode, Decode)] +#[derive( + Eq, + Debug, + Clone, + serde::Serialize, + serde::Deserialize, + rkyv::Archive, + rkyv::Serialize, + rkyv::Deserialize, +)] pub struct Tree { pub id: ObjectHash, pub tree_items: Vec, diff --git a/src/internal/object/types.rs b/src/internal/object/types.rs index c7410615..b8c00726 100644 --- a/src/internal/object/types.rs +++ b/src/internal/object/types.rs @@ -35,7 +35,19 @@ use crate::errors::GitError; /// /// The first seven variants mirror Git pack semantics. The remaining /// variants describe the application's AI workflow objects. -#[derive(PartialEq, Eq, Hash, Debug, Clone, Copy, Serialize, Deserialize)] +#[derive( + PartialEq, + Eq, + Hash, + Debug, + Clone, + Copy, + serde::Serialize, + serde::Deserialize, + rkyv::Archive, + rkyv::Serialize, + rkyv::Deserialize, +)] #[serde(rename_all = "snake_case")] pub enum ObjectType { /// A Git commit object. diff --git a/src/internal/pack/cache.rs b/src/internal/pack/cache.rs index d289fd49..b31b798d 100644 --- a/src/internal/pack/cache.rs +++ b/src/internal/pack/cache.rs @@ -21,6 +21,11 @@ use crate::{ time_it, }; +/// Cache format version appended to the disk path so that caches written with an +/// incompatible serialization format (for example the previous bincode layout) +/// are ignored instead of causing deserialization errors. +const CACHE_LAYOUT_VERSION: &str = "rkyv-v1"; + /// Trait defining the interface for a multi-tier cache system. /// This cache supports insertion and retrieval of objects by both offset and hash, /// as well as memory usage tracking and clearing functionality. @@ -104,6 +109,7 @@ impl Caches { let mut path = PathBuf::with_capacity(self.tmp_path.capacity() + hash.to_string().len() + 5); path.push(tmp_path); + path.push(CACHE_LAYOUT_VERSION); let hash_str = hash._to_string(); path.push(&hash_str[..2]); // use first 2 chars as the directory self.path_prefixes[hash.as_ref()[0] as usize].call_once(|| { diff --git a/src/internal/pack/cache_object.rs b/src/internal/pack/cache_object.rs index 4c61f8b8..c2b479ba 100644 --- a/src/internal/pack/cache_object.rs +++ b/src/internal/pack/cache_object.rs @@ -2,9 +2,8 @@ //! bound memory while still serving delta reconstruction quickly. use std::{ - fs, - fs::OpenOptions, - io, + borrow::Cow, + fs, io, io::Write, ops::Deref, path::{Path, PathBuf}, @@ -15,7 +14,16 @@ use std::{ }; use lru_mem::{HeapSize, MemSize}; -use serde::{Deserialize, Serialize}; +use rkyv::{ + Archive, Deserialize as RkyvDeserialize, Serialize as RkyvSerialize, + api::high::{HighSerializer, HighValidator}, + bytecheck::CheckBytes, + de::Pool, + rancor::{Error as RkyvError, Strategy}, + ser::allocator::ArenaHandle, + util::AlignedVec, +}; +use tempfile::NamedTempFile; use threadpool::ThreadPool; use crate::{ @@ -30,42 +38,66 @@ use crate::{ // static CACHE_OBJS_MEM_SIZE: AtomicUsize = AtomicUsize::new(0); /// file load&store trait -pub trait FileLoadStore: Serialize + for<'a> Deserialize<'a> { +pub trait FileLoadStore: Sized { fn f_load(path: &Path) -> Result; fn f_save(&self, path: &Path) -> Result<(), io::Error>; } -// trait alias, so that impl FileLoadStore == impl Serialize + Deserialize -impl Deserialize<'a>> FileLoadStore for T { +fn write_bytes_atomically(path: &Path, data: &[u8]) -> Result<(), io::Error> { + if path.exists() { + return Ok(()); + } + let dir = path + .parent() + .filter(|parent| !parent.as_os_str().is_empty()) + .unwrap_or_else(|| Path::new(".")); + + let mut temp_file = NamedTempFile::new_in(dir)?; + temp_file.write_all(data)?; + + match temp_file.persist_noclobber(path) { + Ok(_persisted) => Ok(()), + Err(err) if err.error.kind() == io::ErrorKind::AlreadyExists && path.exists() => Ok(()), + Err(err) => Err(err.error), + } +} + +impl FileLoadStore for T +where + T: Archive, + T: for<'a> RkyvSerialize, RkyvError>>, + T::Archived: for<'a> CheckBytes> + + RkyvDeserialize>, +{ /// load object from file fn f_load(path: &Path) -> Result { let data = fs::read(path)?; - let obj: T = bincode::serde::decode_from_slice(&data, bincode::config::standard()) - .map_err(io::Error::other)? - .0; + let obj = rkyv::from_bytes::(&data).map_err(io::Error::other)?; Ok(obj) } + fn f_save(&self, path: &Path) -> Result<(), io::Error> { if path.exists() { return Ok(()); } - let data = bincode::serde::encode_to_vec(self, bincode::config::standard()).unwrap(); - let path = path.with_extension("temp"); - { - let mut file = OpenOptions::new() - .write(true) - .create_new(true) - .open(path.clone())?; - file.write_all(&data)?; - } - let final_path = path.with_extension(""); - fs::rename(&path, final_path.clone())?; - Ok(()) + + let data = rkyv::to_bytes::(self).map_err(io::Error::other)?; + write_bytes_atomically(path, &data) } } /// Represents the metadata of a cache object, indicating whether it is a delta or not. -#[derive(PartialEq, Eq, Clone, Debug, Serialize, Deserialize)] +#[derive( + PartialEq, + Eq, + Clone, + Debug, + serde::Serialize, + serde::Deserialize, + rkyv::Archive, + rkyv::Serialize, + rkyv::Deserialize, +)] pub(crate) enum CacheObjectInfo { /// The object is one of the four basic types: /// [`ObjectType::Blob`], [`ObjectType::Tree`], [`ObjectType::Commit`], or [`ObjectType::Tag`]. @@ -94,7 +126,7 @@ impl CacheObjectInfo { } /// Represents a cached object in memory, which may be a delta or a base object. -#[derive(Debug, Serialize, Deserialize)] +#[derive(Debug)] pub struct CacheObject { pub(crate) info: CacheObjectInfo, pub offset: usize, @@ -104,6 +136,68 @@ pub struct CacheObject { pub is_delta_in_pack: bool, } +#[derive(Debug, rkyv::Archive, rkyv::Serialize, rkyv::Deserialize)] +struct CacheObjectOnDisk { + info: CacheObjectInfo, + offset: usize, + crc32: u32, + data_decompressed: Vec, + is_delta_in_pack: bool, +} + +#[derive(Debug, rkyv::Archive, rkyv::Serialize)] +struct CacheObjectOnDiskRef<'a> { + #[rkyv(with = rkyv::with::AsOwned)] + info: Cow<'a, CacheObjectInfo>, + offset: usize, + crc32: u32, + #[rkyv(with = rkyv::with::AsOwned)] + data_decompressed: Cow<'a, [u8]>, + is_delta_in_pack: bool, +} + +impl<'a> From<&'a CacheObject> for CacheObjectOnDiskRef<'a> { + fn from(value: &'a CacheObject) -> Self { + Self { + info: Cow::Borrowed(&value.info), + offset: value.offset, + crc32: value.crc32, + data_decompressed: Cow::Borrowed(value.data_decompressed.as_slice()), + is_delta_in_pack: value.is_delta_in_pack, + } + } +} + +impl From for CacheObject { + fn from(value: CacheObjectOnDisk) -> Self { + Self { + info: value.info, + offset: value.offset, + crc32: value.crc32, + data_decompressed: value.data_decompressed, + mem_recorder: None, + is_delta_in_pack: value.is_delta_in_pack, + } + } +} + +impl FileLoadStore for CacheObject { + fn f_load(path: &Path) -> Result { + let obj = CacheObjectOnDisk::f_load(path)?; + Ok(obj.into()) + } + + fn f_save(&self, path: &Path) -> Result<(), io::Error> { + if path.exists() { + return Ok(()); + } + + let data = rkyv::to_bytes::(&CacheObjectOnDiskRef::from(self)) + .map_err(io::Error::other)?; + write_bytes_atomically(path, &data) + } +} + impl Clone for CacheObject { fn clone(&self) -> Self { let obj = CacheObject { @@ -292,16 +386,10 @@ impl CacheObject { } /// trait alias for simple use -pub trait ArcWrapperBounds: - HeapSize + Serialize + for<'a> Deserialize<'a> + Send + Sync + 'static -{ -} +pub trait ArcWrapperBounds: HeapSize + FileLoadStore + Send + Sync + 'static {} // You must impl `Alias Trait` for all the `T` satisfying Constraints // Or, `T` will not satisfy `Alias Trait` even if it satisfies the Original traits -impl Deserialize<'a> + Send + Sync + 'static> ArcWrapperBounds - for T -{ -} +impl ArcWrapperBounds for T {} /// Implementing encapsulation of Arc to enable third-party Trait HeapSize implementation for the Arc type /// Because of use Arc in LruCache, the LruCache is not clear whether a pointer will drop the referenced @@ -393,6 +481,7 @@ mod test { use std::{fs, sync::Mutex}; use lru_mem::LruCache; + use tempfile::tempdir; use super::*; use crate::hash::{HashKind, set_hash_kind_for_test}; @@ -498,7 +587,9 @@ mod test { } /// test that the Drop trait is called when an object is ejected from the LRU cache - #[derive(Serialize, Deserialize)] + #[derive( + serde::Serialize, serde::Deserialize, rkyv::Archive, rkyv::Serialize, rkyv::Deserialize, + )] struct Test { a: usize, } @@ -565,16 +656,53 @@ mod test { for (kind, size) in [(HashKind::Sha1, 1024usize), (HashKind::Sha256, 2048usize)] { let _guard = set_hash_kind_for_test(kind); let a = make_obj(size); - let s = bincode::serde::encode_to_vec(&a, bincode::config::standard()).unwrap(); - let b: CacheObject = bincode::serde::decode_from_slice(&s, bincode::config::standard()) + let s = rkyv::to_bytes::(&CacheObjectOnDiskRef::from(&a)).unwrap(); + let b: CacheObject = rkyv::from_bytes::(&s) .unwrap() - .0; + .into(); assert_eq!(a.info, b.info); assert_eq!(a.data_decompressed, b.data_decompressed); assert_eq!(a.offset, b.offset); + assert!(b.mem_recorder.is_none()); } } + #[test] + fn test_write_bytes_atomically_creates_file_when_missing() { + let dir = tempdir().unwrap(); + let path = dir.path().join("object"); + + write_bytes_atomically(&path, b"fresh").unwrap(); + + assert_eq!(fs::read(&path).unwrap(), b"fresh"); + } + + #[test] + fn test_write_bytes_atomically_returns_when_target_exists() { + let dir = tempdir().unwrap(); + let path = dir.path().join("object"); + + fs::write(&path, b"existing").unwrap(); + write_bytes_atomically(&path, b"new-data").unwrap(); + + assert_eq!(fs::read(&path).unwrap(), b"existing"); + } + + #[test] + fn test_cache_object_file_roundtrip() { + let dir = tempdir().unwrap(); + let path = dir.path().join("object"); + let a = make_obj(1024); + + a.f_save(&path).unwrap(); + let b = CacheObject::f_load(&path).unwrap(); + + assert_eq!(a.info, b.info); + assert_eq!(a.data_decompressed, b.data_decompressed); + assert_eq!(a.offset, b.offset); + assert!(b.mem_recorder.is_none()); + } + #[test] fn test_arc_wrapper_drop_store() { let mut path = PathBuf::from(".cache_temp/test_arc_wrapper_drop_store"); diff --git a/third-party/rust/crates/bincode/2.0.1/BUCK b/third-party/rust/crates/bincode/2.0.1/BUCK deleted file mode 100644 index 56e83ec1..00000000 --- a/third-party/rust/crates/bincode/2.0.1/BUCK +++ /dev/null @@ -1,41 +0,0 @@ -# @generated by `cargo buckal` - -load("@buckal//:cargo_manifest.bzl", "cargo_manifest") -load("@buckal//:wrapper.bzl", "rust_library") - -http_archive( - name = "bincode-vendor", - urls = ["https://static.crates.io/crates/bincode/bincode-2.0.1.crate"], - sha256 = "36eaf5d7b090263e8150820482d5d93cd964a81e4019913c972f4edcc6edb740", - type = "tar.gz", - strip_prefix = "bincode-2.0.1", - out = "vendor", -) - -cargo_manifest( - name = "bincode-manifest", - vendor = ":bincode-vendor", -) - -rust_library( - name = "bincode", - srcs = [":bincode-vendor"], - crate = "bincode", - crate_root = "vendor/src/lib.rs", - edition = "2021", - features = [ - "alloc", - "bincode_derive", - "default", - "derive", - "serde", - "std", - ], - rustc_flags = ["@$(location :bincode-manifest[env_flags])"], - visibility = ["PUBLIC"], - deps = [ - "//third-party/rust/crates/bincode_derive/2.0.1:bincode_derive", - "//third-party/rust/crates/serde/1.0.228:serde", - "//third-party/rust/crates/unty/0.0.4:unty", - ], -) diff --git a/third-party/rust/crates/bincode_derive/2.0.1/BUCK b/third-party/rust/crates/bincode_derive/2.0.1/BUCK deleted file mode 100644 index f00fdaee..00000000 --- a/third-party/rust/crates/bincode_derive/2.0.1/BUCK +++ /dev/null @@ -1,30 +0,0 @@ -# @generated by `cargo buckal` - -load("@buckal//:cargo_manifest.bzl", "cargo_manifest") -load("@buckal//:wrapper.bzl", "rust_library") - -http_archive( - name = "bincode_derive-vendor", - urls = ["https://static.crates.io/crates/bincode_derive/bincode_derive-2.0.1.crate"], - sha256 = "bf95709a440f45e986983918d0e8a1f30a9b1df04918fc828670606804ac3c09", - type = "tar.gz", - strip_prefix = "bincode_derive-2.0.1", - out = "vendor", -) - -cargo_manifest( - name = "bincode_derive-manifest", - vendor = ":bincode_derive-vendor", -) - -rust_library( - name = "bincode_derive", - srcs = [":bincode_derive-vendor"], - crate = "bincode_derive", - crate_root = "vendor/src/lib.rs", - edition = "2021", - rustc_flags = ["@$(location :bincode_derive-manifest[env_flags])"], - proc_macro = True, - visibility = ["PUBLIC"], - deps = ["//third-party/rust/crates/virtue/0.0.18:virtue"], -) diff --git a/third-party/rust/crates/bytecheck/0.8.2/BUCK b/third-party/rust/crates/bytecheck/0.8.2/BUCK new file mode 100644 index 00000000..039fb960 --- /dev/null +++ b/third-party/rust/crates/bytecheck/0.8.2/BUCK @@ -0,0 +1,35 @@ +# @generated by `cargo buckal` + +load("@buckal//:cargo_manifest.bzl", "cargo_manifest") +load("@buckal//:wrapper.bzl", "rust_library") + +http_archive( + name = "bytecheck-vendor", + urls = ["https://static.crates.io/crates/bytecheck/bytecheck-0.8.2.crate"], + sha256 = "0caa33a2c0edca0419d15ac723dff03f1956f7978329b1e3b5fdaaaed9d3ca8b", + type = "tar.gz", + strip_prefix = "bytecheck-0.8.2", + out = "vendor", +) + +cargo_manifest( + name = "bytecheck-manifest", + vendor = ":bytecheck-vendor", +) + +rust_library( + name = "bytecheck", + srcs = [":bytecheck-vendor"], + crate = "bytecheck", + crate_root = "vendor/src/lib.rs", + edition = "2021", + features = ["simdutf8"], + rustc_flags = ["@$(location :bytecheck-manifest[env_flags])"], + visibility = ["PUBLIC"], + deps = [ + "//third-party/rust/crates/bytecheck_derive/0.8.2:bytecheck_derive", + "//third-party/rust/crates/ptr_meta/0.3.1:ptr_meta", + "//third-party/rust/crates/rancor/0.1.1:rancor", + "//third-party/rust/crates/simdutf8/0.1.5:simdutf8", + ], +) diff --git a/third-party/rust/crates/bytecheck_derive/0.8.2/BUCK b/third-party/rust/crates/bytecheck_derive/0.8.2/BUCK new file mode 100644 index 00000000..043fe0d1 --- /dev/null +++ b/third-party/rust/crates/bytecheck_derive/0.8.2/BUCK @@ -0,0 +1,34 @@ +# @generated by `cargo buckal` + +load("@buckal//:cargo_manifest.bzl", "cargo_manifest") +load("@buckal//:wrapper.bzl", "rust_library") + +http_archive( + name = "bytecheck_derive-vendor", + urls = ["https://static.crates.io/crates/bytecheck_derive/bytecheck_derive-0.8.2.crate"], + sha256 = "89385e82b5d1821d2219e0b095efa2cc1f246cbf99080f3be46a1a85c0d392d9", + type = "tar.gz", + strip_prefix = "bytecheck_derive-0.8.2", + out = "vendor", +) + +cargo_manifest( + name = "bytecheck_derive-manifest", + vendor = ":bytecheck_derive-vendor", +) + +rust_library( + name = "bytecheck_derive", + srcs = [":bytecheck_derive-vendor"], + crate = "bytecheck_derive", + crate_root = "vendor/src/lib.rs", + edition = "2021", + rustc_flags = ["@$(location :bytecheck_derive-manifest[env_flags])"], + proc_macro = True, + visibility = ["PUBLIC"], + deps = [ + "//third-party/rust/crates/proc-macro2/1.0.103:proc-macro2", + "//third-party/rust/crates/quote/1.0.42:quote", + "//third-party/rust/crates/syn/2.0.111:syn", + ], +) diff --git a/third-party/rust/crates/munge/0.4.7/BUCK b/third-party/rust/crates/munge/0.4.7/BUCK new file mode 100644 index 00000000..0a425974 --- /dev/null +++ b/third-party/rust/crates/munge/0.4.7/BUCK @@ -0,0 +1,29 @@ +# @generated by `cargo buckal` + +load("@buckal//:cargo_manifest.bzl", "cargo_manifest") +load("@buckal//:wrapper.bzl", "rust_library") + +http_archive( + name = "munge-vendor", + urls = ["https://static.crates.io/crates/munge/munge-0.4.7.crate"], + sha256 = "5e17401f259eba956ca16491461b6e8f72913a0a114e39736ce404410f915a0c", + type = "tar.gz", + strip_prefix = "munge-0.4.7", + out = "vendor", +) + +cargo_manifest( + name = "munge-manifest", + vendor = ":munge-vendor", +) + +rust_library( + name = "munge", + srcs = [":munge-vendor"], + crate = "munge", + crate_root = "vendor/src/lib.rs", + edition = "2021", + rustc_flags = ["@$(location :munge-manifest[env_flags])"], + visibility = ["PUBLIC"], + deps = ["//third-party/rust/crates/munge_macro/0.4.7:munge_macro"], +) diff --git a/third-party/rust/crates/munge_macro/0.4.7/BUCK b/third-party/rust/crates/munge_macro/0.4.7/BUCK new file mode 100644 index 00000000..9217cf08 --- /dev/null +++ b/third-party/rust/crates/munge_macro/0.4.7/BUCK @@ -0,0 +1,34 @@ +# @generated by `cargo buckal` + +load("@buckal//:cargo_manifest.bzl", "cargo_manifest") +load("@buckal//:wrapper.bzl", "rust_library") + +http_archive( + name = "munge_macro-vendor", + urls = ["https://static.crates.io/crates/munge_macro/munge_macro-0.4.7.crate"], + sha256 = "4568f25ccbd45ab5d5603dc34318c1ec56b117531781260002151b8530a9f931", + type = "tar.gz", + strip_prefix = "munge_macro-0.4.7", + out = "vendor", +) + +cargo_manifest( + name = "munge_macro-manifest", + vendor = ":munge_macro-vendor", +) + +rust_library( + name = "munge_macro", + srcs = [":munge_macro-vendor"], + crate = "munge_macro", + crate_root = "vendor/src/lib.rs", + edition = "2021", + rustc_flags = ["@$(location :munge_macro-manifest[env_flags])"], + proc_macro = True, + visibility = ["PUBLIC"], + deps = [ + "//third-party/rust/crates/proc-macro2/1.0.103:proc-macro2", + "//third-party/rust/crates/quote/1.0.42:quote", + "//third-party/rust/crates/syn/2.0.111:syn", + ], +) diff --git a/third-party/rust/crates/ptr_meta/0.3.1/BUCK b/third-party/rust/crates/ptr_meta/0.3.1/BUCK new file mode 100644 index 00000000..508e43e5 --- /dev/null +++ b/third-party/rust/crates/ptr_meta/0.3.1/BUCK @@ -0,0 +1,34 @@ +# @generated by `cargo buckal` + +load("@buckal//:cargo_manifest.bzl", "cargo_manifest") +load("@buckal//:wrapper.bzl", "rust_library") + +http_archive( + name = "ptr_meta-vendor", + urls = ["https://static.crates.io/crates/ptr_meta/ptr_meta-0.3.1.crate"], + sha256 = "0b9a0cf95a1196af61d4f1cbdab967179516d9a4a4312af1f31948f8f6224a79", + type = "tar.gz", + strip_prefix = "ptr_meta-0.3.1", + out = "vendor", +) + +cargo_manifest( + name = "ptr_meta-manifest", + vendor = ":ptr_meta-vendor", +) + +rust_library( + name = "ptr_meta", + srcs = [":ptr_meta-vendor"], + crate = "ptr_meta", + crate_root = "vendor/src/lib.rs", + edition = "2021", + features = [ + "derive", + "ptr_meta_derive", + "std", + ], + rustc_flags = ["@$(location :ptr_meta-manifest[env_flags])"], + visibility = ["PUBLIC"], + deps = ["//third-party/rust/crates/ptr_meta_derive/0.3.1:ptr_meta_derive"], +) diff --git a/third-party/rust/crates/ptr_meta_derive/0.3.1/BUCK b/third-party/rust/crates/ptr_meta_derive/0.3.1/BUCK new file mode 100644 index 00000000..b3bc8d8f --- /dev/null +++ b/third-party/rust/crates/ptr_meta_derive/0.3.1/BUCK @@ -0,0 +1,34 @@ +# @generated by `cargo buckal` + +load("@buckal//:cargo_manifest.bzl", "cargo_manifest") +load("@buckal//:wrapper.bzl", "rust_library") + +http_archive( + name = "ptr_meta_derive-vendor", + urls = ["https://static.crates.io/crates/ptr_meta_derive/ptr_meta_derive-0.3.1.crate"], + sha256 = "7347867d0a7e1208d93b46767be83e2b8f978c3dad35f775ac8d8847551d6fe1", + type = "tar.gz", + strip_prefix = "ptr_meta_derive-0.3.1", + out = "vendor", +) + +cargo_manifest( + name = "ptr_meta_derive-manifest", + vendor = ":ptr_meta_derive-vendor", +) + +rust_library( + name = "ptr_meta_derive", + srcs = [":ptr_meta_derive-vendor"], + crate = "ptr_meta_derive", + crate_root = "vendor/src/lib.rs", + edition = "2021", + rustc_flags = ["@$(location :ptr_meta_derive-manifest[env_flags])"], + proc_macro = True, + visibility = ["PUBLIC"], + deps = [ + "//third-party/rust/crates/proc-macro2/1.0.103:proc-macro2", + "//third-party/rust/crates/quote/1.0.42:quote", + "//third-party/rust/crates/syn/2.0.111:syn", + ], +) diff --git a/third-party/rust/crates/rancor/0.1.1/BUCK b/third-party/rust/crates/rancor/0.1.1/BUCK new file mode 100644 index 00000000..06cf7439 --- /dev/null +++ b/third-party/rust/crates/rancor/0.1.1/BUCK @@ -0,0 +1,30 @@ +# @generated by `cargo buckal` + +load("@buckal//:cargo_manifest.bzl", "cargo_manifest") +load("@buckal//:wrapper.bzl", "rust_library") + +http_archive( + name = "rancor-vendor", + urls = ["https://static.crates.io/crates/rancor/rancor-0.1.1.crate"], + sha256 = "a063ea72381527c2a0561da9c80000ef822bdd7c3241b1cc1b12100e3df081ee", + type = "tar.gz", + strip_prefix = "rancor-0.1.1", + out = "vendor", +) + +cargo_manifest( + name = "rancor-manifest", + vendor = ":rancor-vendor", +) + +rust_library( + name = "rancor", + srcs = [":rancor-vendor"], + crate = "rancor", + crate_root = "vendor/src/lib.rs", + edition = "2021", + features = ["alloc"], + rustc_flags = ["@$(location :rancor-manifest[env_flags])"], + visibility = ["PUBLIC"], + deps = ["//third-party/rust/crates/ptr_meta/0.3.1:ptr_meta"], +) diff --git a/third-party/rust/crates/rend/0.5.3/BUCK b/third-party/rust/crates/rend/0.5.3/BUCK new file mode 100644 index 00000000..b9a6c33e --- /dev/null +++ b/third-party/rust/crates/rend/0.5.3/BUCK @@ -0,0 +1,30 @@ +# @generated by `cargo buckal` + +load("@buckal//:cargo_manifest.bzl", "cargo_manifest") +load("@buckal//:wrapper.bzl", "rust_library") + +http_archive( + name = "rend-vendor", + urls = ["https://static.crates.io/crates/rend/rend-0.5.3.crate"], + sha256 = "cadadef317c2f20755a64d7fdc48f9e7178ee6b0e1f7fce33fa60f1d68a276e6", + type = "tar.gz", + strip_prefix = "rend-0.5.3", + out = "vendor", +) + +cargo_manifest( + name = "rend-manifest", + vendor = ":rend-vendor", +) + +rust_library( + name = "rend", + srcs = [":rend-vendor"], + crate = "rend", + crate_root = "vendor/src/lib.rs", + edition = "2021", + features = ["bytecheck"], + rustc_flags = ["@$(location :rend-manifest[env_flags])"], + visibility = ["PUBLIC"], + deps = ["//third-party/rust/crates/bytecheck/0.8.2:bytecheck"], +) diff --git a/third-party/rust/crates/rkyv/0.8.15/BUCK b/third-party/rust/crates/rkyv/0.8.15/BUCK new file mode 100644 index 00000000..a749f1be --- /dev/null +++ b/third-party/rust/crates/rkyv/0.8.15/BUCK @@ -0,0 +1,49 @@ +# @generated by `cargo buckal` + +load("@buckal//:cargo_manifest.bzl", "cargo_manifest") +load("@buckal//:wrapper.bzl", "rust_library") + +http_archive( + name = "rkyv-vendor", + urls = ["https://static.crates.io/crates/rkyv/rkyv-0.8.15.crate"], + sha256 = "1a30e631b7f4a03dee9056b8ef6982e8ba371dd5bedb74d3ec86df4499132c70", + type = "tar.gz", + strip_prefix = "rkyv-0.8.15", + out = "vendor", +) + +cargo_manifest( + name = "rkyv-manifest", + vendor = ":rkyv-vendor", +) + +rust_library( + name = "rkyv", + srcs = [":rkyv-vendor"], + crate = "rkyv", + crate_root = "vendor/src/lib.rs", + edition = "2021", + features = [ + "alloc", + "bytecheck", + "default", + "std", + ], + rustc_flags = ["@$(location :rkyv-manifest[env_flags])"], + named_deps = { + "bytes_1": "//third-party/rust/crates/bytes/1.11.1:bytes", + "indexmap_2": "//third-party/rust/crates/indexmap/2.12.1:indexmap", + "tinyvec_1": "//third-party/rust/crates/tinyvec/1.10.0:tinyvec", + "uuid_1": "//third-party/rust/crates/uuid/1.22.0:uuid", + }, + visibility = ["PUBLIC"], + deps = [ + "//third-party/rust/crates/bytecheck/0.8.2:bytecheck", + "//third-party/rust/crates/hashbrown/0.16.1:hashbrown", + "//third-party/rust/crates/munge/0.4.7:munge", + "//third-party/rust/crates/ptr_meta/0.3.1:ptr_meta", + "//third-party/rust/crates/rancor/0.1.1:rancor", + "//third-party/rust/crates/rend/0.5.3:rend", + "//third-party/rust/crates/rkyv_derive/0.8.15:rkyv_derive", + ], +) diff --git a/third-party/rust/crates/rkyv_derive/0.8.15/BUCK b/third-party/rust/crates/rkyv_derive/0.8.15/BUCK new file mode 100644 index 00000000..15714864 --- /dev/null +++ b/third-party/rust/crates/rkyv_derive/0.8.15/BUCK @@ -0,0 +1,35 @@ +# @generated by `cargo buckal` + +load("@buckal//:cargo_manifest.bzl", "cargo_manifest") +load("@buckal//:wrapper.bzl", "rust_library") + +http_archive( + name = "rkyv_derive-vendor", + urls = ["https://static.crates.io/crates/rkyv_derive/rkyv_derive-0.8.15.crate"], + sha256 = "8100bb34c0a1d0f907143db3149e6b4eea3c33b9ee8b189720168e818303986f", + type = "tar.gz", + strip_prefix = "rkyv_derive-0.8.15", + out = "vendor", +) + +cargo_manifest( + name = "rkyv_derive-manifest", + vendor = ":rkyv_derive-vendor", +) + +rust_library( + name = "rkyv_derive", + srcs = [":rkyv_derive-vendor"], + crate = "rkyv_derive", + crate_root = "vendor/src/lib.rs", + edition = "2021", + features = ["bytecheck"], + rustc_flags = ["@$(location :rkyv_derive-manifest[env_flags])"], + proc_macro = True, + visibility = ["PUBLIC"], + deps = [ + "//third-party/rust/crates/proc-macro2/1.0.103:proc-macro2", + "//third-party/rust/crates/quote/1.0.42:quote", + "//third-party/rust/crates/syn/2.0.111:syn", + ], +) diff --git a/third-party/rust/crates/unty/0.0.4/BUCK b/third-party/rust/crates/unty/0.0.4/BUCK deleted file mode 100644 index 8ab0c99b..00000000 --- a/third-party/rust/crates/unty/0.0.4/BUCK +++ /dev/null @@ -1,28 +0,0 @@ -# @generated by `cargo buckal` - -load("@buckal//:cargo_manifest.bzl", "cargo_manifest") -load("@buckal//:wrapper.bzl", "rust_library") - -http_archive( - name = "unty-vendor", - urls = ["https://static.crates.io/crates/unty/unty-0.0.4.crate"], - sha256 = "6d49784317cd0d1ee7ec5c716dd598ec5b4483ea832a2dced265471cc0f690ae", - type = "tar.gz", - strip_prefix = "unty-0.0.4", - out = "vendor", -) - -cargo_manifest( - name = "unty-manifest", - vendor = ":unty-vendor", -) - -rust_library( - name = "unty", - srcs = [":unty-vendor"], - crate = "unty", - crate_root = "vendor/src/lib.rs", - edition = "2021", - rustc_flags = ["@$(location :unty-manifest[env_flags])"], - visibility = ["PUBLIC"], -) diff --git a/third-party/rust/crates/virtue/0.0.18/BUCK b/third-party/rust/crates/virtue/0.0.18/BUCK deleted file mode 100644 index 6a7a91a9..00000000 --- a/third-party/rust/crates/virtue/0.0.18/BUCK +++ /dev/null @@ -1,28 +0,0 @@ -# @generated by `cargo buckal` - -load("@buckal//:cargo_manifest.bzl", "cargo_manifest") -load("@buckal//:wrapper.bzl", "rust_library") - -http_archive( - name = "virtue-vendor", - urls = ["https://static.crates.io/crates/virtue/virtue-0.0.18.crate"], - sha256 = "051eb1abcf10076295e815102942cc58f9d5e3b4560e46e53c21e8ff6f3af7b1", - type = "tar.gz", - strip_prefix = "virtue-0.0.18", - out = "vendor", -) - -cargo_manifest( - name = "virtue-manifest", - vendor = ":virtue-vendor", -) - -rust_library( - name = "virtue", - srcs = [":virtue-vendor"], - crate = "virtue", - crate_root = "vendor/src/lib.rs", - edition = "2021", - rustc_flags = ["@$(location :virtue-manifest[env_flags])"], - visibility = ["PUBLIC"], -)