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
Generalize isFixedOutput
in preparation for CA drvs
#3418
Conversation
Today's fixed output derivations and regular derivations differ in a few ways which are largely orthogonal. This replaces `isFixedOutput` with a `type` that returns an enum of possible combinations.
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.
Just some typos in comments.
Thanks @asymmetric! Co-Authored-By: asymmetric <lorenzo@mailbox.org>
Thanks @asymmetric I failed to do them all in one batch Co-Authored-By: asymmetric <lorenzo@mailbox.org>
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.
A couple of comments on this, but overall 👍
@regnat Thanks for the review, should all be fixed now. |
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.
Looks good now 👍
When we merge with master, the new lack of string types make this case impossible (after parsing). Later, when we actually implemenent CA-derivations, we'll change the types to allow that.
src/libstore/derivations.cc
Outdated
}; | ||
// Since enums can have non-variant values, but making a `default:` would | ||
// disable exhaustiveness warnings. | ||
abort(); |
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.
Could you change this to assert(false)
? That way, if we ever hit this assertion, we get an error message with location info.
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.
That's changed now, thanks
There's a merge conflict in derivations.cc. |
Today's fixed output derivations and regular derivations differ in a few
ways which are largely orthogonal. This replaces
isFixedOutput
with atype
that returns an enum of possible combinations.I think this is basically a tech debt PR --- our plans could change a lot but it's still nice to decompose
isFixedOutput
to make the code, especiallybuild.cc
easier to read.CC @regnat @edolstra