mirror of
https://github.com/NixOS/nix.git
synced 2025-10-14 02:19:32 +08:00
Use member initializer list for Derivation*Goal::drv
This commit is contained in:
@@ -27,16 +27,15 @@
|
||||
namespace nix {
|
||||
|
||||
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())
|
||||
, drvPath(drvPath)
|
||||
, drv{std::make_unique<Derivation>(drv)}
|
||||
, buildMode(buildMode)
|
||||
{
|
||||
drv = std::make_unique<Derivation>(drv_);
|
||||
|
||||
try {
|
||||
drvOptions =
|
||||
std::make_unique<DerivationOptions>(DerivationOptions::fromStructuredAttrs(drv->env, drv->structuredAttrs));
|
||||
std::make_unique<DerivationOptions>(DerivationOptions::fromStructuredAttrs(drv.env, drv.structuredAttrs));
|
||||
} catch (Error & e) {
|
||||
e.addTrace({}, "while parsing derivation '%s'", worker.store.printStorePath(drvPath));
|
||||
throw;
|
||||
|
@@ -33,6 +33,7 @@ DerivationGoal::DerivationGoal(
|
||||
: Goal(worker, haveDerivation())
|
||||
, drvPath(drvPath)
|
||||
, wantedOutput(wantedOutput)
|
||||
, drv{std::make_unique<Derivation>(drv)}
|
||||
, outputHash{[&] {
|
||||
auto outputHashes = staticOutputHashes(worker.evalStore, drv);
|
||||
if (auto * mOutputHash = get(outputHashes, wantedOutput))
|
||||
@@ -41,7 +42,6 @@ DerivationGoal::DerivationGoal(
|
||||
}()}
|
||||
, buildMode(buildMode)
|
||||
{
|
||||
this->drv = std::make_unique<Derivation>(drv);
|
||||
|
||||
name = fmt("getting output '%s' from derivation '%s'", wantedOutput, worker.store.printStorePath(drvPath));
|
||||
trace("created");
|
||||
|
Reference in New Issue
Block a user