From 9545b350a42bd1d85a4b59732cb7139eefc9426a Mon Sep 17 00:00:00 2001 From: Jonathan Strong Date: Tue, 7 Nov 2023 16:28:55 -0500 Subject: [PATCH] additional logging --- src/publish.rs | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/src/publish.rs b/src/publish.rs index 9a536fd..be9d9b6 100644 --- a/src/publish.rs +++ b/src/publish.rs @@ -734,6 +734,7 @@ fn parse_manifests( // .into_iter() .map(|(crate_name, versions)| -> Result<(String, Vec), Error> { let begin = Instant::now(); + debug!(%crate_name, "parsing manifests"); let mut version_metas = Vec::new(); for index_meta in versions { let version = index_meta.vers.clone(); @@ -765,14 +766,22 @@ fn parse_manifests( let mut readme: Option = None; if let Some(readme_path) = manifest.package.readme.as_ref() { let decoder = flate2::read::GzDecoder::new(&dot_crate_bytes[..]); - if let Some(readme_content) = extract_readme_from_tar(decoder, readme_path)? { + if let Some(readme_content) = extract_readme_from_tar(decoder, readme_path).map_err(|err| { + error!(%crate_name, vers = %index_meta.vers, ?err, "failed to extract readme"); + err + })? { trace!(length = readme_content.len(), "extracted readme file content from .crate targz archive"); readme = Some(readme_content); } } let tmp = TempDir::new()?; let decoder = flate2::read::GzDecoder::new(&dot_crate_bytes[..]); - tar::Archive::new(decoder).unpack(tmp.path())?; + tar::Archive::new(decoder).unpack(tmp.path()) + .map_err(|err| { + error!(%crate_name, vers = %index_meta.vers, ?err, "failed to unpack to temp dir"); + err + })?; + trace!(tmpdir = ?tmp.path(), "unpacked .crate archive to temp dir"); let target_dir = tmp.path().join("target"); std::fs::create_dir(&target_dir)?;