nix path-info fails as the 'path is not valid' after 'fetching' them #323

Open
opened 2024-05-18 03:22:01 +00:00 by midnightveil · 1 comment
Member

Describe the bug

nix path-info on a path that does not exist in the store already, fails, despite saying that it has downloaded the path to the store.

Note: Doesn't seem to actually fetch the path, on larger derivations it errors instantly (despite needing to download large amounts).

It works fine if the store path already exists, e.g. nix path-info nixpkgs#bashInteractive

Steps To Reproduce

$ nix path-info nixpkgs#bat
this path will be fetched (2.44 MiB download, 6.03 MiB unpacked):
  /nix/store/lia3pyrb2i72gp2ch9dsgf1cvwmmdrnj-bat-0.24.0
error: path '/nix/store/lia3pyrb2i72gp2ch9dsgf1cvwmmdrnj-bat-0.24.0' is not valid

Expected behavior

Either it doesn't fetch the path, or it fetches the path and actually works.

EDIT: possible don't fetch the path?

see e.g. https://git.lix.systems/lix-project/lix/src/branch/main/src/nix/path-info.md#examples the example of checking against a remote store, currently if I do this it shows "these paths will be fetched" (sometimes a giant long list) and then errors, but never fetches.

nix --version output

nix (Lix, like Nix) 2.90.0-lixpre20240515-2a7b3d7

(also replicable on latest main, 7a3745b076)

Additional context

Was looking into #270

## Describe the bug `nix path-info` on a path that does not exist in the store already, fails, despite saying that it has downloaded the path to the store. Note: Doesn't seem to actually fetch the path, on larger derivations it errors instantly (despite needing to download large amounts). It works fine if the store path already exists, e.g. `nix path-info nixpkgs#bashInteractive` ## Steps To Reproduce ```bash $ nix path-info nixpkgs#bat this path will be fetched (2.44 MiB download, 6.03 MiB unpacked): /nix/store/lia3pyrb2i72gp2ch9dsgf1cvwmmdrnj-bat-0.24.0 error: path '/nix/store/lia3pyrb2i72gp2ch9dsgf1cvwmmdrnj-bat-0.24.0' is not valid ``` ## Expected behavior Either it doesn't fetch the path, or it fetches the path and actually works. EDIT: possible don't fetch the path? see e.g. https://git.lix.systems/lix-project/lix/src/branch/main/src/nix/path-info.md#examples the example of checking against a remote store, currently if I do this it shows "these paths will be fetched" (sometimes a giant long list) and then errors, but never fetches. ## `nix --version` output ``` nix (Lix, like Nix) 2.90.0-lixpre20240515-2a7b3d7 ``` (also replicable on latest main, 7a3745b07607d3fc85fb5a0a08832ab078080884) ## Additional context Was looking into #270
midnightveil added the
bug
label 2024-05-18 03:22:01 +00:00
midnightveil changed title from nix path-info fails as the 'path is not valid' to nix path-info fails as the 'path is not valid' after 'fetching' them 2024-05-18 03:22:24 +00:00
Author
Member

Also, as a minor UX bug, if the store path does already exist,

$ nix -L path-info nixpkgs#bashInteractive
copying '/nix/store/7q4y8idjk2di380j1fxn4k7wx9y935cl-source'/nix/store/6l7bia2zi007l7ylqaynfwsqrw334vy4-bash-interactive-5.2-p15-man
/nix/store/qddh95vjifqqlvby19maszcapnm3jkhk-bash-interactive-5.2-p15

the copying '/nix/store/<its nixpkgs>' is on the same line as the outputs, and happens every time.

Meanwhile with nix 2.15.0:

$ nix path-info nixpkgs#bashInteractive
evaluating derivation 'flake:nixpkgs#bashInteractive'/nix/store/32351qs76ykmk0q9xl45qcj9xgx3p49r-bash-interactive-5.2-p15-man
/nix/store/905zbkjnplsgwymjhyghx8pyiq22p5qz-bash-interactive-5.2-p15

$ nix path-info nixpkgs#bashInteractive
/nix/store/32351qs76ykmk0q9xl45qcj9xgx3p49r-bash-interactive-5.2-p15-man
/nix/store/905zbkjnplsgwymjhyghx8pyiq22p5qz-bash-interactive-5.2-p15

(exact same nix-path/nixpkgs versions etc)

Also, as a minor UX bug, if the store path does already exist, ``` $ nix -L path-info nixpkgs#bashInteractive copying '/nix/store/7q4y8idjk2di380j1fxn4k7wx9y935cl-source'/nix/store/6l7bia2zi007l7ylqaynfwsqrw334vy4-bash-interactive-5.2-p15-man /nix/store/qddh95vjifqqlvby19maszcapnm3jkhk-bash-interactive-5.2-p15 ``` the `copying '/nix/store/<its nixpkgs>'` is on the same line as the outputs, and happens every time. Meanwhile with nix 2.15.0: ``` $ nix path-info nixpkgs#bashInteractive evaluating derivation 'flake:nixpkgs#bashInteractive'/nix/store/32351qs76ykmk0q9xl45qcj9xgx3p49r-bash-interactive-5.2-p15-man /nix/store/905zbkjnplsgwymjhyghx8pyiq22p5qz-bash-interactive-5.2-p15 $ nix path-info nixpkgs#bashInteractive /nix/store/32351qs76ykmk0q9xl45qcj9xgx3p49r-bash-interactive-5.2-p15-man /nix/store/905zbkjnplsgwymjhyghx8pyiq22p5qz-bash-interactive-5.2-p15 ``` (exact same nix-path/nixpkgs versions etc)
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
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#323
No description provided.