Skip to content

Discourage overriding the patch phase #280

Description

@eljamm

Overriding patchPhase is considered an anti-pattern because in doing so we'd be silently skipping patches.

In total, there are currently 224 1 overridden phases with at least one package (fbida) that has its patches shadowed 2 :

`fbida` with `patchPhase` overridden

Running phase: patchPhase
patching script interpreter paths in scripts/fallback.pl
scripts/fallback.pl: interpreter directive changed from "#!/usr/bin/perl -w" to "/nix/store/cc9zsahxyx5my7bqid4dzkljw2dd9ygm-perl-5.42.0/bin/perl -w"
# ...

`fbida` with `postPatch`

Running phase: patchPhase
applying patch /nix/store/4xms3k103nid6ks4gzn5fsqmqgd8236q-function-parameters.patch
patching file jpeg/62/jpeglib.h
patching script interpreter paths in scripts/fallback.pl
scripts/fallback.pl: interpreter directive changed from "#!/usr/bin/perl -w" to "/nix/store/cc9zsahxyx5my7bqid4dzkljw2dd9ygm-perl-5.42.0/bin/perl -w"
# ...

Footnotes

  1. rg -l -e "patchPhase = ''" -e 'patchPhase = "' pkgs | wc -l ↩

  2. rg -l "patches = \[" $(rg -l -e "patchPhase = ''" -e 'patchPhase = "' pkgs) ↩

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions