Navigation Menu

Skip to content
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

Merged
merged 13 commits into from Aug 5, 2020

Conversation

Ericson2314
Copy link
Member

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.

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, especially build.cc easier to read.

CC @regnat @edolstra

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.
Copy link
Contributor

@asymmetric asymmetric left a 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.

src/libstore/build.cc Outdated Show resolved Hide resolved
src/libstore/local-store.cc Outdated Show resolved Hide resolved
src/libstore/local-store.cc Outdated Show resolved Hide resolved
Ericson2314 and others added 2 commits March 16, 2020 16:40
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>
Copy link
Member

@thufschmitt thufschmitt left a 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 👍

src/libstore/derivations.hh Show resolved Hide resolved
src/libstore/local-store.cc Outdated Show resolved Hide resolved
src/libstore/build.cc Outdated Show resolved Hide resolved
@Ericson2314
Copy link
Member Author

@regnat Thanks for the review, should all be fixed now.

Copy link
Member

@thufschmitt thufschmitt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good now 👍

@Ericson2314
Copy link
Member Author

OK conflicts removed. @edolstra Have fixed all your concerns, and @regnat is happy with it too.

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.
@Ericson2314
Copy link
Member Author

Ericson2314 commented Jul 2, 2020

@edolstra might we get this merged soon? I hope to soon propose some of the data definition changes I was thinking for ca-derivations, especially now that @regnat is making good progress.

};
// Since enums can have non-variant values, but making a `default:` would
// disable exhaustiveness warnings.
abort();
Copy link
Member

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.

Copy link
Member

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

@edolstra
Copy link
Member

There's a merge conflict in derivations.cc.

@Ericson2314
Copy link
Member Author

Ericson2314 commented Jul 28, 2020

@edolstra were fixing it, but I recommend you just merge #3807 and afterwords #3830. #3830 includes this and #3424, and resolves the 3-way conflicts in some non-trivial ways.

@edolstra edolstra merged commit df707d0 into NixOS:master Aug 5, 2020
@Ericson2314 Ericson2314 deleted the ca-drv branch August 5, 2020 15:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants