pkgs.fetchgit, nix-prefetch-git fail when given a URL whose basename contains @ #103747
Labels
0.kind: bug
Something is broken
2.status: stale
https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md
6.topic: fetch
Describe the bug
If I have a URL to a git repository whose basename contains
@
, bothpkgs.fetchgit
andnix-prefetch-git
fail when given this URL. This is because both of these use the basename of the URL as the default name of the checkout to copy to the store.This can be worked around by passing the
name
arg topkgs.fetchgit
and using the--out
flag tonix-prefetch-git
, but this is often not doable when using other tools that usenix-prefetch-git
internally (see nixcloud/dep2nix#19 for an example).These tools should just sanitize
@
by default, along with any other characters that are invalid in store names, perhaps by replacing those invalid characters with_
.To Reproduce
Steps to reproduce the behavior:
Expected behavior
It should sanitize the synthesized name such that it's valid to use as a store name.
Notify maintainers
@bennofs
Metadata
"x86_64-darwin"
Darwin 19.6.0, macOS 10.15.7
yes
relaxed
nix-env (Nix) 2.3.8
""
"nixpkgs-21.03pre250093.0da76dab4c2"
/nix/var/nix/profiles/per-user/root/channels/nixpkgs
Maintainer information:
The text was updated successfully, but these errors were encountered: