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

Fetching/building cargo deps/artifacts fails when using git dependencies that (seem to) use git-lfs #689

Open
feathecutie opened this issue Aug 28, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@feathecutie
Copy link

Describe the bug
When using a git dependency that seems to use git-lfs, buildDepsOnly fails with the error

fetching git input 'git+file:///home/fea/dev/rust/crane-bug-lfs'
fetching git input 'git+https://github.com/Leafwing-Studios/leafwing-input-manager'
Downloading assets/Montserrat/Montserrat-Italic-VariableFont_wght.ttf (404 KB)
Error downloading object: assets/Montserrat/Montserrat-Italic-VariableFont_wght.ttf (0a85590): Smudge error: Error downloading assets/Montserrat/Montserrat-Italic-VariableFont_wght.ttf (0a855909413334f09fbec411b4b6cf0b3e3a552341492658f43a59294479a362): error initializing custom adapter "lfs-standalone-file" worker 0: [0] error creating handler: no valid file:// URLs found

Errors logged to '/tmp/nix-163009-1/lfs/logs/20240828T124325.77098434.log'.
Use `git lfs logs last` to view the log.
error: external filter 'git-lfs filter-process' failed
fatal: assets/Montserrat/Montserrat-Italic-VariableFont_wght.ttf: smudge filter lfs failed
error:
       … while evaluating 'strict' to select 'drvPath' on it
         at /builtin/derivation.nix:1:552:
       … while calling the 'derivationStrict' builtin
         at /builtin/derivation.nix:1:208:
       (stack trace truncated; use '--show-trace' to show the full trace)

       error: program 'git' failed with exit code 128

In my case, the problematic git dependency is https://github.com/Leafwing-Studios/leafwing-input-manager/ (and appearently specifically the assets subdirectory of it).

Reproduction
This is a minimal reproduction that simply tries to buildDepsOnly with leafwing-input-manager as a git dependency: https://github.com/feathecutie/crane-bug-lfs

Simply build the default package to reproduce:
nix build github:feathecutie/crane-bug-lfs

@feathecutie feathecutie added the bug Something isn't working label Aug 28, 2024
@ipetkov
Copy link
Owner

ipetkov commented Aug 29, 2024

Hi @feathecutie thanks for the report!

It's worth noting that our vendor logic uses one of two different fetchers:

  1. if output hashes for git deps are defined, then we will use pkgs.fetchgit. Looking at the upstream source I can see it takes a fetchLfs parameter which we can hard-code to true going forward
  2. if output hashes are not set (the default behavior), then we will use builtins.fetchGit which as far as I can tell doesn't accept any additional parameters. In other words, whether or not LFS is fetched depends on your Nix implementation...

Which version of Nix are you using?

My output of nix --version shows nix (Lix, like Nix) 2.90.0 and it's worth noting that your reproduction flake seemed to build fine for me. I'd recommend upgrading to a newer Nix if you can and see if that solves the problem

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants
@ipetkov @feathecutie and others