From 1d1edd35ccef02e27af33a8751bccab705f3e6ad Mon Sep 17 00:00:00 2001 From: Nico Hinderling Date: Wed, 22 Oct 2025 14:27:42 -0700 Subject: [PATCH 1/2] chore(preprod): Improve error messaging for zip normalizing step in case of duplicate filename case --- src/utils/build/normalize.rs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/utils/build/normalize.rs b/src/utils/build/normalize.rs index c5327b9872..23e10bad63 100644 --- a/src/utils/build/normalize.rs +++ b/src/utils/build/normalize.rs @@ -7,7 +7,7 @@ use std::os::unix::fs::PermissionsExt as _; use std::path::{Path, PathBuf}; use crate::utils::fs::TempFile; -use anyhow::Result; +use anyhow::{Context as _, Result}; use itertools::Itertools as _; use log::debug; use symbolic::common::ByteView; @@ -61,10 +61,12 @@ fn add_entries_to_zip( let target_str = target.to_string_lossy(); // Create a symlink entry in the zip - zip.add_symlink(zip_path, &target_str, options)?; + zip.add_symlink(&zip_path, &target_str, options) + .with_context(|| format!("Failed to add symlink '{}' to zip archive", zip_path))?; } else { // Handle regular files - zip.start_file(zip_path, options)?; + zip.start_file(&zip_path, options) + .with_context(|| format!("Failed to add file '{}' to zip archive", zip_path))?; let file_byteview = ByteView::open(&entry_path)?; zip.write_all(file_byteview.as_slice())?; } From b18718ff28d091752e1852a741a4e69e9f142fbd Mon Sep 17 00:00:00 2001 From: Nelson Osacky Date: Thu, 23 Oct 2025 08:47:29 +0200 Subject: [PATCH 2/2] fix(build): Use proper string slice references in zip operations MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Changed `&zip_path` to `zip_path.as_str()` when calling `add_symlink` and `start_file` methods. Passing `&String` instead of `&str` is not idiomatic and could cause trait bound issues with `Into`. Also fixed clippy warnings for uninlined format args. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- src/utils/build/normalize.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/utils/build/normalize.rs b/src/utils/build/normalize.rs index 23e10bad63..1ef40fc061 100644 --- a/src/utils/build/normalize.rs +++ b/src/utils/build/normalize.rs @@ -61,12 +61,12 @@ fn add_entries_to_zip( let target_str = target.to_string_lossy(); // Create a symlink entry in the zip - zip.add_symlink(&zip_path, &target_str, options) - .with_context(|| format!("Failed to add symlink '{}' to zip archive", zip_path))?; + zip.add_symlink(zip_path.as_str(), &target_str, options) + .with_context(|| format!("Failed to add symlink '{zip_path}' to zip archive"))?; } else { // Handle regular files - zip.start_file(&zip_path, options) - .with_context(|| format!("Failed to add file '{}' to zip archive", zip_path))?; + zip.start_file(zip_path.as_str(), options) + .with_context(|| format!("Failed to add file '{zip_path}' to zip archive"))?; let file_byteview = ByteView::open(&entry_path)?; zip.write_all(file_byteview.as_slice())?; }