Skip to content

Revert "change needed to preserve permissions in astral-tokio-tar"#1261

Merged
jhheider merged 1 commit intomainfrom
return-to-tar-rs
Mar 28, 2026
Merged

Revert "change needed to preserve permissions in astral-tokio-tar"#1261
jhheider merged 1 commit intomainfrom
return-to-tar-rs

Conversation

@jhheider
Copy link
Copy Markdown
Contributor

astral-tokio-tar panics on some of our existing BSD tar archives, unfortunately.

Copilot AI review requested due to automatic review settings March 28, 2026 00:39
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Reverts the tar extraction implementation to avoid astral-tokio-tar panicking on some existing BSD tar archives by switching back to tokio-tar.

Changes:

  • Replace tokio_tar::ArchiveBuilder usage with tokio_tar::Archive in install and pantry sync extraction paths.
  • Swap astral-tokio-tar dependency for tokio-tar in crates/lib.
  • Update Cargo.lock to reflect the dependency change and resulting resolver changes.

Reviewed changes

Copilot reviewed 3 out of 4 changed files in this pull request and generated 2 comments.

File Description
crates/lib/src/sync.rs Switch pantry tar extraction from ArchiveBuilder to Archive.
crates/lib/src/install.rs Switch package tar extraction from ArchiveBuilder to Archive.
crates/lib/Cargo.toml Replace astral-tokio-tar with tokio-tar = 0.3.1.
Cargo.lock Lockfile changes reflecting the tar crate swap and broader dependency graph changes.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

let mut archive = ArchiveBuilder::new(decoder)
.set_preserve_permissions(true)
.build();
let mut archive = Archive::new(decoder);
Copy link

Copilot AI Mar 28, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This extraction path no longer explicitly enables permission preservation (previously set_preserve_permissions(true)). If tokio-tar doesn’t preserve modes by default, installed package files may lose executable bits (eg bin/*). Consider restoring equivalent configuration (if supported by tokio-tar) or adding an explicit post-extract permission fix/regression check so installs remain runnable.

Suggested change
let mut archive = Archive::new(decoder);
let mut archive = Archive::new(decoder);
archive.set_preserve_permissions(true);

Copilot uses AI. Check for mistakes.
let mut archive = ArchiveBuilder::new(decoder)
.set_preserve_permissions(true)
.build();
let mut archive = Archive::new(decoder);
Copy link

Copilot AI Mar 28, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This extraction no longer explicitly preserves permissions (previously set_preserve_permissions(true)). If tokio-tar’s default behavior differs, the pantry contents on disk could end up with different modes than expected. Consider restoring an explicit preserve-permissions setting (if available) or otherwise ensuring the extracted file modes remain unchanged.

Suggested change
let mut archive = Archive::new(decoder);
let mut archive = Archive::new(decoder);
archive.set_preserve_permissions(true);

Copilot uses AI. Check for mistakes.
@jhheider jhheider merged commit 497ac12 into main Mar 28, 2026
21 of 22 checks passed
@jhheider jhheider deleted the return-to-tar-rs branch March 28, 2026 00:49
@coveralls
Copy link
Copy Markdown

Coverage Status

coverage: 90.21% (-0.02%) from 90.234%
when pulling c6455c5 on return-to-tar-rs
into 525dd34 on main.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants