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

Remove nix-store --dump and nix-store --restore? #3183

Closed
bhipple opened this issue Oct 31, 2019 · 3 comments
Closed

Remove nix-store --dump and nix-store --restore? #3183

bhipple opened this issue Oct 31, 2019 · 3 comments

Comments

@bhipple
Copy link
Contributor

bhipple commented Oct 31, 2019

Currently, nix has two pairs of commands for interacting with NAR files:

  • nix-store --dump --> nix-store --restore
  • nix-store --export --> nix-store --import

These differ in that the former can only take one path, and does not store the
requisites of a path, so it can't be imported into a nix store the way you'd
expect. It requires that all paths not already exist on the --restore end, while
the --import one can incrementally update paths and properly sync the sqlite db.

Perhaps we should delete nix-store --dump and nix-store --restore entirely,
since they appear to be less useful subsets of the export and import commands.
This would simplify the cmdline / API surface area for newcomers and reduce
ongoing maintenance.

Here's an example of a newcomer getting tripped up and using the "inferior"
dump/restore. I also spent a while staring at this at NixCon, and would like to
help remove it if indeed there's no legitimate use case for it.
#951 (comment)

@bhipple bhipple changed the title Remove nix-store --dump? Remove nix-store --dump and nix-store --restore? Oct 31, 2019
bhipple added a commit to bhipple/nix that referenced this issue Oct 31, 2019
The NAR produced by `--export` seems to work juts as well as the NAR produced by
`--dump`, except that it can *also* be safely imported into an existing nix
store and update the sqlite metadata. This commit changes the manual to
reference export/import by default.

See NixOS#3183 for a potential followup pending discussion.
@edolstra
Copy link
Member

Well, the entire nix-store command will hopefully become deprecated in the future. The nix command has some subcommands for dealing with NARs (like nix dump-path, nix cat-nar, nix ls-nar).

But it's really the nix-store --export / --import commands that should be removed. They have a very wacky, non-extensible format that does not handle things like signatures and has other misfeatures (e.g. the metadata comes after the NAR, so on import we have to read the NAR into memory even though the store path may already be in the Nix store). So we should come up with a new format for storing closures.

@edolstra
Copy link
Member

Closing since we don't want to break compatibility.

@AleXoundOS
Copy link

I couldn't unpack/extract NAR with nix cat-nar. Only single files from it.
But nix-store --restore works right.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants