-
-
Notifications
You must be signed in to change notification settings - Fork 9
Open
Description
Not an issue, but a possibly useful transformer that might be nice to have.
I've been playing around with haumea and whilst trying to debug some dependencies had the idea for a tracing dependencies by using the following transformer:
cursor: mod: builtins.mapAttrs (n: v: builtins.trace "eval ${lib.strings.concatStringsSep "." (cursor ++ [n])}" v) mod;
This will produce a haumea tree that will output evaluation traces for all module accesses, which you could use in conjunction with nix repl to easily figure out all the dependencies of an attribute:
So if you had a haumea tree like (not actually evaluable, just shorthand):
foo = {
bar = 5;
baz = {
something = root.foo.bar + 1;
}
}
Running nix repl -f haumea_tree.nix foo.baz.something would produce the trace of:
trace: eval foo
trace: eval foo.baz
trace: eval foo.baz.something
trace: eval foo
trace: eval foo.bar
Metadata
Metadata
Assignees
Labels
No labels