-
-
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
Refactor Raw pattern, part of #7479 #8839
Conversation
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 apart from the macOS build failure.
@@ -195,7 +195,7 @@ void LocalDerivationGoal::tryLocalBuild() | |||
else if (settings.sandboxMode == smDisabled) | |||
useChroot = false; | |||
else if (settings.sandboxMode == smRelaxed) | |||
useChroot = derivationType.isSandboxed() && !noChroot; | |||
useChroot = derivationType->isSandboxed() && !noChroot; |
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.
Better to use derivationType().value()
here, since it's not obvious whether derivationType
is initialized. (An assertion failure would be better than an exception though...)
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.
Good idea, I just added one a few lines above.
a6dbd66
to
fedcd53
Compare
Types converted: - `NixStringContextElem` - `OutputsSpec` - `ExtendedOutputsSpec` - `DerivationOutput` - `DerivationType` Existing ones mostly conforming the pattern cleaned up: - `ContentAddressMethod` - `ContentAddressWithReferences` The `DerivationGoal::derivationType` field had a bogus initialization, now caught, so I made it `std::optional`. I think NixOS#8829 can make it non-optional again because it will ensure we always have the derivation when we construct a `DerivationGoal`. See that issue (NixOS#7479) for details on the general goal. `git grep 'Raw::Raw'` indicates the two types I didn't yet convert `DerivedPath` and `BuiltPath` (and their `Single` variants) . This is because @roberth and I (can't find issue right now...) plan on reworking them somewhat, so I didn't want to churn them more just yet. Co-authored-by: Eelco Dolstra <edolstra@gmail.com>
fedcd53
to
9121fed
Compare
Motivation
Types converted:
NixStringContextElem
OutputsSpec
ExtendedOutputsSpec
DerivationOutput
DerivationType
Existing ones mostly conforming the pattern cleaned up:
ContentAddressMethod
ContentAddressWithReferences
The
DerivationGoal::derivationType
field had a bogus initialization, now caught, so I made itstd::optional
. I think #8829 can make it non-optional again because it will ensure we always have the derivation when we construct aDerivationGoal
.Context
See #7479 for details.
git grep 'Raw::Raw'
indicates the two types I didn't yet convertDerivedPath
andBuiltPath
(and theirSingle
variants) . This is because @roberth and I (can't find issue right now...) plan on reworking them somewhat, so I didn't want to churn them more just yet.Checklist for maintainers
Maintainers: tick if completed or explain if not relevant
tests/**.sh
src/*/tests
tests/nixos/*
Priorities
Add 👍 to pull requests you find important.