summaryrefslogtreecommitdiff
path: root/nix/libstore
diff options
context:
space:
mode:
authorLiliana Marie Prikler <liliana.prikler@gmail.com>2024-01-21 09:59:52 +0100
committerLiliana Marie Prikler <liliana.prikler@gmail.com>2024-01-21 09:59:55 +0100
commitff1ec930e5baa00b483f1ce43fa8bec18c797c03 (patch)
tree1c102408d5d79e12b70fe81f97602d3856ed334e /nix/libstore
parent60c97924e9519361494aaf0686e28eb831a42315 (diff)
parentc7f937cfdd9a08bad81705fe731e9fa5937cf562 (diff)
Merge branch 'master' into emacs-team
Diffstat (limited to 'nix/libstore')
-rw-r--r--nix/libstore/build.cc10
-rw-r--r--nix/libstore/globals.cc4
-rw-r--r--nix/libstore/worker-protocol.hh5
3 files changed, 13 insertions, 6 deletions
diff --git a/nix/libstore/build.cc b/nix/libstore/build.cc
index c5383bc756..461fcbc584 100644
--- a/nix/libstore/build.cc
+++ b/nix/libstore/build.cc
@@ -2154,6 +2154,12 @@ void DerivationGoal::runChild()
determinism. */
int cur = personality(0xffffffff);
if (cur != -1) personality(cur | ADDR_NO_RANDOMIZE);
+
+ /* Ask the kernel to eagerly kill us & our children if it runs out of
+ memory, regardless of blame, to preserve ‘real’ user data & state. */
+ try {
+ writeFile("/proc/self/oom_score_adj", "1000"); // 100%
+ } catch (...) { ignoreException(); }
#endif
/* Fill in the environment. */
@@ -3074,8 +3080,8 @@ void SubstitutionGoal::finished()
auto statusList = tokenizeString<vector<string> >(status);
if (statusList.empty()) {
- throw SubstError(format("fetching path `%1%' (empty status: '%2%')")
- % storePath % status);
+ throw SubstError(format("fetching path `%1%' (empty status)")
+ % storePath);
} else if (statusList[0] == "hash-mismatch") {
if (settings.printBuildTrace) {
auto hashType = statusList[1];
diff --git a/nix/libstore/globals.cc b/nix/libstore/globals.cc
index d4f9a46a74..89add1f107 100644
--- a/nix/libstore/globals.cc
+++ b/nix/libstore/globals.cc
@@ -32,8 +32,8 @@ Settings::Settings()
buildCores = 1;
readOnlyMode = false;
thisSystem = SYSTEM;
- maxSilentTime = 0;
- buildTimeout = 0;
+ maxSilentTime = 3600;
+ buildTimeout = 3600 * 24;
useBuildHook = true;
printBuildTrace = false;
multiplexedBuildOutput = false;
diff --git a/nix/libstore/worker-protocol.hh b/nix/libstore/worker-protocol.hh
index ea67b10a5b..ef259db2a0 100644
--- a/nix/libstore/worker-protocol.hh
+++ b/nix/libstore/worker-protocol.hh
@@ -6,7 +6,7 @@ namespace nix {
#define WORKER_MAGIC_1 0x6e697863
#define WORKER_MAGIC_2 0x6478696f
-#define PROTOCOL_VERSION 0x163
+#define PROTOCOL_VERSION 0x164
#define GET_PROTOCOL_MAJOR(x) ((x) & 0xff00)
#define GET_PROTOCOL_MINOR(x) ((x) & 0x00ff)
@@ -44,7 +44,8 @@ typedef enum {
wopQueryValidDerivers = 33,
wopOptimiseStore = 34,
wopVerifyStore = 35,
- wopBuiltinBuilders = 80
+ wopBuiltinBuilders = 80,
+ wopSubstituteURLs = 81
} WorkerOp;