aboutsummaryrefslogtreecommitdiff
path: root/src/libstore/build/goal.hh
diff options
context:
space:
mode:
authorJohn Ericson <John.Ericson@Obsidian.Systems>2022-03-10 16:20:01 +0000
committerJohn Ericson <John.Ericson@Obsidian.Systems>2022-03-10 16:20:01 +0000
commit938650700fafe76e3755982d670855fed3db35c6 (patch)
tree7a6ac217f87cad07bb963ec658bd60625b868466 /src/libstore/build/goal.hh
parent195daa82995b43b3cbd552735a678afb85f4ae28 (diff)
parent8ba089597fa19bfd49ba5f22a5e821740ca4eb5d (diff)
Merge branch 'path-info' into ca-drv-exotic
Diffstat (limited to 'src/libstore/build/goal.hh')
-rw-r--r--src/libstore/build/goal.hh20
1 files changed, 13 insertions, 7 deletions
diff --git a/src/libstore/build/goal.hh b/src/libstore/build/goal.hh
index 192e416d2..07c752bb9 100644
--- a/src/libstore/build/goal.hh
+++ b/src/libstore/build/goal.hh
@@ -2,6 +2,7 @@
#include "types.hh"
#include "store-api.hh"
+#include "build-result.hh"
namespace nix {
@@ -18,8 +19,8 @@ struct CompareGoalPtrs {
};
/* Set of goals. */
-typedef set<GoalPtr, CompareGoalPtrs> Goals;
-typedef set<WeakGoalPtr, std::owner_less<WeakGoalPtr>> WeakGoals;
+typedef std::set<GoalPtr, CompareGoalPtrs> Goals;
+typedef std::set<WeakGoalPtr, std::owner_less<WeakGoalPtr>> WeakGoals;
/* A map of paths to goals (and the other way around). */
typedef std::map<StorePath, WeakGoalPtr> WeakGoalMap;
@@ -50,15 +51,20 @@ struct Goal : public std::enable_shared_from_this<Goal>
unsigned int nrIncompleteClosure;
/* Name of this goal for debugging purposes. */
- string name;
+ std::string name;
/* Whether the goal is finished. */
ExitCode exitCode;
+ /* Build result. */
+ BuildResult buildResult;
+
/* Exception containing an error message, if any. */
std::optional<Error> ex;
- Goal(Worker & worker) : worker(worker)
+ Goal(Worker & worker, DerivedPath path)
+ : worker(worker)
+ , buildResult { .path = std::move(path) }
{
nrFailed = nrNoSubstituters = nrIncompleteClosure = 0;
exitCode = ecBusy;
@@ -75,7 +81,7 @@ struct Goal : public std::enable_shared_from_this<Goal>
virtual void waiteeDone(GoalPtr waitee, ExitCode result);
- virtual void handleChildOutput(int fd, const string & data)
+ virtual void handleChildOutput(int fd, std::string_view data)
{
abort();
}
@@ -87,7 +93,7 @@ struct Goal : public std::enable_shared_from_this<Goal>
void trace(const FormatOrString & fs);
- string getName()
+ std::string getName()
{
return name;
}
@@ -97,7 +103,7 @@ struct Goal : public std::enable_shared_from_this<Goal>
by the worker (important!), etc. */
virtual void timedOut(Error && ex) = 0;
- virtual string key() = 0;
+ virtual std::string key() = 0;
void amDone(ExitCode result, std::optional<Error> ex = {});