Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

nix dump-path requires nix-command to be enabled #11225

Closed
flokli opened this issue Jul 31, 2024 · 5 comments
Closed

nix dump-path requires nix-command to be enabled #11225

flokli opened this issue Jul 31, 2024 · 5 comments
Labels
bug cli The old and/or new command line interface regression Something doesn't work anymore

Comments

@flokli
Copy link
Contributor

flokli commented Jul 31, 2024

Describe the bug

❯ nix dump-path /nix/store/kwmqk7ygvhypxadsdaai27gl6qfxv7za-hello-2.12.1
warning: 'dump-path' is a deprecated alias for 'store dump-path'
error: experimental Nix feature 'nix-command' is disabled; use '--extra-experimental-features nix-command' to override

Used to work fine in Nix 2.3, and probably a few other recent Nix versions.

Used in nix-serve for example: https://github.com/edolstra/nix-serve/blob/master/nix-serve.psgi#L66, effectively breaking it on systems without nix-command being enabled.

Expected behavior

Don't gate nix dump-path behind the nix-command xp. It was "stable" before, and there's code (like nix-serve) out there relying on it.

nix-env --version output

nix-env (Nix) 2.18.5

Additional context

Add any other context about the problem here.

Priorities

Add 👍 to issues you find important.

@flokli flokli added the bug label Jul 31, 2024
flokli added a commit to flokli/nix-serve that referenced this issue Jul 31, 2024
`nix dump-path` regressed, and now requires flakes to be enabled,
breaking nix-serve on systems without flakes being enabled.

However, `nix-store --dump` works fine across the board, so use that.

Nix issue: NixOS/nix#11225
Workaround in nixpkgs: NixOS/nixpkgs#331230
@edolstra
Copy link
Member

I can't reproduce this.

nix --experimental-features 'nix-command' store dump-path /nix/store/94d0gz9z6kbc8x5qqisdhjrap6y9casd-coreutils-full-9.5 > /dev/null

works fine.

Note that if you run nix store dump-path without arguments in a flake directory, it will try to evaluate the flake, which requires the flakes experimental feature.

@flokli
Copy link
Contributor Author

flokli commented Jul 31, 2024

See NixOS/nixpkgs#331230, try running the passthru tests from a nixpkgs checkout without adding Nix 2.3 to $PATH, but pkgs.nix.

@flokli flokli changed the title nix dump-path requires flakes to be enabled nix dump-path requires nix-command to be enabled Jul 31, 2024
@flokli
Copy link
Contributor Author

flokli commented Jul 31, 2024

Running it without a parameter indeed exposes the flake behaviour (and error message).

The nixpkgs test is however also failing, due to the nix-command commands being made experimental again. I updated the issue accordingly.

@roberth roberth added regression Something doesn't work anymore cli The old and/or new command line interface labels Jul 31, 2024
@roberth roberth added this to Nix team Jul 31, 2024
@github-project-automation github-project-automation bot moved this to To triage in Nix team Jul 31, 2024
@edolstra
Copy link
Member

The nix CLI was always experimental, but wasn't feature-gated initially. It will become stable again in the future (see #7701).

@nixos-discourse
Copy link

This issue has been mentioned on NixOS Discourse. There might be relevant details there:

https://discourse.nixos.org/t/2024-07-31-nix-team-meeting-minutes-166/49972/1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug cli The old and/or new command line interface regression Something doesn't work anymore
Projects
Archived in project
Development

No branches or pull requests

4 participants