File tree Expand file tree Collapse file tree 2 files changed +11
-9
lines changed Expand file tree Collapse file tree 2 files changed +11
-9
lines changed Original file line number Diff line number Diff line change @@ -33,7 +33,13 @@ DerivationGoal::DerivationGoal(
33
33
: Goal(worker, haveDerivation())
34
34
, drvPath(drvPath)
35
35
, wantedOutput(wantedOutput)
36
- , outputHash{Hash::dummy} // will be updated
36
+ , outputHash{[&] {
37
+ if (auto * mOutputHash = get (staticOutputHashes (worker.evalStore , drv), wantedOutput))
38
+ return *mOutputHash ;
39
+ else
40
+ throw Error (
41
+ " derivation '%s' does not have output '%s'" , worker.store .printStorePath (drvPath), wantedOutput);
42
+ }()}
37
43
, buildMode(buildMode)
38
44
{
39
45
this ->drv = std::make_unique<Derivation>(drv);
@@ -79,10 +85,6 @@ Goal::Co DerivationGoal::haveDerivation()
79
85
if (i.second .second )
80
86
worker.store .addTempRoot (*i.second .second );
81
87
82
- if (auto * mOutputHash = get (staticOutputHashes (worker.evalStore , *drv), wantedOutput)) {
83
- outputHash = *mOutputHash ;
84
- }
85
-
86
88
/* We don't yet have any safe way to cache an impure derivation at
87
89
this step. */
88
90
if (drv->type ().isImpure ()) {
Original file line number Diff line number Diff line change @@ -70,14 +70,14 @@ private:
70
70
*/
71
71
std::unique_ptr<Derivation> drv;
72
72
73
+ const Hash outputHash;
74
+
75
+ const BuildMode buildMode;
76
+
73
77
/* *
74
78
* The remainder is state held during the build.
75
79
*/
76
80
77
- Hash outputHash;
78
-
79
- BuildMode buildMode;
80
-
81
81
std::unique_ptr<MaintainCount<uint64_t >> mcExpectedBuilds;
82
82
83
83
/* *
You can’t perform that action at this time.
0 commit comments