-
-
Notifications
You must be signed in to change notification settings - Fork 14.1k
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 maintainer scripts for haskell package generation #86699
Conversation
97a8fe4
to
8dd8003
Compare
@hyperfekt Thanks for working on this. There are frequently contributors that ask if there is an easy way to regenerate the hackage package set, normally for testing changes they have made. Here is the most recent: #86659 (comment) I think having something like this in nixpkgs would be nice, mostly for the people like the above link. I have some specific questions about this PR though, so I'll ask those questions inline. |
2da18dc
to
fc573e8
Compare
8dd8003
to
238e2f9
Compare
238e2f9
to
a30562d
Compare
The |
eb77ebf
to
08d5a1e
Compare
33a27ef
to
2a60d72
Compare
ee17816
to
1c8851e
Compare
Changed base to |
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.
I've discussed this PR in in yesterday's #haskell4nix live stream in great detail starting at https://www.twitch.tv/videos/635614107?t=02h15m14s.
Let me put it this way: It has been shown in the past that, while certainly entirely possible, the hurdle of generating the Haskell package set anew with the current process is one that many do not clear, and there is no good reason for it being remotely this burdensome, requiring every user to replicate a frankly (for Nix standards) arcane setup; when with the power of Nix it can be as simple as executing a single command. I also recall hearing about people who have gained the understanding of how to do it still finding it too troublesome to perform. I have chosen to include these scripts in nixpkgs because
Your declaration of not maintaining them I take absolutely no issue with (I'm happy to do that), and your not wanting to use them I have accepted. I don't think either of these are reasons not to include them. Again, they are not for you. I do however need your minimal support in pinning the versions used to generate I'm not sure I see the harm in adding this sort of pinning to the scripts you use, so maybe you could enlighten me about the problems it brings instead of outright rejecting it without giving a reason. PS: I very much appreciate your intent to make the package generation more efficient through the direct use of Cabal's tarballs. But until that is implemented I think these scripts are very useful, and even when implemented we would want (slimmer, simpler) scripts as well as pinning in order to not increase the friction to more than necessary. |
@peti I have thought about this a bit more. There is one reason, why we maybe want more reproducibility than we have right now.
But now if everyone where to generate the
So I think the case can be made, that pinning the hackage version to generate So I think the over all goal should be: a) Make the regeneration of the nix file easy and b) make the regeneration with the same hackage version easy. Now, I have said nothing about what the best way to achieve that would be. But this PR supplies a solution that works right now. Another approach would be to have hackage2nix print the hackage snapshot to the top of the nix file (I know it‘s written in the commit message but that is harder to extract for tooling) and then have some tool (probably in the hackage2nix repo) that can pull that exact hackage version, be it a git-repo or a tarball … |
Looking at |
Just to avoid misunderstandings: we have reproducibility. |
I have tried to verify your claim. I remain unconvinced as of now: It is likely that the issue is my mistake. But I needed 30 minutes to get to that point. I think the Haskell tooling in nixpkgs is great. I am really amazed by it. But I think it can be made easier to use. |
I want to mention a script I hacked together which does at least some of this. @peti merged it into the cabal2nix repo. |
what's blocking this ? as @hyperfekt mentioned, some haskell fixes are probably never contributed upstream because it's too demanding (I know I keep my overrides local for instance). Having these simple scripts would make it easier. Can't we pin the versions ? we don't have to run the latest of everything at all times. |
@teto The issue here is that this PR, if I understand it correctly, introduces a new workflow to update the hackage packages in nixpkgs. While there is some agreement that the current situation is not optimal. This PR would need more discussion and changes to the infrastructure than just merging it. If we would just merge it, that would be very confusing because the regenerate script will not work unless something or someone continually bumps the pinned hash. Just for the meantime: Regenerating the haskell-packages.nix based on the last hackage snapshot used in nixpkgs is a matter of 60 seconds:
|
Sorry, I answered your first question. Regarding the other points:
|
contrast #86699 (comment) with running: |
Um, have you read any of the previous discussion? This is pretty much the main point of contention. |
I think the main problem here is, that there is no way to make a change to a Haskell package in nixpkgs without the "extra-knowledge" you are talking about. That being said I personally am not opposed to having an update script in nixpkgs. Maybe a very small wrapper script that just pulls cabal2nix and refers to a regenerate script in there might be a good compromise @peti ? |
This pull request has been mentioned on NixOS Discourse. There might be relevant details there: |
Thanks to everyone who has worked on improving the hackage tooling. I just had the following experience: I wanted to use pandoc-crossref from master. I noticed it was broken, so I wanted to see why it was broken and try to fix it. I noticed that I was able to build and use pandoc-crossref just fine with NIXPKGS_ALLOW_BROKEN=1, so I wanted to remove the broken flag. @peti as the main person working on this, what do you think I should do in this case: Should I regenerate the package set with the versions mentioned in the last update commit? Or should I just commit the hackage2nix configuration and wait for it to be picked up on an automated update. What would I have to be careful about when committing changes to the package set?
I don't fully agree. I think I was able to get an idea about how all the tools and repositories work together quite quickly, however it's still more work to regenerate the package set in practise. For example, if I had found the
=> These things would have improved the experience by a lot:
|
Hey everyone! @cdepillabout and @sternenseemann. I had a fresh look at this and I concluded, that this PR does exactly what we want. Now with a break in the workflow I recommend we merge it asap and switch to updating the hackage-package-set using these scripts. What @hyperfekt has done here seems exactly right. Thank you for your work! Since you have probably long given up on this I will take over and drive this home, if you don‘t mind. I think having a cabal2nix-latest cached by hydra is advantageous. If you don‘t object I will clean up the merge conflicts and test this out. (I want to make sure this doesn‘t break callCabal2nix, which it could since it’s touching the hashes.) The only thing we could bikeshed about are filenames and locations. I kinda hope that we will add a few more scripts in the future so I am a bit weary of having them all plain maintainers/scripts |
One thing to note: We probably also want to migrate the update-stackage script into nixpkgs. |
Subsumed by #121391. |
Motivation for this change
Currently, the Nix file responsible for the Haskell package set is created from mutable state by a script run by @peti that makes commits to nixpkgs, making it hard to reproduce. This means that changes in the package set cannot easily be evaluated by users other than them, and the script that executes a regular task which needs to be applied to nixpkgs is hard to use and maintained outside of it.
Obviates #62105.
Things done
sandbox
innix.conf
on non-NixOS linux)nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
./result/bin/
)nix path-info -S
before and after)