Skip to content
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

Provenance, aka “where did this attribute come from” #235

Open
Profpatsch opened this issue Dec 3, 2020 · 2 comments
Open

Provenance, aka “where did this attribute come from” #235

Profpatsch opened this issue Dec 3, 2020 · 2 comments

Comments

@Profpatsch
Copy link

Profpatsch commented Dec 3, 2020

One use-case for nixpkgs overlays I just had: We define an overlay of pkgs where we override and add some packages.
I just went directly to nixpkgs to see the definition of a package, totally missing that we had overridden it locally.

It would be nice if there was a “stack trace” of sorts that can show how attributes “came to be”, aka where they were added/changed. I don’t know how feasable that is.

So, for example, file A defines:

{ foo = 32; }

file B says:

(import A) & { foo = self.foo + 10 }

And if I tell nickel: “show me the provenance of foo in B”:

A.ncl:1 foo = 32
B.ncl:1 foo = 42

or somesuch.

This uses the proposed self feature to do self-recursion with merges, but of course could be adapted to other ways of recursion.

@yannham
Copy link
Member

yannham commented Dec 4, 2020

This wouldn't be hard to do I think, using metavalues to store this information, without much overhead. Then the query sub-command could show this information along the value.

(import A) & { foo = self.foo + 10 }

As a side note, I don't see a way of interpreting this other than an infinite loop, but I get what you meant.

@Profpatsch
Copy link
Author

Profpatsch commented Dec 15, 2020 via email

@settings settings bot removed the enhancement label May 31, 2021
@yannham yannham added this to the Next major (1.0) milestone Feb 9, 2023
@yannham yannham removed this from the Next major (1.0) milestone Feb 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants