8000 build(deps): bump the cargo group across 1 directory with 4 updates by dependabot[bot] · Pull Request #124 · gominimal/minimal · GitHub
[go: up one dir, main page]

Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
109 changes: 74 additions & 35 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,8 @@ indoc = "^2.0"
jaq-all = "0.1.0-beta"
lzma-rs = "0.3"
nickel-lang-core = { version = "0.17.0", default-features = false, features = ["format"] }
object = { version = "0.38", default-features = false, features = ["archive", "elf", "read_core", "std"] }
oci-spec = "0.8.3"
object = { version = "0.39", default-features = false, features = ["archive", "elf", "read_core", "std"] }
oci-spec = "0.9.0"
path-absolutize = "^3.1"
rand = "0.10"
rayon = "1.11"
Expand All @@ -68,13 +68,13 @@ prost-build = "0.14"
prost-types = "0.14"
resolv-conf = "0.7"
serde_json = { version = "1.0" }
sha2 = "0.10"
sha2 = "0.11"
shlex = "1.3"
size = "0.5"
smallvec = {version = "1.15", features = ["serde"]}
tar = "0.4"
tempfile = "3.23"
tokio = { version = "1.48", features = ["full"] }
tokio = { version = "1.52", features = ["full"] }
tokio-stream = "0.1"
tokio-util = "0.7"
toml = "1.1"
Expand Down
8000 4 changes: 2 additions & 2 deletions crates/common/src/archive.rs
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ pub fn compress_dir<P: AsRef<Path>>(
match_globs: &Option<globset::GlobSet>,
) -> Result<(std::fs::File, [u8; 32]), std::io::Error> {
let mut tar_file = tempfile::tempfile()?;
let mut hasher = Sha256::new();
let mut hasher = super::HashWriter(Sha256::new());
{
let mut w = super::Tee::new(&mut tar_file, &mut hasher);
let encoder = zstd::stream::Encoder::new(&mut w, override_level.unwrap_or(ZSTD_LEVEL))?;
Expand All @@ -80,7 +80,7 @@ pub fn compress_dir<P: AsRef<Path>>(
use std::io::Seek;
tar_file.seek(std::io::SeekFrom::Start(0))?;

Ok((tar_file, hasher.finalize().into()))
Ok((tar_file, hasher.0.finalize().into()))
}

/// Recursively adds the specified directory to the given tarball.
Expand Down
8 changes: 4 additions & 4 deletions crates/common/src/file_cache.rs
Original file line number Diff line number Diff line change
Expand Up @@ -112,10 +112,10 @@ impl FileCache {
if fs::exists(&cached_path)? {
let computed_hash = {
let mut f = fs::File::open(&cached_path)?;
let mut hasher = Sha256::new();
let mut hasher = super::HashWriter(Sha256::new());
std::io::copy(&mut f, &mut hasher)?;

hasher.finalize()
hasher.0.finalize()
};

if hex::encode(computed_hash) == sha256 {
Expand Down Expand Up @@ -143,7 +143,7 @@ impl FileCache {
{
let cached_path = self.sha_dir(sha256).map_err(Either::Left)?.join(filename);

let mut hasher = Sha256::new();
let mut hasher = super::HashWriter(Sha256::new());
{
let mut f = fs::File::create(&cached_path).map_err(|e| Either::Left(e.into()))?;
let mut w = Tee::new(&mut f, &mut hasher);
Expand All @@ -169,7 +169,7 @@ impl FileCache {
f.sync_all().map_err(|e| Either::Left(e.into()))?;
}

let computed_hash = hasher.finalize();
let computed_hash = hasher.0.finalize();
let computed_hex = hex::encode(computed_hash);

if computed_hex != sha256 {
Expand Down
15 changes: 15 additions & 0 deletions crates/common/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,21 @@ impl<W1: Write, W2: Write> Write for Tee<W1, W2> {
}
}

/// Wrapper that implements [Write] for types implementing [sha2::Digest],
/// since `digest` 0.11 no longer provides a blanket `std::io::Write` impl.
pub struct HashWriter<D: sha2::Digest>(pub D);

impl<D: sha2::Digest> Write for HashWriter<D> {
fn write(&mut self, buf: &[u8]) -> std::io::Result<usize> {
sha2::Digest::update(&mut self.0, buf);
Ok(buf.len())
}

fn flush(&mut self) -> std::io::Result<()> {
Ok(())
}
}

/// The error produced by calls to [hardlink_dir_contents].
#[derive(Debug)]
pub enum HardlinkError {
Expand Down
1 change: 1 addition & 0 deletions crates/op/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ smallvec.workspace = true
[dependencies]
anyhow.workspace = true
flate2.workspace = true
hex.workspace = true
futures.workspace = true
globset.workspace = true
walkdir.workspace = true
Expand Down
Loading
0