aboutsummaryrefslogtreecommitdiff
path: root/src/libexpr/primops.cc
diff options
context:
space:
mode:
authorJohn Ericson <John.Ericson@Obsidian.Systems>2023-08-16 12:29:23 -0400
committerJohn Ericson <John.Ericson@Obsidian.Systems>2023-08-18 11:44:00 -0400
commit9121fed4b4d02c286166373fe9805773afb13694 (patch)
tree195ec159fde2c2b2e81b8270101f2c37f38e097c /src/libexpr/primops.cc
parent284c18073233b3c7e7e027d696465a0e773dc881 (diff)
Fixing #7479
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 #8829 can make it non-optional again because it will ensure we always have the derivation when we construct a `DerivationGoal`. See that issue (#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>
Diffstat (limited to 'src/libexpr/primops.cc')
-rw-r--r--src/libexpr/primops.cc14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/libexpr/primops.cc b/src/libexpr/primops.cc
index 283f99a48..5067da449 100644
--- a/src/libexpr/primops.cc
+++ b/src/libexpr/primops.cc
@@ -69,7 +69,7 @@ StringMap EvalState::realiseContext(const NixStringContext & context)
res.insert_or_assign(ctxS, ctxS);
ensureValid(d.drvPath);
},
- }, c.raw());
+ }, c.raw);
}
if (drvs.empty()) return {};
@@ -1265,7 +1265,7 @@ drvName, Bindings * attrs, Value & v)
[&](const NixStringContextElem::Opaque & o) {
drv.inputSrcs.insert(o.path);
},
- }, c.raw());
+ }, c.raw);
}
/* Do we have all required attributes? */
@@ -1334,13 +1334,13 @@ drvName, Bindings * attrs, Value & v)
if (isImpure)
drv.outputs.insert_or_assign(i,
DerivationOutput::Impure {
- .method = method.raw,
+ .method = method,
.hashType = ht,
});
else
drv.outputs.insert_or_assign(i,
DerivationOutput::CAFloating {
- .method = method.raw,
+ .method = method,
.hashType = ht,
});
}
@@ -1373,7 +1373,7 @@ drvName, Bindings * attrs, Value & v)
drv.env[i] = state.store->printStorePath(outPath);
drv.outputs.insert_or_assign(
i,
- DerivationOutputInputAddressed {
+ DerivationOutput::InputAddressed {
.path = std::move(outPath),
});
}
@@ -1381,7 +1381,7 @@ drvName, Bindings * attrs, Value & v)
;
case DrvHash::Kind::Deferred:
for (auto & i : outputs) {
- drv.outputs.insert_or_assign(i, DerivationOutputDeferred {});
+ drv.outputs.insert_or_assign(i, DerivationOutput::Deferred {});
}
}
}
@@ -2054,7 +2054,7 @@ static void prim_toFile(EvalState & state, const PosIdx pos, Value * * args, Val
StorePathSet refs;
for (auto c : context) {
- if (auto p = std::get_if<NixStringContextElem::Opaque>(&c))
+ if (auto p = std::get_if<NixStringContextElem::Opaque>(&c.raw))
refs.insert(p->path);
else
state.debugThrowLastTrace(EvalError({