aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/libstore/binary-cache-store.cc10
-rw-r--r--src/libstore/binary-cache-store.hh3
-rw-r--r--src/libstore/local-binary-cache-store.cc1
3 files changed, 14 insertions, 0 deletions
diff --git a/src/libstore/binary-cache-store.cc b/src/libstore/binary-cache-store.cc
index 7d25e2160..6e4458f7a 100644
--- a/src/libstore/binary-cache-store.cc
+++ b/src/libstore/binary-cache-store.cc
@@ -512,4 +512,14 @@ std::optional<std::string> BinaryCacheStore::getBuildLog(const StorePath & path)
return getFile(logPath);
}
+void BinaryCacheStore::addBuildLog(const StorePath & drvPath, std::string_view log)
+{
+ assert(drvPath.isDerivation());
+
+ upsertFile(
+ "log/" + std::string(drvPath.to_string()),
+ (std::string) log, // FIXME: don't copy
+ "text/plain; charset=utf-8");
+}
+
}
diff --git a/src/libstore/binary-cache-store.hh b/src/libstore/binary-cache-store.hh
index 46ff67c77..7599230d9 100644
--- a/src/libstore/binary-cache-store.hh
+++ b/src/libstore/binary-cache-store.hh
@@ -51,6 +51,7 @@ public:
const std::string & mimeType) = 0;
void upsertFile(const std::string & path,
+ // FIXME: use std::string_view
std::string && data,
const std::string & mimeType);
@@ -120,6 +121,8 @@ public:
std::optional<std::string> getBuildLog(const StorePath & path) override;
+ void addBuildLog(const StorePath & drvPath, std::string_view log) override;
+
};
MakeError(NoSuchBinaryCacheFile, Error);
diff --git a/src/libstore/local-binary-cache-store.cc b/src/libstore/local-binary-cache-store.cc
index f93111fce..f754770f9 100644
--- a/src/libstore/local-binary-cache-store.cc
+++ b/src/libstore/local-binary-cache-store.cc
@@ -96,6 +96,7 @@ void LocalBinaryCacheStore::init()
createDirs(binaryCacheDir + "/" + realisationsPrefix);
if (writeDebugInfo)
createDirs(binaryCacheDir + "/debuginfo");
+ createDirs(binaryCacheDir + "/log");
BinaryCacheStore::init();
}