-
-
Notifications
You must be signed in to change notification settings - Fork 15.3k
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 a callHackage variant that doesn't require all-cabal-hashes #52848
Conversation
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.
This looks good to me.
I've wanted a function like this before. It'll be great to have it in nixpkgs.
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.
LGTM other than @puffnfresh's comment.
I responded to @puffnfresh above. Also, regarding the name...I'm definitely not stuck on this name. I'm not crazy about |
I've tested this and verified that it works with a real external package. Should be ready to merge now. |
This should probably have some kind of support for revisions, like a revision number arg and a cabal file sha arg. |
It'd also be really cool to have some way to use this from |
@ElvishJerricco Agreed, although that requires a bit more work because you have to download the tarball and replace the cabal file inside it with the one for the revision. In practice, the lack of revision support hasn't bothered me too much yet because revisions can only make changes to metadata and that can usually be accomplished with |
Motivation for this change
Because callHackage uses all-cabal-hashes to avoid requiring the user to specify a hash, it does not work for any package versions that have been uploaded after the version of all-cabal-hashes that you happen to have. In my experience this means that probably greater than half the time
callHackage
doesn't work for me, and I have to fall back tofetchFromGitHub
. This is a pretty poor user experience and is also less reliable because github packages can be deleted, but hackage releases cannot.This function works for any package that has been released on hackage. I have been using it recently in some of my production projects and it has been working fine. It would be really nice to have it available in nixpkgs.
Things done
sandbox
innix.conf
on non-NixOS)nix-shell -p nox --run "nox-review wip"
./result/bin/
)nix path-info -S
before and after)