-
-
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
Introduce DerivationOptions
#12292
base: master
Are you sure you want to change the base?
Introduce DerivationOptions
#12292
Conversation
3555ae5
to
6b6529b
Compare
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 like the idea, but I haven't reviewed thoroughly for correctness
* format), we have the option of instead storing the options | ||
* separately. That would be nice to separate concerns, and not make any | ||
* environment variable names magical. | ||
*/ |
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.
Is it meant to be a lossless representation of part of the derivation, or is it supposed to represent part of the derivation semantically uniquely?
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.
Ah yes it is supposed to reflect the semantics, not the syntax.
In other words, there will not be a DerivationOptions -> Env
function; instead, the ATerm logic will (eventually):
- Check that the options are implied by the rest of the
Derivation
- Since the check passed, safely ignore the (eventual new)
DerivationOptions options;
field of the derivation as superfluous - Serialize as today
So yes let's do these changes.
struct Checks | ||
{ | ||
bool ignoreSelfRefs = false; | ||
std::optional<uint64_t> maxSize, maxClosureSize; | ||
std::optional<Strings> allowedReferences, allowedRequisites, disallowedReferences, disallowedRequisites; | ||
}; | ||
|
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.
Nice
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 |
6b6529b
to
5e9e7d7
Compare
This is a first step towards PR NixOS#10760, and the issues it addresses. See the Doxygen for details. Thanks to these changes, we are able to drastically restrict how the rest of the code-base uses `ParseDerivation`. Co-Authored-By: HaeNoe <[email protected]>
5e9e7d7
to
ba2b140
Compare
Motivation
See the Doxygen for details.
Thanks to these changes, we are able to drastically restrict how the rest of the code-base uses
ParseDerivation
.Context
This is a first step towards PR #10760, and the issues it addresses.
Add 👍 to pull requests you find important.
The Nix maintainer team uses a GitHub project board to schedule and track reviews.
CC @haenoe, who co-authored this.