Open ralsei opened 2 years ago
Thanks! As a workaround, you can just put the SHA1 in there for now. I will look into the issue.
Should be fixed now, please confirm :)
This fails with:
[2 built, 0.0 MiB DL] fetching Git repository 'https://github.com/RedPRL/bantorrfatal: couldn't find remote ref refs/heads/0.1.0
error: program 'git' failed with exit code 128
because 0.1.0
isn't a branch, it's a tag.
Oooff, right, that's annoying.
I'm not sure I know of a good solution. We need to somehow make fetchGit { ref = "0.1.0"; <...> }
fetch the 0.1.0
tag. Of course it is possible to hardcode ref = "refs/tags/0.1.0"
but that is not great. It's also possible to do some tryEval
hackery and try both ref = "refs/heads/0.1.0"
and ref = "refs/tags/0.1.0"
but that's quite horrible honestly.
If you want to label this as wontfix that's fine, since it seems like a limitation of fetchGit
to be fair
I'll just try to fix the fetchGit
annoyance ;)
This (maybe) does it, although I'm not sure. https://github.com/NixOS/nix/pull/6766
At least it seems to resolve this specific problem.
Also note that I recommend against using tags (or branches) anyways, since they make the evaluation impure and therefore much less reproducible. Just including the commit hashes is a simple enough change, but it can save a lot of headaches for other people or even future you when trying to build the project in five years. Specifying a commit sha1 hash will allow you to build without --impure
, and it's not such a big deal to update it once in a while IMHO.
Describe the bug When dealing with a
pin-depend
URL with a tag, such asgit+https://github.com/foo/bar#0.1.0
, opam-nix parses the tag as a SHA1:To Reproduce Here's my
flake.nix
:and
cooltt.opam
:Expected behavior It should pull from the tag.
Environment