-
Notifications
You must be signed in to change notification settings - Fork 15
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
Add missing-patch-comment check using rust and rnix #16
Conversation
e936d37
to
8df319b
Compare
I've pushed a bunch of improvements + fixes in response to your review in 9313e78 |
In dea035c, I've switched to naersk for building the rust package, which required updating the flake lock file. I don't have much of an opinion one way or the other, so I'm happy to leave that in or revert it. |
f408c1b
to
2811feb
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The code looks good, I left one last idea for a small improvement :)
d2b27fc
to
b7ba8c6
Compare
|
||
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`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agreed. But maybe this should be a separate check. But looks good enough and we can extract it later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 Separating it out into another check at a later time sounds good to me.
b7ba8c6
to
eaf4b9e
Compare
eaf4b9e
to
8fb211a
Compare
(I've rebased on top of master and squashed this into 1 commit.) |
8fb211a
to
1443f94
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks very nice, just few last comments.
Pushed a new commit based on your comments. |
58a1d66
to
0864566
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tweaked style a bit, added a forgotten args.show_trace
and now it is good to go.
Thanks for the excellent work.
@@ -15,4 +15,4 @@ jobs: | |||
uses: cachix/install-nix-action@v12 | |||
|
|||
- name: Run tests | |||
run: nix-shell --run ./run-tests.py | |||
run: nix run -c ./run-tests.py |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just to save myself confusion in the future, Nix 2.4 will likely use nix shell
command for this feature (this is how it is named at current nixUnstable).
@@ -37,7 +61,8 @@ | |||
devShell = pkgs.mkShell { | |||
buildInputs = with pkgs; [ | |||
python3 | |||
nix |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed Nix here since nixpkgs-hammer
will already have it in PATH
when ran from the package (as tests do), and for development one will have Nix anyway. And stable Nix here would make updating flake annoying.
Awesome! |
Example:
Here's the relevant line of code: https://github.com/NixOS/nixpkgs/blob/master/pkgs/development/python-modules/credstash/default.nix#L13
Notes:
(a) This is a big change because it requires rust and rnix. There might be better ways to do this with other tools.
(b) The check, as implemented, is probably too strict. It looks for each element in the
patches = [...]
list, and demands to find a comment immediately prior to the element. So, for example, a comment like this one in imageio-ffmpeg is not currently detected. But this could be changed.