aboutsummaryrefslogtreecommitdiff
path: root/src/libstore
diff options
context:
space:
mode:
authorjade <lix@jade.fyi>2024-05-30 14:57:37 +0000
committerGerrit Code Review <gerrit@lix-systems>2024-05-30 14:57:37 +0000
commit18aa3e1d570b4ecbb9962376e5fba5757dad8da9 (patch)
treead9edb3d85c7f3e9b6a33f65efeebbdbc9bd243b /src/libstore
parent53d40888ffe8238ab5baf6a9d1a7481c29e9c65d (diff)
parent7575db522e9008685c4009423398f6900a16bcce (diff)
Merge "Remove 100s of CPU time (10%) from build times (1465s -> 1302s)" into main
Diffstat (limited to 'src/libstore')
-rw-r--r--src/libstore/binary-cache-store.cc1
-rw-r--r--src/libstore/build/local-derivation-goal.cc5
-rw-r--r--src/libstore/daemon.cc2
-rw-r--r--src/libstore/machines.cc2
4 files changed, 8 insertions, 2 deletions
diff --git a/src/libstore/binary-cache-store.cc b/src/libstore/binary-cache-store.cc
index e9413cf99..ea643fd31 100644
--- a/src/libstore/binary-cache-store.cc
+++ b/src/libstore/binary-cache-store.cc
@@ -16,6 +16,7 @@
#include <future>
#include <regex>
#include <fstream>
+#include <sstream>
#include <nlohmann/json.hpp>
diff --git a/src/libstore/build/local-derivation-goal.cc b/src/libstore/build/local-derivation-goal.cc
index 479b4ffeb..99468d420 100644
--- a/src/libstore/build/local-derivation-goal.cc
+++ b/src/libstore/build/local-derivation-goal.cc
@@ -64,10 +64,13 @@ extern "C" int sandbox_init_with_parameters(const char *profile, uint64_t flags,
namespace nix {
+namespace {
/**
* The system for which Nix is compiled.
*/
-constexpr std::string_view nativeSystem = SYSTEM;
+[[gnu::unused]]
+constexpr const std::string_view nativeSystem = SYSTEM;
+}
void handleDiffHook(
uid_t uid, uid_t gid,
diff --git a/src/libstore/daemon.cc b/src/libstore/daemon.cc
index 420fc8bfe..641910bd7 100644
--- a/src/libstore/daemon.cc
+++ b/src/libstore/daemon.cc
@@ -14,6 +14,8 @@
#include "derivations.hh"
#include "args.hh"
+#include <sstream>
+
namespace nix::daemon {
Sink & operator << (Sink & sink, const Logger::Fields & fields)
diff --git a/src/libstore/machines.cc b/src/libstore/machines.cc
index cdd1e1c2c..833482815 100644
--- a/src/libstore/machines.cc
+++ b/src/libstore/machines.cc
@@ -140,7 +140,7 @@ static Machine parseBuilderLine(const std::string & line)
};
auto parseFloatField = [&](size_t fieldIndex) {
- const auto result = string2Int<float>(tokens[fieldIndex]);
+ const auto result = string2Float<float>(tokens[fieldIndex]);
if (!result) {
throw FormatError("bad machine specification: failed to convert column #%lu in a row: '%s' to 'float'", fieldIndex, line);
}