-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Document Derivations and Deriving Paths #12290
base: master
Are you sure you want to change the base?
Conversation
And get rid of "store derivation" nonsense.
It is not a language topic.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Big one :)
So far, we have covered "inert" [store objects][store object]. | ||
But the point of the Nix store layer is to be a build system. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did we? Not sure how the reader lands here. I guess we could make So far
a link, but how about:
So far, we have covered "inert" [store objects][store object]. | |
But the point of the Nix store layer is to be a build system. | |
Besides functioning as a [content addressed store] the Nix store layer works as a [build system]. |
(my links and link targets need work, sorry)
doc/manual/source/store/drv.md
Outdated
Other system (like Git or IPFS) also store and transfer immutable data, but they don't concern themselves with *how* that data was created. | ||
|
||
This is where Nix distinguishes itself. | ||
*Derivations* represent individual build steps, and *deriving paths* are needed to to the *outputs* of those build steps. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
*Derivations* represent individual build steps, and *deriving paths* are needed to to the *outputs* of those build steps. | |
*Derivations* represent individual build steps, and *deriving paths* are needed to refer to the *outputs* of those build steps. |
|
||
This is where Nix distinguishes itself. | ||
*Derivations* represent individual build steps, and *deriving paths* are needed to to the *outputs* of those build steps. | ||
The two concepts need to be introduced together because, as described below, each depends on the other. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The two concepts need to be introduced together because, as described below, each depends on the other. | |
<!-- The two concepts need to be introduced together because, as described below, each depends on the other. --> |
Sounds like it's relevant to editors, mostly.
|
||
A derivation is a specification for running an executable on precisely defined input files to repeatably produce output files at uniquely determined file system paths. | ||
|
||
What is natural Unix analog for a build step *in action*? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is natural Unix analog for a build step *in action*? | |
What is the natural Unix analog for a build step *in action*? |
A derivation is a specification for running an executable on precisely defined input files to repeatably produce output files at uniquely determined file system paths. | ||
|
||
What is natural Unix analog for a build step *in action*? | ||
Answer: a process that will eventually exit, leaving behind some output date. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Answer: a process that will eventually exit, leaving behind some output date. | |
Answer: a process that will eventually exit, leaving behind some output files. |
We're talking vague Unix, so everything is a file, and that's good enough, and better than data.
} | ||
``` | ||
|
||
Now, the `drv` field of `Output` is itself a `DerivingPath` instead of an `StorePath`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Now, the `drv` field of `Output` is itself a `DerivingPath` instead of an `StorePath`. | |
Now, the `drv` field of `Output` is itself a `DerivingPath` instead of a `StorePath`. |
|
||
### Encoding {#deriving-path-encoding} | ||
|
||
The encoding is adjusted in a very simplest way, merely displaying the same |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TODO
|
||
### `__structuredAttrs` | ||
|
||
Historically speaking, most users of Nix made GNU Bash with a script the command run, regardless of what they were doing. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here the text some work needs
However, since derivations can already contain arbitary input sources, the vast majority of `__structuredAttrs` can be handled by upper layers. | ||
We might consider implementing `__structuredAttrs` in higher layers in the future, and simplifying the store layer. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
However, since derivations can already contain arbitary input sources, the vast majority of `__structuredAttrs` can be handled by upper layers. | |
We might consider implementing `__structuredAttrs` in higher layers in the future, and simplifying the store layer. |
This should be an issue, and not docs.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note to self: resume here.
Motivation
Continue documenting the store layer
Context
Some material pulled from #6877
Add 👍 to pull requests you find important.
The Nix maintainer team uses a GitHub project board to schedule and track reviews.