Skip to content

Improve error message for failing nix-prefetch-git #60

@Ma27

Description

@Ma27

So I was trying to add a git dependency in a shell where lon was available, but nix-prefetch-git wasn't.

The lon add git cilib ... command resulted in the following error:

Adding cilib...
Locked revision: 1580c9cef4ae54cf32ea951d82e122fe74894c83
Failed to compute hash for git@git.example.com:dependency@1580c9cef4ae54cf32ea951d82e122fe74894c83

The only way for me to find out that nix-prefetch-git was missing was to strace lon:

[pid 159593] execve("/nix/var/nix/profiles/default/bin/nix-prefetch-git", ["nix-prefetch-git", "--name", "source", "git@git.example.com:depe"..., "1580c9cef4ae54cf32ea951d82e122fe"...], 0x7ffdbbb4c3c0 /* 190 vars */) = -1 ENOENT (No such file or directory)
[pid 159593] execve("/run/current-system/sw/bin/nix-prefetch-git", ["nix-prefetch-git", "--name", "source", "git@git.example.com:depe"..., "1580c9cef4ae54cf32ea951d82e122fe"...], 0x7ffdbbb4c3c0 /* 190 vars */) = -1 ENOENT (No such file or directory)
[pid 159593] exit_group(127) = ?
[pid 159588] <... clone3 resumed>) = 159593
[pid 159593] +++ exited with 127 +++

I'd very much prefer if lon would tell me this directly.

Observed with lon 0.8.0.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions