[Nix#15520] nix store delete nixpkgs#hello first downloads hello before deleting it #1163

Open
opened 2026-03-20 01:39:47 +00:00 by lisanna-dettwyler · 9 comments

Describe the bug

Passing a flake attribute to nix store delete will first cause it to be downloaded (if it is not already downloaded) before being deleted. This is a bit unintuitive. This happens in both cppnix and Lix.

Steps To Reproduce

✗ nix store delete nixpkgs#hello
this path will be fetched (0.05 MiB download, 0.26 MiB unpacked):
  /nix/store/aiblla3swfhcv348k8h10mnsg35wzvm6-hello-2.12.2
1 store paths deleted, 0.00 MiB freed

Expected behavior

I think it should instead error saying that it does not exist.

nix --version output

nix (Lix, like Nix) 2.93.3
System type: x86_64-linux
Additional system types: i686-linux, x86_64-v1-linux, x86_64-v2-linux, x86_64-v3-linux, x86_64-v4-linux
Features: gc, signed-caches
System configuration file: /etc/nix/nix.conf
User configuration files: /home/lisanna/.config/nix/nix.conf:/etc/xdg/nix/nix.conf:/home/lisanna/.nix-profile/etc/xdg/nix/nix.conf:/nix/profile/etc/xdg/nix/nix.conf:/home/lisanna/.local/state/nix/profile/etc/xdg/nix/nix.conf:/etc/profiles/per-user/lisanna/etc/xdg/nix/nix.conf:/nix/var/nix/profiles/default/etc/xdg/nix/nix.conf:/run/current-system/sw/etc/xdg/nix/nix.conf
Store directory: /nix/store
State directory: /nix/var/nix
Data directory: /nix/store/j23vzyvnkfqqmabdp076ipfl3man7r3c-lix-2.93.3/share

Additional context

https://github.com/NixOS/nix/issues/15520

## Describe the bug Passing a flake attribute to `nix store delete` will first cause it to be downloaded (if it is not already downloaded) before being deleted. This is a bit unintuitive. This happens in both cppnix and Lix. ## Steps To Reproduce ``` ✗ nix store delete nixpkgs#hello this path will be fetched (0.05 MiB download, 0.26 MiB unpacked): /nix/store/aiblla3swfhcv348k8h10mnsg35wzvm6-hello-2.12.2 1 store paths deleted, 0.00 MiB freed ``` ## Expected behavior I think it should instead error saying that it does not exist. ## `nix --version` output ``` nix (Lix, like Nix) 2.93.3 System type: x86_64-linux Additional system types: i686-linux, x86_64-v1-linux, x86_64-v2-linux, x86_64-v3-linux, x86_64-v4-linux Features: gc, signed-caches System configuration file: /etc/nix/nix.conf User configuration files: /home/lisanna/.config/nix/nix.conf:/etc/xdg/nix/nix.conf:/home/lisanna/.nix-profile/etc/xdg/nix/nix.conf:/nix/profile/etc/xdg/nix/nix.conf:/home/lisanna/.local/state/nix/profile/etc/xdg/nix/nix.conf:/etc/profiles/per-user/lisanna/etc/xdg/nix/nix.conf:/nix/var/nix/profiles/default/etc/xdg/nix/nix.conf:/run/current-system/sw/etc/xdg/nix/nix.conf Store directory: /nix/store State directory: /nix/var/nix Data directory: /nix/store/j23vzyvnkfqqmabdp076ipfl3man7r3c-lix-2.93.3/share ``` ## Additional context https://github.com/NixOS/nix/issues/15520
Member

This has been fixed in 6a4efb82bc , lix 2.93 is quite an old release (2.95 is currently being released)

This has been fixed in https://git.lix.systems/lix-project/lix/commit/6a4efb82bc689080b52d2ae52a849d9087b1f020 , lix 2.93 is quite an old release (2.95 is currently being released)
Owner

2.93.3 is the default version in NixOS's most recent stable release, 25.11, but lixPackageSets.latest.lix is 2.94.0, which should have the fix.

2.93.3 is the default version in NixOS's most recent stable release, 25.11, but `lixPackageSets.latest.lix` is 2.94.0, which should have the fix.
Owner

Yeah, if we had done a 2.93.4, this would have been fixed. Given that 2.93.3 is going away soonish with 2.95.1 arriving, except if we get an explicit request for a 2.93 series backport, I'd consider this fixed.

@qyriad could you add triaging tags for "oldstable" bugs or something of that nature? I think these bugs makes sense and would help understand/inform if we should update our stable release maintenance policy

Yeah, if we had done a 2.93.4, this would have been fixed. Given that 2.93.3 is going away soonish with 2.95.1 arriving, except if we get an explicit request for a 2.93 series backport, I'd consider this fixed. @qyriad could you add triaging tags for "oldstable" bugs or something of that nature? I think these bugs makes sense and would help understand/inform if we should update our stable release maintenance policy

This still reproduces in 2.94.0.

This still reproduces in 2.94.0.
Owner
❯ nix store delete nixpkgs#hello
warning: unknown deprecated feature 'broken-string-escape'
warning: unknown deprecated feature 'or-as-identifier'
warning: unknown deprecated feature 'rec-set-dynamic-attrs'
don't know how to build these paths (may be caused by read-only store access):
  /nix/store/qdzln99hynf92vrz8sz91hlf1dmb1vdy-hello-2.12.2.drv
error: opening file '/nix/store/qdzln99hynf92vrz8sz91hlf1dmb1vdy-hello-2.12.2.drv': No such file or directory
❯ nix --version                 
warning: unknown deprecated feature 'broken-string-escape'
warning: unknown deprecated feature 'or-as-identifier'
warning: unknown deprecated feature 'rec-set-dynamic-attrs'
nix (Lix, like Nix) 2.94.0
System type: x86_64-linux
Additional system types: i686-linux, x86_64-v1-linux, x86_64-v2-linux, x86_64-v3-linux, x86_64-v4-linux
Features: gc, signed-caches
System configuration file: /etc/nix/nix.conf
User configuration files: /home/raito/.config/nix/nix.conf:/etc/xdg/nix/nix.conf:/home/raito/.nix-profile/etc/xdg/nix/nix.conf:/nix/profile/etc/xdg/nix/nix.conf:/home/raito/.local/state/nix/profile/etc/xdg/nix/nix.conf:/etc/profiles/per-user/raito/etc/xdg/nix/nix.conf:/nix/var/nix/profiles/default/etc/xdg/nix/nix.conf:/run/current-system/sw/etc/xdg/nix/nix.conf
Store directory: /nix/store
State directory: /nix/var/nix
Data directory: /nix/store/0zqbw17irvj0c71wn6cjbmcg2v04gzvd-lix-2.94.0/share

What am I missing?

This doesn't reproduce on my side. I mean right, this is trying to build the path.

``` ❯ nix store delete nixpkgs#hello warning: unknown deprecated feature 'broken-string-escape' warning: unknown deprecated feature 'or-as-identifier' warning: unknown deprecated feature 'rec-set-dynamic-attrs' don't know how to build these paths (may be caused by read-only store access): /nix/store/qdzln99hynf92vrz8sz91hlf1dmb1vdy-hello-2.12.2.drv error: opening file '/nix/store/qdzln99hynf92vrz8sz91hlf1dmb1vdy-hello-2.12.2.drv': No such file or directory ❯ nix --version warning: unknown deprecated feature 'broken-string-escape' warning: unknown deprecated feature 'or-as-identifier' warning: unknown deprecated feature 'rec-set-dynamic-attrs' nix (Lix, like Nix) 2.94.0 System type: x86_64-linux Additional system types: i686-linux, x86_64-v1-linux, x86_64-v2-linux, x86_64-v3-linux, x86_64-v4-linux Features: gc, signed-caches System configuration file: /etc/nix/nix.conf User configuration files: /home/raito/.config/nix/nix.conf:/etc/xdg/nix/nix.conf:/home/raito/.nix-profile/etc/xdg/nix/nix.conf:/nix/profile/etc/xdg/nix/nix.conf:/home/raito/.local/state/nix/profile/etc/xdg/nix/nix.conf:/etc/profiles/per-user/raito/etc/xdg/nix/nix.conf:/nix/var/nix/profiles/default/etc/xdg/nix/nix.conf:/run/current-system/sw/etc/xdg/nix/nix.conf Store directory: /nix/store State directory: /nix/var/nix Data directory: /nix/store/0zqbw17irvj0c71wn6cjbmcg2v04gzvd-lix-2.94.0/share ``` What am I missing? ~~This doesn't reproduce on my side.~~ I mean right, this is trying to build the path.
Owner

@lheckemann Do you have any background on the expected behavior here when you made this fix?

@lheckemann Do you have any background on the expected behavior here when you made this fix?

That is really weird.

➜  ~ nix store delete nixpkgs#hello     
this path will be fetched (0.05 MiB download, 0.26 MiB unpacked):
  /nix/store/aiblla3swfhcv348k8h10mnsg35wzvm6-hello-2.12.2
1 store paths deleted, 0.00 MiB freed
➜  ~ nix --version                      
nix (Lix, like Nix) 2.94.0
System type: x86_64-linux
Additional system types: i686-linux, x86_64-v1-linux, x86_64-v2-linux, x86_64-v3-linux, x86_64-v4-linux
Features: gc, signed-caches
System configuration file: /etc/nix/nix.conf
User configuration files: /home/lisanna/.config/nix/nix.conf:/etc/xdg/nix/nix.conf:/home/lisanna/.nix-profile/etc/xdg/nix/nix.conf:/nix/profile/etc/xdg/nix/nix.conf:/home/lisanna/.local/state/nix/profile/etc/xdg/nix/nix.conf:/etc/profiles/per-user/lisanna/etc/xdg/nix/nix.conf:/nix/var/nix/profiles/default/etc/xdg/nix/nix.conf:/run/current-system/sw/etc/xdg/nix/nix.conf:/nix/store/dh3ks9g3l0cy6h9iilncx2gnz21kwn9z-gnome-settings-daemon-49.1/etc/xdg/nix/nix.conf:/nix/store/dh3ks9g3l0cy6h9iilncx2gnz21kwn9z-gnome-settings-daemon-49.1/etc/xdg/nix/nix.conf
Store directory: /nix/store
State directory: /nix/var/nix
Data directory: /nix/store/cy71micgi028x6y7paj45xyj1sw8jclq-lix-2.94.0/share
That is really weird. ``` ➜ ~ nix store delete nixpkgs#hello this path will be fetched (0.05 MiB download, 0.26 MiB unpacked): /nix/store/aiblla3swfhcv348k8h10mnsg35wzvm6-hello-2.12.2 1 store paths deleted, 0.00 MiB freed ➜ ~ nix --version nix (Lix, like Nix) 2.94.0 System type: x86_64-linux Additional system types: i686-linux, x86_64-v1-linux, x86_64-v2-linux, x86_64-v3-linux, x86_64-v4-linux Features: gc, signed-caches System configuration file: /etc/nix/nix.conf User configuration files: /home/lisanna/.config/nix/nix.conf:/etc/xdg/nix/nix.conf:/home/lisanna/.nix-profile/etc/xdg/nix/nix.conf:/nix/profile/etc/xdg/nix/nix.conf:/home/lisanna/.local/state/nix/profile/etc/xdg/nix/nix.conf:/etc/profiles/per-user/lisanna/etc/xdg/nix/nix.conf:/nix/var/nix/profiles/default/etc/xdg/nix/nix.conf:/run/current-system/sw/etc/xdg/nix/nix.conf:/nix/store/dh3ks9g3l0cy6h9iilncx2gnz21kwn9z-gnome-settings-daemon-49.1/etc/xdg/nix/nix.conf:/nix/store/dh3ks9g3l0cy6h9iilncx2gnz21kwn9z-gnome-settings-daemon-49.1/etc/xdg/nix/nix.conf Store directory: /nix/store State directory: /nix/var/nix Data directory: /nix/store/cy71micgi028x6y7paj45xyj1sw8jclq-lix-2.94.0/share ```

Right, if I delete the derivation first then when I try I get your error message. But if the derivation exists in the store it will still download it.

Right, if I delete the derivation first then when I try I get your error message. But if the derivation exists in the store it will still download it.
Member

https://gerrit.lix.systems/c/lix/+/2782/comments/f05249db_689c5989 my ass. I'm sure I at least tested it manually, but I'm unable to get it to behave the way I described it even on that very commit. Sorry about that! I guess RealiseMode is broken. I'll have a look if I can fix it properly.

https://gerrit.lix.systems/c/lix/+/2782/comments/f05249db_689c5989 my ass. I'm sure I at least tested it manually, but I'm unable to get it to behave the way I described it even on that very commit. Sorry about that! I guess RealiseMode is broken. I'll have a look if I can fix it properly.
Sign in to join this conversation.
No milestone
No project
No assignees
5 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#1163
No description provided.