DerivationOutputExtensional -> DerivationOutputInputAddressed

Thanks @regnat for the great name.
This commit is contained in:
John Ericson 2020-07-12 15:56:20 +00:00
parent a8d4707107
commit 503b425690
4 changed files with 8 additions and 8 deletions

View file

@ -806,7 +806,7 @@ static void prim_derivationStrict(EvalState & state, const Pos & pos, Value * *
if (!jsonObject) drv.env[i] = ""; if (!jsonObject) drv.env[i] = "";
drv.outputs.insert_or_assign(i, drv.outputs.insert_or_assign(i,
DerivationOutput { DerivationOutput {
.output = DerivationOutputExtensional { .output = DerivationOutputInputAddressed {
.path = StorePath::dummy, .path = StorePath::dummy,
}, },
}); });
@ -819,7 +819,7 @@ static void prim_derivationStrict(EvalState & state, const Pos & pos, Value * *
if (!jsonObject) drv.env[i] = state.store->printStorePath(outPath); if (!jsonObject) drv.env[i] = state.store->printStorePath(outPath);
drv.outputs.insert_or_assign(i, drv.outputs.insert_or_assign(i,
DerivationOutput { DerivationOutput {
.output = DerivationOutputExtensional { .output = DerivationOutputInputAddressed {
.path = std::move(outPath), .path = std::move(outPath),
}, },
}); });

View file

@ -15,7 +15,7 @@ template<class... Ts> overloaded(Ts...) -> overloaded<Ts...>;
StorePath DerivationOutput::path(const Store & store, std::string_view drvName) const StorePath DerivationOutput::path(const Store & store, std::string_view drvName) const
{ {
return std::visit(overloaded { return std::visit(overloaded {
[](DerivationOutputExtensional doi) { [](DerivationOutputInputAddressed doi) {
return doi.path; return doi.path;
}, },
[&](DerivationOutputFixed dof) { [&](DerivationOutputFixed dof) {
@ -142,7 +142,7 @@ static DerivationOutput parseDerivationOutput(const Store & store, istringstream
}; };
} else } else
return DerivationOutput { return DerivationOutput {
.output = DerivationOutputExtensional { .output = DerivationOutputInputAddressed {
.path = std::move(path), .path = std::move(path),
} }
}; };
@ -450,7 +450,7 @@ static DerivationOutput readDerivationOutput(Source & in, const Store & store)
}; };
} else } else
return DerivationOutput { return DerivationOutput {
.output = DerivationOutputExtensional { .output = DerivationOutputInputAddressed {
.path = std::move(path), .path = std::move(path),
} }
}; };

View file

@ -13,7 +13,7 @@ namespace nix {
/* Abstract syntax of derivations. */ /* Abstract syntax of derivations. */
struct DerivationOutputExtensional struct DerivationOutputInputAddressed
{ {
StorePath path; StorePath path;
}; };
@ -25,7 +25,7 @@ struct DerivationOutputFixed
struct DerivationOutput struct DerivationOutput
{ {
std::variant<DerivationOutputExtensional, DerivationOutputFixed> output; std::variant<DerivationOutputInputAddressed, DerivationOutputFixed> output;
StorePath path(const Store & store, std::string_view drvName) const; StorePath path(const Store & store, std::string_view drvName) const;
}; };

View file

@ -135,7 +135,7 @@ StorePath getDerivationEnvironment(ref<Store> store, const StorePath & drvPath)
drv.inputSrcs.insert(std::move(getEnvShPath)); drv.inputSrcs.insert(std::move(getEnvShPath));
Hash h = hashDerivationModulo(*store, drv, true); Hash h = hashDerivationModulo(*store, drv, true);
auto shellOutPath = store->makeOutputPath("out", h, drvName); auto shellOutPath = store->makeOutputPath("out", h, drvName);
drv.outputs.insert_or_assign("out", DerivationOutput { .output = DerivationOutputExtensional { drv.outputs.insert_or_assign("out", DerivationOutput { .output = DerivationOutputInputAddressed {
.path = shellOutPath .path = shellOutPath
} }); } });
drv.env["out"] = store->printStorePath(shellOutPath); drv.env["out"] = store->printStorePath(shellOutPath);