Repository navigation
fix(file): support pax sparse tar extraction - #10821
Conversation
📝 WalkthroughWalkthroughRefactors untar's GNU sparse-file handling in ChangesSparse Tar Extraction Fallback
Estimated code review effort: 3 (Moderate) | ~25 minutes Sequence Diagram(s)sequenceDiagram
participant Untar
participant TarEntry
participant Filesystem
participant SystemTar
Untar->>TarEntry: tar_entry_is_sparse check
TarEntry-->>Untar: sparse detected
Untar->>Filesystem: unpack_in attempt
Filesystem-->>Untar: unpack complete
Untar->>Filesystem: path_has_gnu_sparse_artifact scan
Filesystem-->>Untar: GNUSparseFile.* found
Untar->>Filesystem: clear and recreate destination
Untar->>SystemTar: extract_with_system_tar
SystemTar-->>Filesystem: extracted files
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Greptile SummaryFixes sparse tar extraction failures by detecting PAX
Confidence Score: 5/5Safe to merge — the change is narrowly scoped to sparse-tar detection and the fallback path, with no regressions for ordinary archives. The two detection helpers are logically independent and each individually sufficient to catch the failing case. Cleanup before system-tar retry is correctly placed. For normal (non-sparse) archives the only new work per entry is a header-type check and a quick None return from pax_extensions(), so the hot path overhead is negligible. Previous thread concerns about a post-loop WalkDir on every extraction no longer apply — that scan has been replaced entirely by the in-loop path component check. Tests are well-guarded with early-return sentinels for environments that can't produce the required archive format. No files require special attention. Important Files Changed
Reviews (2): Last reviewed commit: "fix(file): support pax sparse tar extrac..." | Re-trigger Greptile |
9547509 to
d4adac1
Compare
Summary
GNU.sparse.*tar metadata before extracting with the Rusttarcratetarfor sparse archives while preserving the existingpreserve_mtimebehaviorGNUSparseFile.*artifacts whentarcrate extraction partially failsDiscussion
Root cause
tarcrate 0.4.46 does not fully handle PAX GNU sparse archives like thesmolvmrelease tarballs. mise already had a systemtarfallback for sparse archives, but it only detected GNU sparse entry types anddest/GNUSparseFile.0, so PAXGNU.sparse.*entries could fail before reaching the fallback path.Validation
cargo +stable fmt --checkcargo +stable test sparse -- --nocapture, but the local environment spent a long time compiling dependencies and appeared to hang, so full test/clippy validation is left to CIThis PR description was generated by an AI coding assistant.
Summary by CodeRabbit