2022-03-08 20:20:39 +02:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include "store-api.hh"
|
|
|
|
|
|
|
|
|
|
|
|
namespace nix {
|
|
|
|
|
|
|
|
struct LogStore : public virtual Store
|
|
|
|
{
|
2022-03-09 17:27:48 +02:00
|
|
|
inline static std::string operationName = "Build log storage and retrieval";
|
|
|
|
|
2022-03-08 20:20:39 +02:00
|
|
|
/* Return the build log of the specified store path, if available,
|
|
|
|
or null otherwise. */
|
2022-12-15 22:58:54 +02:00
|
|
|
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;
|
2022-03-08 20:20:39 +02:00
|
|
|
|
|
|
|
virtual void addBuildLog(const StorePath & path, std::string_view log) = 0;
|
|
|
|
|
|
|
|
static LogStore & require(Store & store);
|
|
|
|
};
|
|
|
|
|
|
|
|
}
|