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

treewide: patchPhase -> postPatch #182092

Draft
wants to merge 1 commit into
base: staging
Choose a base branch
from

Conversation

smancill
Copy link
Contributor

@smancill smancill commented Jul 19, 2022

Description of changes

This is the first of three trewide PRs I've been working on to reduce unnecessary overriding of phases.

I don't see a good reason for a derivation to override patchPhase unless they are applying external patches in a custom way.

Use postPatch like most of other derivations applying changes to the sources. All changes were done manually to check the content of the phase before moving it to a hook.

Before this patch:

$ rg 'postPatch =' pkgs | wc -l
    3658
$ rg 'patchPhase =' pkgs | wc -l
     357

After this patch:

$ rg 'postPatch =' pkgs | wc -l
    3974
$ rg 'patchPhase =' pkgs | wc -l
      49
Things done
  • Built on platform(s)
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • For non-Linux: Is sandbox = true set in nix.conf? (See Nix manual)
  • 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/)
  • 22.11 Release Notes (or backporting 22.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
    • (Release notes changes) Ran nixos/doc/manual/md-to-db.sh to update generated release notes
  • Fits CONTRIBUTING.md.

@smancill
Copy link
Contributor Author

Ugh, I broke something:

       at /Users/smancill/.cache/nixpkgs-review/rev-6ad63c1aa2a0514af04bf87f94dd0331bc82b608/nixpkgs/pkgs/development/libraries/hspell/dicts.nix:4:44:

            3| let
            4|   dict = variant: a: stdenv.mkDerivation ({
             |                                            ^
            5|     inherit (hspell) version src patchPhase nativeBuildInputs;

       … while evaluating the attribute 'patchPhase' of the derivation 'aspell-dict-he-1.1'

I'll mark it as draft while I fix it.

@smancill smancill marked this pull request as draft July 19, 2022 13:29
@smancill smancill force-pushed the treewide-post-patch branch from d542490 to a931b6b Compare July 19, 2022 13:53
@smancill smancill marked this pull request as ready for review July 19, 2022 13:53
@smancill smancill marked this pull request as draft May 22, 2023 02:57
@wegank wegank added 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md 2.status: merge conflict This PR has merge conflicts with the target branch labels Mar 19, 2024
@stale stale bot removed the 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md label Mar 20, 2024
@wegank wegank added the 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md label Jul 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
2.status: merge conflict This PR has merge conflicts with the target branch 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md 8.has: clean-up 10.rebuild-darwin: 501+ 10.rebuild-darwin: 2501-5000 10.rebuild-linux: 501+ 10.rebuild-linux: 5001+ 10.rebuild-linux-stdenv This PR causes stdenv to rebuild
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants