Skip to content

Commit

Permalink
Add explanation Markdown for the 'missing-patch-comment' check
Browse files Browse the repository at this point in the history
  • Loading branch information
rmcgibbo committed Jan 31, 2021
1 parent 8f87976 commit eaf4b9e
Showing 1 changed file with 37 additions and 0 deletions.
37 changes: 37 additions & 0 deletions explanations/missing-patch-comment.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
Each patch in nixpkgs applied to the upstream source should be documented. Out-of-tree patches, fetched using `fetchpatch`, are preferable.

In each patch comment, please explain the purpose of the patch and link to the relevant upstream issue if possible. If the patch has been merged upstream but is not yet part of the released version, please note the version number or date in the comment such that a future maintainer updating the nix expression will know whether the patch has been incorporated upstream and can thus be removed from nixpkgs.

Furthermore, please use a _stable_ URL for the patch. Rather than, for example, linking to a github pull request of the form `https://github.com/owner/repo/pull/pr_number.patch` which would change every time a commit is addded or the PR is force-pushed, link to a specific commit-sha.patch of the form `https://github.com/owner/repo/commit/sha.patch`.

Here are two good examples of patch comments:

```
mkDerivation {
...
patches = [
# Fetch a patch to ensure Rstudio compiles against R
# 4.0.0, should be removed next 1.2.X Rstudio update
# or possibly 1.3.X
(fetchpatch {
url = "https://github.com/rstudio/rstudio/commit/3fb2397c2f208bb8ace0bbaf269481ccb96b5b20.patch";
sha256 = "0qpgjy6aash0fc0xbns42cwpj3nsw49nkbzwyq8az01xwg81g0f3";
})
];
};
mkDerivation {
...
patches = [
# allow building with bison 3.7
# PR at https://github.com/GoldenCheetah/GoldenCheetah/pull/3590
(fetchpatch {
url = "https://github.com/GoldenCheetah/GoldenCheetah/commit/e1f42f8b3340eb4695ad73be764332e75b7bce90.patch";
sha256 = "1h0y9vfji5jngqcpzxna5nnawxs77i1lrj44w8a72j0ah0sznivb";
})
];
};
```

0 comments on commit eaf4b9e

Please sign in to comment.