* Fetch the closure and make sure it's input addressed. */
| 102 | * Fetch the closure and make sure it's input addressed. |
| 103 | */ |
| 104 | static void runFetchClosureWithInputAddressedPath( |
| 105 | EvalState & state, const PosIdx pos, Store & fromStore, const StorePath & fromPath, Value & v) |
| 106 | { |
| 107 | |
| 108 | if (!state.store->isValidPath(fromPath)) |
| 109 | copyClosure(fromStore, *state.store, RealisedPath::Set{fromPath}); |
| 110 | |
| 111 | auto info = state.store->queryPathInfo(fromPath); |
| 112 | |
| 113 | if (info->isContentAddressed(*state.store)) { |
| 114 | throw Error( |
| 115 | {.msg = HintFmt( |
| 116 | "The store object referred to by 'fromPath' at '%s' is not input-addressed, but 'inputAddressed' is set to 'true'.\n\n" |
| 117 | "Remove the 'inputAddressed' attribute (it defaults to 'false') to expect 'fromPath' to be content-addressed", |
| 118 | state.store->printStorePath(fromPath)), |
| 119 | .pos = state.positions[pos]}); |
| 120 | } |
| 121 | |
| 122 | state.allowClosure(fromPath); |
| 123 | |
| 124 | state.mkStorePathString(fromPath, v); |
| 125 | } |
| 126 | |
| 127 | typedef std::optional<StorePath> StorePathOrGap; |
| 128 |
no test coverage detected