Skip to content

patch-shebangs: fix binary data corrupt after patching#423137

Merged
K900 merged 1 commit intoNixOS:stagingfrom
DavHau:patch-shebangs
Jul 7, 2025
Merged

patch-shebangs: fix binary data corrupt after patching#423137
K900 merged 1 commit intoNixOS:stagingfrom
DavHau:patch-shebangs

Conversation

@DavHau
Copy link
Member

@DavHau DavHau commented Jul 7, 2025

This removes the recently introduced shell based implementation of sponge which wasn't capable of managing binary input.

Now, a tmpFile under $TMPDIR is created manually and later deleted

see: #414448 (comment)

To run the tests:

nix-build -A tests.hooks.default-stdenv-hooks.patch-shebangs

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/)
  • Nixpkgs 25.11 Release Notes (or backporting 25.05 Nixpkgs Release notes)
    • (Package updates) Added a release notes entry if the change is major or breaking
  • NixOS 25.11 Release Notes (or backporting 25.05 NixOS Release notes)
    • (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, pkgs/README.md, maintainers/README.md and other contributing documentation in corresponding paths.

Add a 👍 reaction to pull requests you find important.

This removes the recently introduced shell based implementation of `sponge` which wasn't capable of managing binary input.

Now, a tmpFile under $TMPDIR is created manually and later deleted

see: NixOS#414448 (comment)
@nix-owners nix-owners bot requested a review from Ericson2314 July 7, 2025 08:14
@nixpkgs-ci nixpkgs-ci bot added 10.rebuild-linux: 501+ This PR causes many rebuilds on Linux and should normally target the staging branches. 10.rebuild-darwin: 501+ This PR causes many rebuilds on Darwin and should normally target the staging branches. 10.rebuild-linux-stdenv This PR causes stdenv to rebuild on Linux and must target a staging branch. 10.rebuild-darwin-stdenv This PR causes stdenv to rebuild on Darwin and must target a staging branch. 10.rebuild-darwin: 5001+ This PR causes many rebuilds on Darwin and must target the staging branches. 10.rebuild-linux: 5001+ This PR causes many rebuilds on Linux and must target the staging branches. labels Jul 7, 2025
Copy link
Member

@Mic92 Mic92 left a comment

Choose a reason for hiding this comment

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

Passes my eye ball test. Haven't tried to build anything with it.

@nixpkgs-ci nixpkgs-ci bot added the 12.approvals: 1 This PR was reviewed and approved by one person. label Jul 7, 2025
@DavHau
Copy link
Member Author

DavHau commented Jul 7, 2025

I built cmake on x86_64 with this successfully

@K900
Copy link
Contributor

K900 commented Jul 7, 2025

Built Akkoma with 41d70b1 reverted and this applied, it builds and runs.

@K900 K900 merged commit 6feae34 into NixOS:staging Jul 7, 2025
28 of 32 checks passed
@DavHau
Copy link
Member Author

DavHau commented Jul 8, 2025

My infra built successfully with this.

@adamcstephens
Copy link
Contributor

Thanks for fixing this.

@xanderio xanderio mentioned this pull request Jul 16, 2025
13 tasks
@adamcstephens adamcstephens mentioned this pull request Jul 17, 2025
3 tasks
wi11-holdsworth added a commit to wi11-holdsworth/dots that referenced this pull request Jul 22, 2025
@scvalex scvalex mentioned this pull request Jul 24, 2025
3 tasks
@raboof raboof mentioned this pull request Jul 25, 2025
3 tasks
terlar added a commit to terlar/nixpkgs that referenced this pull request Jul 30, 2025
This was discovered with issues related to pnpm that hard links on some
systems, see NixOS#426636.

This is a regression introduced by NixOS#414448 and NixOS#423137.

When `sed -i` is used on a file with hard links, then the file is seperated and only the file named in the command is changed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

10.rebuild-darwin: 501+ This PR causes many rebuilds on Darwin and should normally target the staging branches. 10.rebuild-darwin: 5001+ This PR causes many rebuilds on Darwin and must target the staging branches. 10.rebuild-darwin-stdenv This PR causes stdenv to rebuild on Darwin and must target a staging branch. 10.rebuild-linux: 501+ This PR causes many rebuilds on Linux and should normally target the staging branches. 10.rebuild-linux: 5001+ This PR causes many rebuilds on Linux and must target the staging branches. 10.rebuild-linux-stdenv This PR causes stdenv to rebuild on Linux and must target a staging branch. 12.approvals: 1 This PR was reviewed and approved by one person.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants