Fix build

This commit is contained in:
Eelco Dolstra 2020-02-14 22:45:33 +01:00
parent 6208d24c38
commit 46a284263f
3 changed files with 12 additions and 12 deletions

View file

@ -240,8 +240,8 @@ static Flake getFlake(
edition = vInfo.attrs->get(sEpoch); edition = vInfo.attrs->get(sEpoch);
if (edition) { if (edition) {
expectType(state, tInt, *(**edition).value, *(**edition).pos); expectType(state, tInt, *edition->value, *edition->pos);
flake.edition = (**edition).value->integer; flake.edition = edition->value->integer;
if (flake.edition > 201909) if (flake.edition > 201909)
throw Error("flake '%s' requires unsupported edition %d; please upgrade Nix", lockedRef, flake.edition); throw Error("flake '%s' requires unsupported edition %d; please upgrade Nix", lockedRef, flake.edition);
if (flake.edition < 201909) if (flake.edition < 201909)
@ -250,20 +250,20 @@ static Flake getFlake(
throw Error("flake '%s' lacks attribute 'edition'", lockedRef); throw Error("flake '%s' lacks attribute 'edition'", lockedRef);
if (auto description = vInfo.attrs->get(state.sDescription)) { if (auto description = vInfo.attrs->get(state.sDescription)) {
expectType(state, tString, *(**description).value, *(**description).pos); expectType(state, tString, *description->value, *description->pos);
flake.description = (**description).value->string.s; flake.description = description->value->string.s;
} }
auto sInputs = state.symbols.create("inputs"); auto sInputs = state.symbols.create("inputs");
if (std::optional<Attr *> inputs = vInfo.attrs->get(sInputs)) if (auto inputs = vInfo.attrs->get(sInputs))
flake.inputs = parseFlakeInputs(state, (**inputs).value, *(**inputs).pos); flake.inputs = parseFlakeInputs(state, inputs->value, *inputs->pos);
auto sOutputs = state.symbols.create("outputs"); auto sOutputs = state.symbols.create("outputs");
if (auto outputs = vInfo.attrs->get(sOutputs)) { if (auto outputs = vInfo.attrs->get(sOutputs)) {
expectType(state, tLambda, *(**outputs).value, *(**outputs).pos); expectType(state, tLambda, *outputs->value, *outputs->pos);
flake.vOutputs = (**outputs).value; flake.vOutputs = outputs->value;
if (flake.vOutputs->lambda.fun->matchAttrs) { if (flake.vOutputs->lambda.fun->matchAttrs) {
for (auto & formal : flake.vOutputs->lambda.fun->formals->formals) { for (auto & formal : flake.vOutputs->lambda.fun->formals->formals) {

View file

@ -134,9 +134,9 @@ static void enumerateOutputs(EvalState & state, Value & vFlake,
auto aOutputs = vFlake.attrs->get(state.symbols.create("outputs")); auto aOutputs = vFlake.attrs->get(state.symbols.create("outputs"));
assert(aOutputs); assert(aOutputs);
state.forceAttrs(*(*aOutputs)->value); state.forceAttrs(*aOutputs->value);
for (auto & attr : *((*aOutputs)->value->attrs)) for (auto & attr : *aOutputs->value->attrs)
callback(attr.name, *attr.value, *attr.pos); callback(attr.name, *attr.value, *attr.pos);
} }

View file

@ -330,9 +330,9 @@ Value * InstallableFlake::getFlakeOutputs(EvalState & state, const flake::Locked
auto aOutputs = vFlake->attrs->get(state.symbols.create("outputs")); auto aOutputs = vFlake->attrs->get(state.symbols.create("outputs"));
assert(aOutputs); assert(aOutputs);
state.forceValue(*(*aOutputs)->value); state.forceValue(*aOutputs->value);
return (*aOutputs)->value; return aOutputs->value;
} }
std::tuple<std::string, FlakeRef, flake::EvalCache::Derivation> InstallableFlake::toDerivation() std::tuple<std::string, FlakeRef, flake::EvalCache::Derivation> InstallableFlake::toDerivation()