(in)compatibility of nix store
subcommand with CppNix (new add
vs. old add-file
and add-path
subcommands) #780
Labels
No labels
Affects/CppNix
Affects/Nightly
Affects/Only nightly
Affects/Stable
Area/build-packaging
Area/cli
Area/evaluator
Area/fetching
Area/flakes
Area/language
Area/lix ci
Area/nix-eval-jobs
Area/profiles
Area/protocol
Area/releng
Area/remote-builds
Area/repl
Area/repl/debugger
Area/store
bug
Context
contributors
Context
drive-by
Context
maintainers
Context
RFD
crash 💥
Cross Compilation
devx
docs
Downstream Dependents
E/easy
E/hard
E/help wanted
E/reproducible
E/requires rearchitecture
imported
Language/Bash
Language/C++
Language/NixLang
Language/Python
Language/Rust
Needs Langver
OS/Linux
OS/macOS
performance
regression
release-blocker
stability
Status
blocked
Status
invalid
Status
postponed
Status
wontfix
testing
testing/flakey
Topic/Large Scale Installations
ux
No milestone
No project
No assignees
3 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: lix-project/lix#780
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Describe the bug
With https://github.com/NixOS/nix/pull/9357 CppNix merged the
add-file
andadd-path
subcommands ofnix store
into a singeadd
subcommand. This has not been reflected in Lix (d169c092fc/lix/nix/add-to-store.cc
as of opening this issue).This breaks downstream tooling such as nix-playground, which uses the unified command:
c1a5c79f4a/nix_playground/build.py (L44)
Steps To Reproduce
touch delicious.icecream && nix store add delicious.icecream
error: 'add' is not a recognised command
Expected behavior
touch delicious.icecream && nix store add delicious.icecream
/nix/store/kphh26dlb2w2mhydjqaiqn02zcxgz0j2-delicious.icecream
(produced by CppNix 2.24.12nix store add delicious.icecream
)nix --version
outputnix (Lix, like Nix) 2.91.1
I am not sure what the correct way to handle this is. It's possible to pick the change if it looks reasonable, but it sucks to be dragged into making changes just because CppNix did them, even if they're a good idea. Having this unstable CLI be the locus of user complaints whenever it differs from CppNix by either option of not changing or changing in ways that break scripts is untenable in the long term.
The ideal solution here is to stop making compatibility promises that prevent us having control over our destiny.
Probably the fix to this one is picking the change, assuming it doesn't regress anything, since it sounds reasonable.
The downstream software in question was never compatible with 2.18 since that file didn't exist at all.
please do not, because it will regress something. the new command unnecessarily exposes implementation details that'll prevent us making meaningful improvements to the store layer without breaking the commands again.
This was merely an observation and by no means seen as a broken promise. Especially given that this stuff is still marked as experimental.
TBH, I am still undecided how this command should be implemented. I can somewhat understand why
add-path
has been taken as default foradd
andadd-files
is now available asadd --flat
, but I do not like the ergonomics of havingnix command subcommand --flag
. The change itself is rather trivial (just adopting the RegisterCommand calls at the of the source file).w.r.t. to regressions: the subcommand in question was not available for long, so probably has low adoption and CppNix at least added deprecation warnings in their patch instead of doing a hard switch.
This was merely an observation and by no means seen as a broken promise. Especially given that this stuff is still marked as experimental.
TBH, I am still undecided how this command should be implemented. I can somewhat understand why
add-path
has been taken as default foradd
andadd-files
is now available asadd --flat
, but I do not like the ergonomics of havingnix command subcommand --flag
. The change itself is rather trivial (just adopting the RegisterCommand calls at the of the source file).w.r.t. to regressions: the subcommand in question was not available for long, so probably has low adoption and CppNix at least added deprecation warnings in their patch instead of doing a hard switch.
@pennae wrote in #780 (comment):
Oh? As far as I can tell the way it's been written today leaks approximately the same amount: the mode flag exists already and allows either recursive, flat or text modes. That being said, there being three modes for adding single files to the store is kind of pointless since every store path has a nar hash already and adding a single file probably could just make three hard links for compatibility with any of the non nar modes. Anyway I'm not sure of the specifics of the improvements you're planning.
exposing nar as the canonical format to create path hashes nails us down to not changing this unless we want to break the abi. creating compatibility hardlinks will not be possible for directories, creating symlinks will be wrong, and in any case we'll be unable to distinguish a compat-linked object from an object that was added with an old method and will have to deal with tremendously complicated GC (since every object may now exist multiple times, opening multiple race windows even once we've dealt with everything else)
we could of course sidestep this somewhat by sticking to the old recursive/flat wording without specifying behavior, but then we're still incompatible and have gained nothing except breaking things for no reason