|
1 | 1 | #include "derived-path.hh"
|
2 |
| -#include "derivations.hh" |
3 | 2 | #include "store-api.hh"
|
4 | 3 |
|
5 | 4 | #include <nlohmann/json.hpp>
|
@@ -30,30 +29,6 @@ nlohmann::json DerivedPath::Built::toJSON(ref<Store> store) const {
|
30 | 29 | return res;
|
31 | 30 | }
|
32 | 31 |
|
33 |
| -nlohmann::json BuiltPath::Built::toJSON(ref<Store> store) const { |
34 |
| - nlohmann::json res; |
35 |
| - res["drvPath"] = store->printStorePath(drvPath); |
36 |
| - for (const auto& [output, path] : outputs) { |
37 |
| - res["outputs"][output] = store->printStorePath(path); |
38 |
| - } |
39 |
| - return res; |
40 |
| -} |
41 |
| - |
42 |
| -StorePathSet BuiltPath::outPaths() const |
43 |
| -{ |
44 |
| - return std::visit( |
45 |
| - overloaded{ |
46 |
| - [](const BuiltPath::Opaque & p) { return StorePathSet{p.path}; }, |
47 |
| - [](const BuiltPath::Built & b) { |
48 |
| - StorePathSet res; |
49 |
| - for (auto & [_, path] : b.outputs) |
50 |
| - res.insert(path); |
51 |
| - return res; |
52 |
| - }, |
53 |
| - }, raw() |
54 |
| - ); |
55 |
| -} |
56 |
| - |
57 | 32 | std::string DerivedPath::Opaque::to_string(const Store & store) const
|
58 | 33 | {
|
59 | 34 | return store.printStorePath(path);
|
@@ -121,35 +96,4 @@ DerivedPath DerivedPath::parseLegacy(const Store & store, std::string_view s)
|
121 | 96 | return parseWith(store, s, "!");
|
122 | 97 | }
|
123 | 98 |
|
124 |
| -RealisedPath::Set BuiltPath::toRealisedPaths(Store & store) const |
125 |
| -{ |
126 |
| - RealisedPath::Set res; |
127 |
| - std::visit( |
128 |
| - overloaded{ |
129 |
| - [&](const BuiltPath::Opaque & p) { res.insert(p.path); }, |
130 |
| - [&](const BuiltPath::Built & p) { |
131 |
| - auto drvHashes = |
132 |
| - staticOutputHashes(store, store.readDerivation(p.drvPath)); |
133 |
| - for (auto& [outputName, outputPath] : p.outputs) { |
134 |
| - if (experimentalFeatureSettings.isEnabled( |
135 |
| - Xp::CaDerivations)) { |
136 |
| - auto drvOutput = get(drvHashes, outputName); |
137 |
| - if (!drvOutput) |
138 |
| - throw Error( |
139 |
| - "the derivation '%s' has unrealised output '%s' (derived-path.cc/toRealisedPaths)", |
140 |
| - store.printStorePath(p.drvPath), outputName); |
141 |
| - auto thisRealisation = store.queryRealisation( |
142 |
| - DrvOutput{*drvOutput, outputName}); |
143 |
| - assert(thisRealisation); // We’ve built it, so we must |
144 |
| - // have the realisation |
145 |
| - res.insert(*thisRealisation); |
146 |
| - } else { |
147 |
| - res.insert(outputPath); |
148 |
| - } |
149 |
| - } |
150 |
| - }, |
151 |
| - }, |
152 |
| - raw()); |
153 |
| - return res; |
154 |
| -} |
155 | 99 | }
|
0 commit comments