aboutsummaryrefslogtreecommitdiff
path: root/src/libstore/derived-path.hh
diff options
context:
space:
mode:
Diffstat (limited to 'src/libstore/derived-path.hh')
-rw-r--r--src/libstore/derived-path.hh19
1 files changed, 9 insertions, 10 deletions
diff --git a/src/libstore/derived-path.hh b/src/libstore/derived-path.hh
index 24a0ae773..9e0cce377 100644
--- a/src/libstore/derived-path.hh
+++ b/src/libstore/derived-path.hh
@@ -3,8 +3,10 @@
#include "util.hh"
#include "path.hh"
#include "realisation.hh"
+#include "outputs-spec.hh"
+#include "comparator.hh"
-#include <optional>
+#include <variant>
#include <nlohmann/json_fwd.hpp>
@@ -26,8 +28,7 @@ struct DerivedPathOpaque {
std::string to_string(const Store & store) const;
static DerivedPathOpaque parse(const Store & store, std::string_view);
- bool operator < (const DerivedPathOpaque & b) const
- { return path < b.path; }
+ GENERATE_CMP(DerivedPathOpaque, me->path);
};
/**
@@ -44,14 +45,13 @@ struct DerivedPathOpaque {
*/
struct DerivedPathBuilt {
StorePath drvPath;
- std::set<std::string> outputs;
+ OutputsSpec outputs;
std::string to_string(const Store & store) const;
- static DerivedPathBuilt parse(const Store & store, std::string_view);
+ static DerivedPathBuilt parse(const Store & store, std::string_view, std::string_view);
nlohmann::json toJSON(ref<Store> store) const;
- bool operator < (const DerivedPathBuilt & b) const
- { return std::make_pair(drvPath, outputs) < std::make_pair(b.drvPath, b.outputs); }
+ GENERATE_CMP(DerivedPathBuilt, me->drvPath, me->outputs);
};
using _DerivedPathRaw = std::variant<
@@ -95,6 +95,8 @@ struct BuiltPathBuilt {
nlohmann::json toJSON(ref<Store> store) const;
static BuiltPathBuilt parse(const Store & store, std::string_view);
+
+ GENERATE_CMP(BuiltPathBuilt, me->drvPath, me->outputs);
};
using _BuiltPathRaw = std::variant<
@@ -125,7 +127,4 @@ struct BuiltPath : _BuiltPathRaw {
typedef std::vector<DerivedPath> DerivedPaths;
typedef std::vector<BuiltPath> BuiltPaths;
-nlohmann::json derivedPathsWithHintsToJSON(const BuiltPaths & buildables, ref<Store> store);
-nlohmann::json derivedPathsToJSON(const DerivedPaths & , ref<Store> store);
-
}