NixOS / nix

Nix, the purely functional package manager
https://nixos.org/
GNU Lesser General Public License v2.1
12.9k stars 1.53k forks source link

Rename content-addressed derivations's "realisation" to "build trace" #11895

Open Ericson2314 opened 1 week ago

Ericson2314 commented 1 week ago

"realisation" is a bad term because we already use it for other things (building, including input-addressed derivations) and because it is vague.

The term in https://www.microsoft.com/en-us/research/uploads/prod/2018/03/build-systems.pdf and https://cloud.ins.jku.at/index.php/s/txgoHps6FyNpiDk "trace"; we should use that instead, in documentation and code.

mschwaig commented 1 week ago

closes https://github.com/NixOS/nix/issues/7254, which has some alternative suggestions

edolstra commented 1 week ago

"Realisation" is not a great term, but "trace" is no better, IMHO. It really tells me nothing about what it is.

Ericson2314 commented 1 week ago

How about throwing on an adjective, like "build trace"? That's getting clearer. I want it to be something involving "trace" in order to stay connected to the literature.

roberth commented 1 week ago

Ambiguous with --show-trace

Ericson2314 commented 5 days ago

Fair point. Well then there we go: build trace vs eval trace! There are enough simularities that I am glad both use "trace".

mschwaig commented 4 days ago

Another alternative name that is a bit more distrinct would be kvtrace, with the k and v standing for key and value. That highlights how each kvtrace represents an entry in a map from build inputs to build outputs.

Ericson2314 commented 1 day ago

Maybe the whole thing should be called "build trace" or "build trace map"? and an individual one is a "build trace kv pair"?

roberth commented 3 hours ago

We might actually be talking about two representations for information about builds.

Excuse my ignorance about undocumented features, but I believe the prior is a realisation, whereas the latter is the more useful and accurate concept for reasoning about build inputs, and perhaps this is the mapping that deserves to be called a build trace? These concepts convey largely the same information, but they give rise to a slightly different data model (or different part of a data model).

To make the distinction a bit more concrete, consider a derivation graph where one of the derivations has an unused testresults output, containing a timestamp. By comparing realisations, you would falsely flag a frankenbuild, whereas a set of traces would accurately report "no frankenbuild", because none of the impure outputs were used.