Empty store path name for URLs with multiple trailing slashes in fetchurl #1185

Open
opened 2026-04-19 14:55:27 +00:00 by 3timeslazy · 3 comments

Describe the bug

fetchurl in Lix and Nix handle multiple trailing slashes in URLs differently.

Nix handles this fine, but Lix fails.

Steps To Reproduce

Run nix-instantiate --eval -E 'builtins.fetchurl "https://nixos.org//"'

Lix returns

error:
       … while calling the 'fetchurl' builtin
         at «string»:1:1:
            1| builtins.fetchurl "https://nixos.org//"
             | ^

       error: store path 'l2k9fmfbsqxvqhilnmqzp6jzbvfdfj8h-' has an empty name

Expected behavior

The same command but with Nix

$ nix-instantiate --eval -E 'builtins.fetchurl "https://nixos.org//"'
"/nix/store/6x3h2xnwk194kzwbxs4xmnvhg7paa03x-nixos.org"

nix --version output

nix (Lix, like Nix) 2.94.1
System type: x86_64-linux

## Describe the bug `fetchurl` in Lix and Nix handle multiple trailing slashes in URLs differently. Nix handles this fine, but Lix fails. ## Steps To Reproduce Run `nix-instantiate --eval -E 'builtins.fetchurl "https://nixos.org//"'` Lix returns ``` error: … while calling the 'fetchurl' builtin at «string»:1:1: 1| builtins.fetchurl "https://nixos.org//" | ^ error: store path 'l2k9fmfbsqxvqhilnmqzp6jzbvfdfj8h-' has an empty name ``` ## Expected behavior The same command but with Nix ``` $ nix-instantiate --eval -E 'builtins.fetchurl "https://nixos.org//"' "/nix/store/6x3h2xnwk194kzwbxs4xmnvhg7paa03x-nixos.org" ``` ## `nix --version` output nix (Lix, like Nix) 2.94.1 System type: x86_64-linux
Author

After a quick investigation, I found that fetchurl behaviour changed here: github.com/NixOS/nix@9884018dfa

This change was initially discovered here: https://cl.snix.dev/c/snix/+/31164

Maybe the discussion in the CL will be helpful

After a quick investigation, I found that fetchurl behaviour changed here: https://github.com/NixOS/nix/commit/9884018dfae766a3b7fd3e9bc0302e75feccf52d This change was initially discovered here: https://cl.snix.dev/c/snix/+/31164 Maybe the discussion in the CL will be helpful
Member

This issue was mentioned on Gerrit on the following CLs:

  • commit message in cl/5566 ("baseNameOf(): Remove all trailing slashes")
<!-- GERRIT_LINKBOT: {"cls": [{"backlink": "https://gerrit.lix.systems/c/lix/+/5566", "number": 5566, "kind": "commit message"}], "cl_meta": {"5566": {"change_title": "baseNameOf(): Remove all trailing slashes"}}} --> This issue was mentioned on Gerrit on the following CLs: * commit message in [cl/5566](https://gerrit.lix.systems/c/lix/+/5566) ("baseNameOf(): Remove all trailing slashes")
Owner

We chatted with the core team, we agree something should be done about this. I'm not exactly sure we should cherry-pick the original change. If we do, we need to add the explanation and the proof this is the right fix, which is not contained in any of the commit message. A release note should be added as well.

We chatted with the core team, we agree something should be done about this. I'm not exactly sure we should cherry-pick the original change. If we do, we need to add the explanation and the proof this is the right fix, which is not contained in any of the commit message. A release note should be added as well.
Sign in to join this conversation.
No milestone
No project
No assignees
3 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
lix-project/lix#1185
No description provided.