You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm trying to use fetchGit as a saner replacement for .gitignore/whitelist sources as detailed in #2944:
src = if builtins.pathExists ./.git then builtins.fetchGit { url = ./.; } else ./.;
Unfortunately, this fails on Travis because Travis (sensibly) does a shallow clone by default. It seems this breaks fetchGit iff the working tree is clean:
$ git clone https://github.com/parttimenerd/temci.git --depth 1
[...]
$ cd temci
$ nix-build
warning: reject refs/heads/HEAD because shallow roots are not allowed to be updated
error: Could not read 9208ca8e91d8e707baeb3ce99750be94ea5d676d
fatal: Failed to traverse parents of commit 201ae68c5595d111d0605c13471a5c2de33bb3ec
error: program 'git' failed with exit code 128
(use '--show-trace' to show detailed location information)
# make it dirty
$ echo >> default.nix
$ nix-build
these derivations will be built:
[...]
My current workaround is to do something like nix-build --arg src ./. on Travis, but it would be great if I didn't need that.
The text was updated successfully, but these errors were encountered:
If you do a fetchTree on a Git repository, whether the result contains
a revCount attribute should not depend on whether that repository
happens to be a shallow clone or not. That would complicate caching a
lot and would be semantically messy. So applying fetchTree/fetchGit to
a shallow repository is now an error unless you pass the attribute
'shallow = true'. If 'shallow = true', we don't return revCount, even
if the repository is not actually shallow.
Note that Nix itself is not doing shallow clones at the moment. But it
could do so as an optimisation if the user specifies 'shallow = true'.
Issue #2988.
I'm trying to use
fetchGit
as a saner replacement for .gitignore/whitelist sources as detailed in #2944:Unfortunately, this fails on Travis because Travis (sensibly) does a shallow clone by default. It seems this breaks
fetchGit
iff the working tree is clean:My current workaround is to do something like
nix-build --arg src ./.
on Travis, but it would be great if I didn't need that.The text was updated successfully, but these errors were encountered: