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
Extend nix-prefetch-git to support passing tree hashes as "rev" #104714
Conversation
@jonringer it looks like you were the last person to commit to this file, I hope you don't mind being tagged. Do you by any chance know who might be the best person to provide feedback on this? Interested in getting this change merged. |
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.
Code-wise LGTM.
Please squash commits and rename to |
babf18f
to
81a58ae
Compare
Done! Also rebased on master |
81a58ae
to
6779902
Compare
Just checking in, is this ready to be merged? |
Since NixOS#104714 using a tag as the `rev` parameter to `fetchgit` is no longer reliable, so spell out the rev. Fixes NixOS#114439
FYI: This caused a regression that isn't the fault of this PR but it now becomes apparent that (Just to link that issue here in case anyone else runs into that and finds this PR.) |
Thanks @primeos. For completeness, there have been a couple other issues mentioning regressions: I'm not sure what the best fix is. We could revert this if it's causing major problems. FWIW, we could restore the old behavior by handling the |
Motivation for this change
I'm working on Julia packages in Nix. Julia's package manager organizes its dependencies a
Manifest.toml
file, which is almost perfect to use with Nix because it contains Git hashes we can pull out and pass tofetchgit
. However, Julia uses Git tree hashes rather than commit hashes; see here.It would be convenient if
fetchgit
could understand tree hashes when they're passed as therev
argument. It seems straightforward to support, as this PR shows.I've tested this with my prototype Julia packaging tool and it works. If this could be accepted then I'd be happy to update the documentation and stuff. Thanks!
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)