Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

unpackPhase: fail when tar extract would overwrite files #341678

Draft
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

sedlund
Copy link
Member

@sedlund sedlund commented Sep 13, 2024

Description of changes

In unpackPhase when extracting with tar pass --keep-old-files which will cause tar to fail when it would normally silently overwrite files of the same name but with differing case on case insensitive filesystems (darwin).

This prevents errors when building packages such as #341455 . Which causes packages to have differing hashes.

Things done

  • Built on platform(s)
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • For non-Linux: Is sandboxing enabled in nix.conf? (See Nix manual)
    • sandbox = relaxed
    • sandbox = true
  • Tested, as applicable:
  • Tested compilation of all packages that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage
  • Tested basic functionality of all binary files (usually in ./result/bin/)
  • 24.11 Release Notes (or backporting 23.11 and 24.05 Release notes)
    • (Package updates) Added a release notes entry if the change is major or breaking
    • (Module updates) Added a release notes entry if the change is significant
    • (Module addition) Added a release notes entry if adding a new NixOS module
  • Fits CONTRIBUTING.md.

Add a 👍 reaction to pull requests you find important.

@github-actions github-actions bot added the 6.topic: stdenv Standard environment label Sep 13, 2024
@sedlund sedlund marked this pull request as draft September 13, 2024 22:34
@sedlund
Copy link
Member Author

sedlund commented Sep 14, 2024

@ajs124 @fpletz

this change breaks tzdata as it unpacks two tarballs with the same filenames over eachother.

Do you have input on how to rectify?

tzdata build
tzdata> Running phase: unpackPhase
tzdata> unpacking source archive /nix/store/39z4s69v0rs5q41x1bpwy8qpark4bd7i-tzdata2024a.tar.gz
tzdata> unpacking source archive /nix/store/yl79i12bnsg5qb38v4fbmpg8mk3k2yd3-tzcode2024a.tar.gz
tzdata> tar: calendars: Cannot open: File exists
tzdata> tar: CONTRIBUTING: Cannot open: File exists
tzdata> tar: LICENSE: Cannot open: File exists
tzdata> tar: Makefile: Cannot open: File exists
tzdata> tar: NEWS: Cannot open: File exists
tzdata> tar: README: Cannot open: File exists
tzdata> tar: SECURITY: Cannot open: File exists
tzdata> tar: theory.html: Cannot open: File exists
tzdata> tar: version: Cannot open: File exists
tzdata> tar: Exiting with failure status due to previous errors
tzdata> do not know how to unpack source archive /nix/store/yl79i12bnsg5qb38v4fbmpg8mk3k2yd3-tzcode2024a.tar.gz
error: builder for '/nix/store/f9dllqivwbnz79fxxh9wrqjbzs2yjzmk-tzdata-2024a.drv' failed with exit code 1;
       last 14 log lines:
       > Running phase: unpackPhase
       > unpacking source archive /nix/store/39z4s69v0rs5q41x1bpwy8qpark4bd7i-tzdata2024a.tar.gz
       > unpacking source archive /nix/store/yl79i12bnsg5qb38v4fbmpg8mk3k2yd3-tzcode2024a.tar.gz
       > tar: calendars: Cannot open: File exists
       > tar: CONTRIBUTING: Cannot open: File exists
       > tar: LICENSE: Cannot open: File exists
       > tar: Makefile: Cannot open: File exists
       > tar: NEWS: Cannot open: File exists
       > tar: README: Cannot open: File exists
       > tar: SECURITY: Cannot open: File exists
       > tar: theory.html: Cannot open: File exists
       > tar: version: Cannot open: File exists
       > tar: Exiting with failure status due to previous errors
       > do not know how to unpack source archive /nix/store/yl79i12bnsg5qb38v4fbmpg8mk3k2yd3-tzcode2024a.tar.gz
       For full logs, run 'nix log /nix/store/f9dllqivwbnz79fxxh9wrqjbzs2yjzmk-tzdata-2024a.drv'.

@alyssais
Copy link
Member

Please include explanation for your changes in the commit messages, not just the PR body.

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

Successfully merging this pull request may close these issues.

2 participants