diff options
author | Taeer Bar-Yam <taeer.bar-yam@tweag.io> | 2022-12-15 15:58:54 -0500 |
---|---|---|
committer | Taeer Bar-Yam <taeer.bar-yam@tweag.io> | 2022-12-15 15:58:54 -0500 |
commit | e5eb05c5990d837e0bbc1529e3b5b167f7015be0 (patch) | |
tree | 13207eadab614619b336fb9079ec0086f62d102e /src/libstore/log-store.hh | |
parent | 3b27181ee54176aba2cdff98028586048e08e74d (diff) |
getBuildLog: factor out resolving derivations
Diffstat (limited to 'src/libstore/log-store.hh')
-rw-r--r-- | src/libstore/log-store.hh | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/libstore/log-store.hh b/src/libstore/log-store.hh index ff1b92e17..b807e3e71 100644 --- a/src/libstore/log-store.hh +++ b/src/libstore/log-store.hh @@ -11,7 +11,14 @@ struct LogStore : public virtual Store /* Return the build log of the specified store path, if available, or null otherwise. */ - virtual std::optional<std::string> getBuildLog(const StorePath & path) = 0; + std::optional<std::string> getBuildLog(const StorePath & path) { + auto maybePath = getBuildDerivationPath(path); + if (!maybePath) + return std::nullopt; + return getBuildLogExact(maybePath.value()); + } + + virtual std::optional<std::string> getBuildLogExact(const StorePath & path) = 0; virtual void addBuildLog(const StorePath & path, std::string_view log) = 0; |