Skip to content
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

nix build fails #12290

Open
Philipp-M opened this issue Dec 18, 2024 · 4 comments
Open

nix build fails #12290

Philipp-M opened this issue Dec 18, 2024 · 4 comments
Labels
A-packaging Area: Packaging and bundling C-bug Category: This is a bug

Comments

@Philipp-M
Copy link
Contributor

Summary

When building helix via nix with e.g.

nix build .

it fails with basically this:

error: Cannot find Git revision '4d5b141017c61fe7e168e0a5c5721ee62b0d9572' in ref 'HEAD' of repository 'https://gitlab.com/spade-lang/tree-sitter-spade'! Please make sure that the rev exists on the ref you've specified or add allRefs = true; to fetchGit.

I haven't looked too deep into this yet, but I could get it to build when I change rev to ref in the languages.toml in spade:

 [[grammar]]
 name = "spade"
-source = { git = "https://gitlab.com/spade-lang/tree-sitter-spade", rev = "4d5b141017c61fe7e168e0a5c5721ee62b0d9572" }
+source = { git = "https://gitlab.com/spade-lang/tree-sitter-spade", ref = "4d5b141017c61fe7e168e0a5c5721ee62b0d9572" }
 
 [[language]]
 name = "amber"

Reproduction Steps

nix build .

Helix log

No response

Platform

NixOS unstable

Terminal Emulator

kitty

Installation Method

nix build with helix master

Helix Version

24.07-347-g91a5d407

@Philipp-M Philipp-M added the C-bug Category: This is a bug label Dec 18, 2024
@the-mikedavis
Copy link
Member

What is your nix --version? I built with nix build on 2.24.10 successfully

@the-mikedavis the-mikedavis added the A-packaging Area: Packaging and bundling label Dec 18, 2024
@Philipp-M
Copy link
Contributor Author

That's interesting, I have the same version 2.24.10

It could well be that you somehow have this cached in the nix store already, I haven't had issues on a different machine too... Though I wonder how it came to the nix store in the first place. It might be reproducible after garbage-collecting, or explicitly removing that store entry?

@the-mikedavis
Copy link
Member

Ok I cleared out my references to Helix, removed ~/.cache/nix (in case the download was cached), unset the Cachix substituter, did a garbage collection run and reran nix build and it passed.

The only other thing that comes to mind is maybe the git version? Shallow-cloning a repo at an exact revision is a somewhat recent feature in git so maybe if your git is old it can't request that revision from gitlab

@Philipp-M
Copy link
Contributor Author

Thanks for investigating this (as I haven't found time yet).

The only other thing that comes to mind is maybe the git version? Shallow-cloning a repo at an exact revision is a somewhat recent feature in git so maybe if your git is old it can't request that revision from gitlab

Hmm good hint, I unfortunately don't have access to the machine until next year where I got the issues, IIRC the nixpkgs there were from the end of October and I just checked, it should be version 2.46.1, while on the machine where it works it's 2.47, so you might be right when it was added in 2.47 (on a quick google I haven't found the release note for this though).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-packaging Area: Packaging and bundling C-bug Category: This is a bug
Projects
None yet
Development

No branches or pull requests

2 participants