Open Ericson2314 opened 7 years ago
One thing that would be nice to toggle is whether to recur into derivations or just treat them as an atom. Ideally I'd be able to say "always atomic" "never atomic" or "non-atomic for n derivations deep".
Several times I diffed the *.drv files and "recursed manually" into suspicious differences. Some tool for this would be nice to have, though I suspect it would be tricky to cover more complex cases reasonably...
Wouldn't something using toJSON
(or toXML
, but this would probably be less readable) and then a json diffing tool be sufficient for most cases and simpler to implement than rewriting this in nix ?
Of course the call to toJSON
would still need to be wrapped to prevent unwanted stuff from being evaluated − if you want to diff the entire nixpkgs repo for example −, but that should be feasible I think
@regnat Good point. I was going to raise a concern about laziness and cycles, but that is a problem with my original proposal too. Pruning at a certain depth (or, even better, an attempt to break cycles along the lines of the infinite recursion check) would solve that.
I marked this as stale due to inactivity. → More info
I closed this issue due to inactivity. → More info
When doing my nixpkgs refactors, I'm often trying to avoid changing any hashes. To help me diagnose why a hash changes, it would be really nice to be able to compare two nix values and do a tree diff.
For example, comparing
{ a = { q = null; }; }
and{ a = { }; b = [ 2 ]; }
, I'd love something like:It's possible a nixpkgs lib function would suffice, in which case I'll reopen the issue there.