Repository navigation
Conversation
|
I like this functionality, but I don't think printing these info messages (unconditionally) is the responsibility of libstore. Perhaps the method could return a chain of references as a From a practical perspective, this is to prevent that unrelated callers start spamming these messages for no good reason. |
|
I marked this as stale due to inactivity. → More info |
|
|
||
| if (state.roots.count(path)) { | ||
| debug("cannot delete '%1%' because it's a root", printStorePath(path)); | ||
| printInfo("need '%1%' because it's a root", printStorePath(path)); |
There was a problem hiding this comment.
I agree with what @roberth said.
Let's return something like:
struct DeadAlready {};
struct IsRoot {};
struct RootedBy { StorePath root; };
typedef std::variant<DeadAlready, IsRoot, RootedBy> OptLiveness;to indicate why.
state.alive can likewise be a map of:
typedef std::variant<IsRoot, RootedBy> Liveness;Making OptLiveness be std::optional<Liveness> is fine me too.
|
Shut up bot. |
|
Is this dead? |
If it's a store path, who knows ;) I don't think anyone should feel inhibited to work on solving this problem. To make this more actionable, I think an improved solution could perform a graph search on the retrieved dependency edges, and report the path in the thrown exception. That's perhaps a bit easier to manage than reporting all the data internally and then still having to implement such logic in the CLI. (fwiw I wasn't a maintainer yet when I reviewed this; this was from before the Nix team) |
|
I would love to work on and learn more about how Nix works internally, but honestly I don't have the time. |
Fixes #1810
The output looks like this: