mirror of
https://github.com/NixOS/nix.git
synced 2025-11-09 03:56:01 +01:00
Use member initializer list for Derivation*Goal::drv
This commit is contained in:
parent
ba7bbcd1da
commit
a629ce3dec
2 changed files with 4 additions and 5 deletions
|
|
@ -27,16 +27,15 @@
|
||||||
namespace nix {
|
namespace nix {
|
||||||
|
|
||||||
DerivationBuildingGoal::DerivationBuildingGoal(
|
DerivationBuildingGoal::DerivationBuildingGoal(
|
||||||
const StorePath & drvPath, const Derivation & drv_, Worker & worker, BuildMode buildMode)
|
const StorePath & drvPath, const Derivation & drv, Worker & worker, BuildMode buildMode)
|
||||||
: Goal(worker, gaveUpOnSubstitution())
|
: Goal(worker, gaveUpOnSubstitution())
|
||||||
, drvPath(drvPath)
|
, drvPath(drvPath)
|
||||||
|
, drv{std::make_unique<Derivation>(drv)}
|
||||||
, buildMode(buildMode)
|
, buildMode(buildMode)
|
||||||
{
|
{
|
||||||
drv = std::make_unique<Derivation>(drv_);
|
|
||||||
|
|
||||||
try {
|
try {
|
||||||
drvOptions =
|
drvOptions =
|
||||||
std::make_unique<DerivationOptions>(DerivationOptions::fromStructuredAttrs(drv->env, drv->structuredAttrs));
|
std::make_unique<DerivationOptions>(DerivationOptions::fromStructuredAttrs(drv.env, drv.structuredAttrs));
|
||||||
} catch (Error & e) {
|
} catch (Error & e) {
|
||||||
e.addTrace({}, "while parsing derivation '%s'", worker.store.printStorePath(drvPath));
|
e.addTrace({}, "while parsing derivation '%s'", worker.store.printStorePath(drvPath));
|
||||||
throw;
|
throw;
|
||||||
|
|
|
||||||
|
|
@ -33,6 +33,7 @@ DerivationGoal::DerivationGoal(
|
||||||
: Goal(worker, haveDerivation())
|
: Goal(worker, haveDerivation())
|
||||||
, drvPath(drvPath)
|
, drvPath(drvPath)
|
||||||
, wantedOutput(wantedOutput)
|
, wantedOutput(wantedOutput)
|
||||||
|
, drv{std::make_unique<Derivation>(drv)}
|
||||||
, outputHash{[&] {
|
, outputHash{[&] {
|
||||||
auto outputHashes = staticOutputHashes(worker.evalStore, drv);
|
auto outputHashes = staticOutputHashes(worker.evalStore, drv);
|
||||||
if (auto * mOutputHash = get(outputHashes, wantedOutput))
|
if (auto * mOutputHash = get(outputHashes, wantedOutput))
|
||||||
|
|
@ -41,7 +42,6 @@ DerivationGoal::DerivationGoal(
|
||||||
}()}
|
}()}
|
||||||
, buildMode(buildMode)
|
, buildMode(buildMode)
|
||||||
{
|
{
|
||||||
this->drv = std::make_unique<Derivation>(drv);
|
|
||||||
|
|
||||||
name = fmt("getting output '%s' from derivation '%s'", wantedOutput, worker.store.printStorePath(drvPath));
|
name = fmt("getting output '%s' from derivation '%s'", wantedOutput, worker.store.printStorePath(drvPath));
|
||||||
trace("created");
|
trace("created");
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue