libstore: move Goal::ex to WorkResult
yet another duplicated field. it's the last one though.
Change-Id: I352df8d306794d262d8c9066f3be78acd40e82cf
This commit is contained in:
parent
1caf2afb1d
commit
03cbc0ecb9
|
@ -26,11 +26,11 @@ void Store::buildPaths(const std::vector<DerivedPath> & reqs, BuildMode buildMod
|
||||||
StringSet failed;
|
StringSet failed;
|
||||||
std::shared_ptr<Error> ex;
|
std::shared_ptr<Error> ex;
|
||||||
for (auto & [i, result] : goals) {
|
for (auto & [i, result] : goals) {
|
||||||
if (i->ex) {
|
if (result.ex) {
|
||||||
if (ex)
|
if (ex)
|
||||||
logError(i->ex->info());
|
logError(result.ex->info());
|
||||||
else
|
else
|
||||||
ex = i->ex;
|
ex = result.ex;
|
||||||
}
|
}
|
||||||
if (result.exitCode != Goal::ecSuccess) {
|
if (result.exitCode != Goal::ecSuccess) {
|
||||||
if (auto i2 = dynamic_cast<DerivationGoal *>(i.get()))
|
if (auto i2 = dynamic_cast<DerivationGoal *>(i.get()))
|
||||||
|
@ -119,9 +119,9 @@ void Store::ensurePath(const StorePath & path)
|
||||||
auto [goal, result] = *goals.begin();
|
auto [goal, result] = *goals.begin();
|
||||||
|
|
||||||
if (result.exitCode != Goal::ecSuccess) {
|
if (result.exitCode != Goal::ecSuccess) {
|
||||||
if (goal->ex) {
|
if (result.ex) {
|
||||||
goal->ex->withExitStatus(worker.failingExitStatus());
|
result.ex->withExitStatus(worker.failingExitStatus());
|
||||||
throw std::move(*goal->ex);
|
throw std::move(*result.ex);
|
||||||
} else
|
} else
|
||||||
throw Error(worker.failingExitStatus(), "path '%s' does not exist and cannot be created", printStorePath(path));
|
throw Error(worker.failingExitStatus(), "path '%s' does not exist and cannot be created", printStorePath(path));
|
||||||
}
|
}
|
||||||
|
|
|
@ -25,7 +25,6 @@ try {
|
||||||
BOOST_OUTCOME_CO_TRY(auto result, co_await workImpl());
|
BOOST_OUTCOME_CO_TRY(auto result, co_await workImpl());
|
||||||
|
|
||||||
trace("done");
|
trace("done");
|
||||||
ex = result.ex;
|
|
||||||
|
|
||||||
notify->fulfill(result);
|
notify->fulfill(result);
|
||||||
cleanup();
|
cleanup();
|
||||||
|
|
|
@ -118,12 +118,6 @@ protected:
|
||||||
virtual kj::Promise<Result<WorkResult>> workImpl() noexcept = 0;
|
virtual kj::Promise<Result<WorkResult>> workImpl() noexcept = 0;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
/**
|
|
||||||
* Exception containing an error message, if any.
|
|
||||||
*/
|
|
||||||
std::shared_ptr<Error> ex;
|
|
||||||
|
|
||||||
explicit Goal(Worker & worker, bool isDependency)
|
explicit Goal(Worker & worker, bool isDependency)
|
||||||
: worker(worker)
|
: worker(worker)
|
||||||
, isDependency(isDependency)
|
, isDependency(isDependency)
|
||||||
|
|
Loading…
Reference in a new issue