Fix tests on systems with a non-master git defaultBranch #1

Open
zebreus wants to merge 140 commits from fix-tests-without-master into main
5 changed files with 11 additions and 12 deletions
Showing only changes of commit 1caf2afb1d - Show all commits

View file

@ -184,6 +184,11 @@ struct DerivationGoal : public Goal
std::map<std::string, InitialOutput> initialOutputs;
/**
* Build result.
*/
BuildResult buildResult;
/**
* File descriptor for the log file.
*/

View file

@ -30,7 +30,7 @@ try {
/* If the derivation already exists, were done */
if (worker.store.queryRealisation(id)) {
co_return WorkResult{ecSuccess, std::move(buildResult)};
co_return WorkResult{ecSuccess};
}
subs = settings.useSubstitutes ? getDefaultSubstituters() : std::list<ref<Store>>();
@ -61,7 +61,7 @@ try {
/* Hack: don't indicate failure if there were no substituters.
In that case the calling derivation should just do a
build. */
co_return WorkResult{substituterFailed ? ecFailed : ecNoSubstituters, std::move(buildResult)};
co_return WorkResult{substituterFailed ? ecFailed : ecNoSubstituters};
}
sub = subs.front();
@ -142,7 +142,6 @@ try {
debug("The output path of the derivation output '%s' could not be substituted", id.to_string());
return {WorkResult{
nrNoSubstituters > 0 || nrIncompleteClosure > 0 ? ecIncompleteClosure : ecFailed,
std::move(buildResult),
}};
}
@ -155,7 +154,7 @@ try {
kj::Promise<Result<Goal::WorkResult>> DrvOutputSubstitutionGoal::finished() noexcept
try {
trace("finished");
return {WorkResult{ecSuccess, std::move(buildResult)}};
return {WorkResult{ecSuccess}};
} catch (...) {
return {std::current_exception()};
}

View file

@ -72,7 +72,7 @@ std::vector<KeyedBuildResult> Store::buildPathsWithResults(
std::vector<KeyedBuildResult> results;
for (auto & [req, goalPtr] : state)
results.emplace_back(goalPtr->buildResult.restrictTo(req));
results.emplace_back(goals[goalPtr].result.restrictTo(req));
return results;
}
@ -90,7 +90,7 @@ BuildResult Store::buildDerivation(const StorePath & drvPath, const BasicDerivat
return goals;
});
auto [goal, result] = *goals.begin();
return goal->buildResult.restrictTo(DerivedPath::Built {
return result.result.restrictTo(DerivedPath::Built {
.drvPath = makeConstantStorePathRef(drvPath),
.outputs = OutputsSpec::All {},
});

View file

@ -82,11 +82,6 @@ struct Goal
*/
std::string name;
/**
* Build result.
*/
BuildResult buildResult;
struct WorkResult;
// for use by Worker and Goal only. will go away once work() is a promise.

View file

@ -37,7 +37,7 @@ Goal::WorkResult PathSubstitutionGoal::done(
BuildResult::Status status,
std::optional<std::string> errorMsg)
{
buildResult.status = status;
BuildResult buildResult{.status = status};
if (errorMsg) {
debug(*errorMsg);
buildResult.errorMsg = *errorMsg;