* Fetch the closure and make sure it's content addressed. */
| 73 | * Fetch the closure and make sure it's content addressed. |
| 74 | */ |
| 75 | static void runFetchClosureWithContentAddressedPath( |
| 76 | EvalState & state, const PosIdx pos, Store & fromStore, const StorePath & fromPath, Value & v) |
| 77 | { |
| 78 | |
| 79 | if (!state.store->isValidPath(fromPath)) |
| 80 | copyClosure(fromStore, *state.store, RealisedPath::Set{fromPath}); |
| 81 | |
| 82 | auto info = state.store->queryPathInfo(fromPath); |
| 83 | |
| 84 | if (!info->isContentAddressed(*state.store)) { |
| 85 | throw Error( |
| 86 | {.msg = HintFmt( |
| 87 | "The 'fromPath' value '%s' is input-addressed, but 'inputAddressed' is set to 'false' (default).\n\n" |
| 88 | "If you do intend to fetch an input-addressed store path, add\n\n" |
| 89 | " inputAddressed = true;\n\n" |
| 90 | "to the 'fetchClosure' arguments.\n\n" |
| 91 | "Note that to ensure authenticity input-addressed store paths, users must configure a trusted binary cache public key on their systems. This is not needed for content-addressed paths.", |
| 92 | state.store->printStorePath(fromPath)), |
| 93 | .pos = state.positions[pos]}); |
| 94 | } |
| 95 | |
| 96 | state.allowClosure(fromPath); |
| 97 | |
| 98 | state.mkStorePathString(fromPath, v); |
| 99 | } |
| 100 | |
| 101 | /** |
| 102 | * Fetch the closure and make sure it's input addressed. |
no test coverage detected