From a6da00da678c1bbe8a30d1fdd4f92a3d0861af58 Mon Sep 17 00:00:00 2001 From: Rune Soerensen Date: Fri, 1 Nov 2024 14:06:55 -0400 Subject: [PATCH] Prefer libherokubuildpack inventory module (#54) --- Cargo.lock | 114 ++++++++++++++---------- Cargo.toml | 2 +- jruby_executable/Cargo.toml | 2 +- jruby_executable/src/bin/jruby_build.rs | 3 +- jruby_executable/src/bin/jruby_check.rs | 2 +- ruby_executable/Cargo.toml | 2 +- ruby_executable/src/bin/ruby_build.rs | 5 +- ruby_executable/src/bin/ruby_check.rs | 2 +- shared/Cargo.toml | 2 +- shared/src/inventory_help.rs | 4 +- shared/src/lib.rs | 2 +- 11 files changed, 80 insertions(+), 60 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 4ffdedc..54f81ed 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -17,6 +17,12 @@ version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" +[[package]] +name = "adler2" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "512761e0bb2578dd7380c6baaa0f4ce03e84f95e960231d1dec8bf4d7d6e2627" + [[package]] name = "aho-corasick" version = "1.1.3" @@ -118,7 +124,7 @@ dependencies = [ "cc", "cfg-if", "libc", - "miniz_oxide", + "miniz_oxide 0.7.3", "object", "rustc-demangle", ] @@ -403,12 +409,12 @@ dependencies = [ [[package]] name = "flate2" -version = "1.0.30" +version = "1.0.34" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f54427cfd1c7829e2a139fcefea601bf088ebca651d2bf53ebc600eac295dae" +checksum = "a1b589b4dc103969ad3cf85c950899926ec64300a1a46d76c03a6072957036f0" dependencies = [ "crc32fast", - "miniz_oxide", + "miniz_oxide 0.8.0", ] [[package]] @@ -574,9 +580,9 @@ dependencies = [ [[package]] name = "hashbrown" -version = "0.14.5" +version = "0.15.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e5274423e17b7c9fc20b6e7e208532f9b19825d82dfd615708b70edd83df41f1" +checksum = "1e087f84d4f86bf4b218b927129862374b72199ae7d8657835f1e89000eea4fb" [[package]] name = "heck" @@ -733,9 +739,9 @@ dependencies = [ [[package]] name = "indexmap" -version = "2.2.6" +version = "2.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "168fb715dda47215e360912c096649d23d58bf392ac62f73919e831745e40f26" +checksum = "707907fe3c25f5424cce2cb7e1cbcafee6bdbe735ca90ef77c29e84591e5b9da" dependencies = [ "equivalent", "hashbrown", @@ -747,18 +753,6 @@ version = "2.0.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b248f5224d1d606005e02c97f5aa4e88eeb230488bcc03bc9ca4d7991399f2b5" -[[package]] -name = "inventory" -version = "0.1.0" -source = "git+https://github.com/Malax/inventory#e4eed7de95e49d441cdf13f9c001644ed9159393" -dependencies = [ - "hex", - "serde", - "sha2", - "thiserror", - "toml", -] - [[package]] name = "ipnet" version = "2.9.0" @@ -801,9 +795,9 @@ dependencies = [ "gem_version", "glob", "indoc", - "inventory", "java-properties", "lazy_static", + "libherokubuildpack", "nom", "regex", "reqwest", @@ -835,6 +829,19 @@ version = "0.2.155" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "97b3888a4aecf77e811145cadf6eef5901f4782c53886191b2f693f24761847c" +[[package]] +name = "libherokubuildpack" +version = "0.24.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bec33ef08ce0508ced826f7bdfcd0538bdfc2270632915e447d1ea72bce5645d" +dependencies = [ + "hex", + "serde", + "sha2", + "thiserror", + "toml", +] + [[package]] name = "linux-raw-sys" version = "0.4.14" @@ -874,6 +881,15 @@ dependencies = [ "adler", ] +[[package]] +name = "miniz_oxide" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e2d80299ef12ff69b16a84bb182e3b9df68b5a91574d3d4fa6e41b65deec4df1" +dependencies = [ + "adler2", +] + [[package]] name = "mio" version = "0.8.11" @@ -1045,9 +1061,9 @@ dependencies = [ [[package]] name = "quote" -version = "1.0.36" +version = "1.0.37" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0fa76aaf39101c457836aec0ce2316dbdc3ab723cdda1c6bd4e6ad4208acaca7" +checksum = "b5b9d34b8991d19d98081b46eacdd8eb58c6f2b201139f7c5f643cc155a633af" dependencies = [ "proc-macro2", ] @@ -1165,7 +1181,7 @@ dependencies = [ "fun_run", "gem_version", "indoc", - "inventory", + "libherokubuildpack", "nom", "regex", "reqwest", @@ -1207,9 +1223,9 @@ dependencies = [ [[package]] name = "rustls-pki-types" -version = "1.7.0" +version = "1.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "976295e77ce332211c0d24d92c0e83e50f5c5f046d11082cea19f3df13a3562d" +checksum = "16f1201b3c9a7ee8039bcadc17b7e605e2945b27eee7631788c1bd2b0643674b" [[package]] name = "ryu" @@ -1251,18 +1267,18 @@ dependencies = [ [[package]] name = "serde" -version = "1.0.204" +version = "1.0.210" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bc76f558e0cbb2a839d37354c575f1dc3fdc6546b5be373ba43d95f231bf7c12" +checksum = "c8e3592472072e6e22e0a54d5904d9febf8508f65fb8552499a1abc7d1078c3a" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.204" +version = "1.0.210" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e0cd7e117be63d3c3678776753929474f3b04a43a080c744d6b0ae2a8c28e222" +checksum = "243902eda00fad750862fc144cea25caca5e20d615af0a81bee94ca738f1df1f" dependencies = [ "proc-macro2", "quote", @@ -1282,9 +1298,9 @@ dependencies = [ [[package]] name = "serde_spanned" -version = "0.6.6" +version = "0.6.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "79e674e01f999af37c49f70a6ede167a8a60b2503e56c5599532a65baa5969a0" +checksum = "87607cb1398ed59d48732e575a4c28a7a8ebf2454b964fe3f224f2afc07909e1" dependencies = [ "serde", ] @@ -1327,7 +1343,7 @@ dependencies = [ "glob", "hex", "indoc", - "inventory", + "libherokubuildpack", "nom", "rayon", "regex", @@ -1374,9 +1390,9 @@ checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f" [[package]] name = "syn" -version = "2.0.66" +version = "2.0.79" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c42f3f41a2de00b01c0aaad383c5a45241efc8b2d1eda5661812fda5f3cdcff5" +checksum = "89132cd0bf050864e1d38dc3bbc07a0eb8e7530af26344d3d2bbbef83499f590" dependencies = [ "proc-macro2", "quote", @@ -1412,9 +1428,9 @@ dependencies = [ [[package]] name = "tar" -version = "0.4.40" +version = "0.4.42" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b16afcea1f22891c49a00c751c7b63b2233284064f11a200fc624137c51e2ddb" +checksum = "4ff6c40d3aedb5e06b57c6f669ad17ab063dd1e63d977c6a88e7f4dfa4f04020" dependencies = [ "filetime", "libc", @@ -1435,18 +1451,18 @@ dependencies = [ [[package]] name = "thiserror" -version = "1.0.61" +version = "1.0.64" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c546c80d6be4bc6a00c0f01730c08df82eaa7a7a61f11d656526506112cc1709" +checksum = "d50af8abc119fb8bb6dbabcfa89656f46f84aa0ac7688088608076ad2b459a84" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.61" +version = "1.0.64" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "46c3384250002a6d5af4d114f2845d37b57521033f30d5c3f46c4d70e1197533" +checksum = "08904e7672f5eb876eaaf87e0ce17857500934f4981c4a0ab2b4aa98baac7fc3" dependencies = [ "proc-macro2", "quote", @@ -1521,9 +1537,9 @@ dependencies = [ [[package]] name = "toml" -version = "0.8.15" +version = "0.8.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac2caab0bf757388c6c0ae23b3293fdb463fee59434529014f85e3263b995c28" +checksum = "a1ed1f98e3fdc28d6d910e6737ae6ab1a93bf1985935a1193e68f93eeb68d24e" dependencies = [ "serde", "serde_spanned", @@ -1533,18 +1549,18 @@ dependencies = [ [[package]] name = "toml_datetime" -version = "0.6.6" +version = "0.6.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4badfd56924ae69bcc9039335b2e017639ce3f9b001c393c1b2d1ef846ce2cbf" +checksum = "0dd7358ecb8fc2f8d014bf86f6f638ce72ba252a2c3a2572f2a795f1d23efb41" dependencies = [ "serde", ] [[package]] name = "toml_edit" -version = "0.22.16" +version = "0.22.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "278f3d518e152219c994ce877758516bca5e118eaed6996192a774fb9fbf0788" +checksum = "4ae48d6208a266e853d946088ed816055e556cc6028c5e8e2b84d9fa5dd7c7f5" dependencies = [ "indexmap", "serde", @@ -1924,9 +1940,9 @@ checksum = "bec47e5bfd1bff0eeaf6d8b485cc1074891a197ab4225d504cb7a1ab88b02bf0" [[package]] name = "winnow" -version = "0.6.15" +version = "0.6.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "557404e450152cd6795bb558bca69e43c585055f4606e3bcae5894fc6dac9ba0" +checksum = "36c1fec1a2bb5866f07c25f68c26e565c4c200aebb96d7e55710c19d3e8ac49b" dependencies = [ "memchr", ] diff --git a/Cargo.toml b/Cargo.toml index e6bb04a..c60a2eb 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -26,10 +26,10 @@ sha2 = "0.10" toml = "0.8" chrono = {version = "0.4", features = ["serde"] } serde = {version = "1.0", features = ["derive"] } -inventory = { git = "https://github.com/Malax/inventory", features = ["sha2"] } rayon = "1.10" hex = "0.4.3" gem_version = "0.3" +libherokubuildpack = { version = "0.24.0", default-features = false, features = ["inventory", "inventory-sha2"] } # File locking (FLOCK) fs2 = "0.4" diff --git a/jruby_executable/Cargo.toml b/jruby_executable/Cargo.toml index 9a2a6cd..9d9aa0c 100644 --- a/jruby_executable/Cargo.toml +++ b/jruby_executable/Cargo.toml @@ -32,7 +32,7 @@ tar = { workspace = true} tempfile = { workspace = true} thiserror = { workspace = true} bullet_stream = { workspace = true } -inventory = { workspace = true } +libherokubuildpack = { workspace = true } chrono = { workspace = true } sha2 = { workspace = true } gem_version = { workspace = true } diff --git a/jruby_executable/src/bin/jruby_build.rs b/jruby_executable/src/bin/jruby_build.rs index b6deb30..b0eb0d1 100644 --- a/jruby_executable/src/bin/jruby_build.rs +++ b/jruby_executable/src/bin/jruby_build.rs @@ -3,8 +3,9 @@ use clap::Parser; use fs_err::PathExt; use gem_version::GemVersion; use indoc::formatdoc; -use inventory::artifact::{Arch, Artifact}; use jruby_executable::jruby_build_properties; +use libherokubuildpack::inventory; +use libherokubuildpack::inventory::artifact::{Arch, Artifact}; use shared::{ append_filename_with, artifact_is_different, artifact_same_url_different_checksum, atomic_inventory_update, download_tar, sha256_from_path, source_dir, tar_dir_to_file, diff --git a/jruby_executable/src/bin/jruby_check.rs b/jruby_executable/src/bin/jruby_check.rs index d276067..0f972f6 100644 --- a/jruby_executable/src/bin/jruby_check.rs +++ b/jruby_executable/src/bin/jruby_check.rs @@ -2,8 +2,8 @@ use bullet_stream::{style, Print}; use clap::Parser; use fun_run::CommandWithName; use indoc::formatdoc; -use inventory::artifact::Arch; use jruby_executable::jruby_build_properties; +use libherokubuildpack::inventory::artifact::Arch; use shared::{source_dir, BaseImage}; use std::error::Error; use std::io::Write; diff --git a/ruby_executable/Cargo.toml b/ruby_executable/Cargo.toml index e7df66b..95a0893 100644 --- a/ruby_executable/Cargo.toml +++ b/ruby_executable/Cargo.toml @@ -17,7 +17,7 @@ tar = { workspace = true} tempfile = { workspace = true} thiserror = { workspace = true} bullet_stream = { workspace = true } -inventory = { workspace = true } +libherokubuildpack = { workspace = true } chrono = { workspace = true } sha2 = { workspace = true } gem_version = { workspace = true } diff --git a/ruby_executable/src/bin/ruby_build.rs b/ruby_executable/src/bin/ruby_build.rs index eedabf0..359e905 100644 --- a/ruby_executable/src/bin/ruby_build.rs +++ b/ruby_executable/src/bin/ruby_build.rs @@ -4,7 +4,10 @@ use fs_err::PathExt; use fun_run::CommandWithName; use gem_version::GemVersion; use indoc::{formatdoc, indoc}; -use inventory::artifact::{Arch, Artifact}; +use libherokubuildpack::inventory::{ + self, + artifact::{Arch, Artifact}, +}; use shared::{ append_filename_with, artifact_is_different, artifact_same_url_different_checksum, atomic_inventory_update, download_tar, output_tar_path, sha256_from_path, source_dir, diff --git a/ruby_executable/src/bin/ruby_check.rs b/ruby_executable/src/bin/ruby_check.rs index 6ad12cf..d93317d 100644 --- a/ruby_executable/src/bin/ruby_check.rs +++ b/ruby_executable/src/bin/ruby_check.rs @@ -2,7 +2,7 @@ use bullet_stream::{style, Print}; use clap::Parser; use fun_run::CommandWithName; use indoc::formatdoc; -use inventory::artifact::Arch; +use libherokubuildpack::inventory::artifact::Arch; use shared::{output_tar_path, source_dir, BaseImage, RubyDownloadVersion}; use std::{error::Error, path::PathBuf, process::Command}; diff --git a/shared/Cargo.toml b/shared/Cargo.toml index 3a624eb..3ed0aa0 100644 --- a/shared/Cargo.toml +++ b/shared/Cargo.toml @@ -25,7 +25,7 @@ sha2 = { workspace = true } chrono = { workspace = true } serde = { workspace = true } toml = { workspace = true } -inventory = { workspace = true } +libherokubuildpack = { workspace = true } fs2 = { workspace = true } rayon = { workspace = true } hex = { workspace = true } diff --git a/shared/src/inventory_help.rs b/shared/src/inventory_help.rs index 9635afa..f20e29a 100644 --- a/shared/src/inventory_help.rs +++ b/shared/src/inventory_help.rs @@ -3,8 +3,8 @@ use crate::{download_tar, Error, TarDownloadPath}; use chrono::{DateTime, Utc}; use fs2::FileExt; use gem_version::GemVersion; -use inventory::checksum::Checksum; -use inventory::inventory::Inventory; +use libherokubuildpack::inventory::checksum::Checksum; +use libherokubuildpack::inventory::{self, Inventory}; use rayon::prelude::*; use serde::{Deserialize, Serialize}; use sha2::Sha256; diff --git a/shared/src/lib.rs b/shared/src/lib.rs index 2a62978..057be07 100644 --- a/shared/src/lib.rs +++ b/shared/src/lib.rs @@ -2,7 +2,7 @@ use bullet_stream::state::SubBullet; use bullet_stream::Print; use fs_err::{File, PathExt}; use fun_run::CommandWithName; -use inventory::artifact::Arch; +use libherokubuildpack::inventory::artifact::Arch; use std::io::{Read, Seek, SeekFrom, Write}; use std::path::{Path, PathBuf}; use std::process::Command;