-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Add 'store add-gc-root' command to manually add indirect roots #11505
base: master
Are you sure you want to change the base?
Conversation
src/nix/add-root.md
Outdated
```console | ||
$ readlink foo | ||
/nix/store/xxx | ||
$ nix add-root foo |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Intuitively I would have expected such as subcommand here:
$ nix add-root foo | |
$ nix store add-gc-root foo |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wanted to add it in nix gc add-root
, but nix gc
seems mostly unused and intended to start a gc.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We currently don't have a top-level nix gc
subcommand group, but a nix store gc
command.
To help keep some consistency between commands, the subcommands are ideally nix <noun> <verb>
with the exception of a small number of frequently used commands.
gc
is a verb, since the "garbage" part is subordinate to the "collect" part (as a noun adjunct to be technical).
Since our commands end in verbs, this would create the expectation that nix gc
is not a subcommand group, but a single action.
I think nix store add-root
would be ok, but perhaps nix store add-gc-root
would be better, as I think the hint about gc would be welcomed when reading scripts that call this command.
Interactive use should not be common, because that would usually come after nix build
, which already produces a root.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Who makes final decisions about that ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nix team members, I would say. Often happens in those regular meetings.
Changed name, added tests. |
Motivation
This is a PoC fix for #7138. Now that I implemented it, I do not think it is the most elegant way to do it, as there is no way to ensure that the paths are not deleted during this operation. The command could fail however if not all the paths were successfully rooted.
Context
#7138
Priorities and Process
Add 👍 to pull requests you find important.
The Nix maintainer team uses a GitHub project board to schedule and track reviews.