-
-
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
|
||
### `__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
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.
I am just going to delete this, because it is too explanation-y, and there are langauge docs we can move to store docs for this (in a subsequent PR!).
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.
Thanks!! Co-authored-by: Robert Hensing <[email protected]>
Each input must be [realised] prior to building the derivation in question. | ||
At that point, the derivation can be *normalized*, by replacing each input deriving path with its store path --- which we now know since we've realised it. | ||
|
||
## Builder Execution |
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.
This section is taken from the language derivation docs with no modification but link updates. It is moved here.
More can be written, but this will do for now.
It is too much of an explanation. There are other docs we can move here later in the language section already.
This pull request has been mentioned on NixOS Discourse. There might be relevant details there: https://discourse.nixos.org/t/2024-01-20-nix-team-meeting-minutes-209/59119/1 |
## Processing outputs | ||
|
||
If the builder exited successfully, the following steps happen in order to turn the output directories left behind by the builder into proper store objects: | ||
|
||
- **Normalize the file permissions** | ||
|
||
Nix sets the last-modified timestamp on all files | ||
in the build result to 1 (00:00:01 1/1/1970 UTC), sets the group to | ||
the default group, and sets the mode of the file to 0444 or 0555 | ||
(i.e., read-only, with execute permission enabled if the file was | ||
originally executable). Any possible `setuid` and `setgid` | ||
bits are cleared. | ||
|
||
> **Note** | ||
> | ||
> Setuid and setgid programs are not currently supported by Nix. | ||
> This is because the Nix archives used in deployment have no concept of ownership information, | ||
> and because it makes the build result dependent on the user performing the build. | ||
|
||
- **Calculate the references** | ||
|
||
Nix scans each output path for | ||
references to input paths by looking for the hash parts of the input | ||
paths. Since these are potential runtime dependencies, Nix registers | ||
them as dependencies of the output paths. | ||
|
||
Nix also scans for references to other outputs' paths in the same way, because outputs are allowed to refer to each other. | ||
If the outputs' references to each other form a cycle, this is an error, because the references of store objects much be acyclic. |
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.
OK actually this part was reworked a little bit
-
Added this heading
-
Flipped the order of the two bullets
-
Made part of the first one a Note
-
Added the second paragraph to the second about output references
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.