Improve handling of tarballs that don't consist of a single top-level directory#11195
Improve handling of tarballs that don't consist of a single top-level directory#11195edolstra merged 9 commits intoNixOS:masterfrom
Conversation
Fixes NixOS#4785 (top-level directories are no longer merged into one). Fixes NixOS#10983 (top-level non-directories are no longer discarded).
I think this should also be the behavior for single non-executable files. Tarballs are expected to behave like directories, so we should probably always return a directory, even if it only has a single file. |
Yeah, it looks like even Nix 2.3 returned an empty directory so I'll change it to dereference directories only. |
Since this yielded an empty directory as far back as Nix 2.3, we don't really need special handling for executables vs non-executables.
Co-authored-by: Robert Hensing <roberth@users.noreply.github.com>
|
This pull request has been mentioned on NixOS Discourse. There might be relevant details there: https://discourse.nixos.org/t/2024-07-29-nix-team-meeting-minutes-165/49970/1 |
|
This pull request has been mentioned on NixOS Discourse. There might be relevant details there: https://discourse.nixos.org/t/tarball-contains-an-unexpected-number-of-top-level-files/73720/1 |
Motivation
When unpacking tarballs, we now only strip the top-level path component if the tarball consists of a single directory or a single non-executable file.
Fixes #4785: top-level directories are no longer merged into one.
Fixes #10983: top-level non-directories are no longer discarded.
Closes #9053.
Context
Priorities and Process
Add 👍 to pull requests you find important.
The Nix maintainer team uses a GitHub project board to schedule and track reviews.