@@ -151,6 +151,33 @@ std::string showKnownOutputs(Store & store, const Derivation & drv)
151
151
produced using a substitute. So we have to build instead. */
152
152
Goal::Co DerivationBuildingGoal::gaveUpOnSubstitution ()
153
153
{
154
+ /* Recheck at goal start. In particular, whereas before we were
155
+ given this information by the downstream goal, that cannot happen
156
+ anymore if the downstream goal only cares about one output, but
157
+ we care about all outputs. */
158
+ auto outputHashes = staticOutputHashes (worker.evalStore , *drv);
159
+ for (auto & [outputName, outputHash] : outputHashes) {
160
+ InitialOutput v{
161
+ .wanted = true , // Will be refined later
162
+ .outputHash = outputHash};
163
+
164
+ /* TODO we might want to also allow randomizing the paths
165
+ for regular CA derivations, e.g. for sake of checking
166
+ determinism. */
167
+ if (drv->type ().isImpure ()) {
168
+ v.known = InitialOutputStatus{
169
+ .path = StorePath::random (outputPathName (drv->name , outputName)),
170
+ .status = PathStatus::Absent,
171
+ };
172
+ }
173
+
174
+ initialOutputs.insert ({
175
+ outputName,
176
+ std::move (v),
177
+ });
178
+ }
179
+ checkPathValidity ();
180
+
154
181
Goals waitees;
155
182
156
183
std::map<ref<const SingleDerivedPath>, GoalPtr, value_comparison> inputGoals;
0 commit comments