-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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 name argument to builtins.fetchTarball and builtins.fetchgit #904
Comments
Just to be clear about my motivation: I'd like to build my derivation on Hydra and locally using some git as source and currently it's not possible to match Hydra's produced hash using |
Wrote a script to get all hashes for an example repo:
The script (assumes recent Nix at
|
Started with nixpkgs: NixOS/nixpkgs#15469 Next up: Hydra should use nixpkgs |
I can remove the differences in inputs between what's used as the source, but I really don't see a solution to naming of these derivations without providing a way to name them (or just using the same name everywhere). |
How does this impact fetching from local directories, for example I'm bumping into NixOS/hydra#172 and it would be super to be able to implement some kind of workaround until this can be fixed properly. I'd be more than happy to have a crack at this if someone points me in the right direction :) |
Current behavior:
builtins.fetchTarball
currently names the derivation after the url (words after last slash in the url)builtins.fetchgit
currently always names the derivationgit-export
nix-prefetch-git
currently names the derivationgit-export
(and has an old standing bug in that script of stripping anything that prefixes on.git
instead of just.git
folder, so.gitignore
would also be deletednix-prefetch-git
currently names the derivation after url and rev nameAll in all, this leads to a lot of frustration since hashes of those derivations will differ. I'll try to fix the Hydra part (and look into since when nix-prefetch-git is crazy).
Mainly, I would hope that
fetchTarball
andfetchgit
can be used interchangeably and it's currently not possible due to different hardcoded names.cc @ocharles as he mentioned this recently on IRC
cc @edolstra
The text was updated successfully, but these errors were encountered: