summaryrefslogtreecommitdiff
path: root/nix/libstore
diff options
context:
space:
mode:
authorLiliana Marie Prikler <[email protected]>2023-12-18 03:58:23 +0100
committerLiliana Marie Prikler <[email protected]>2023-12-18 03:58:23 +0100
commit256d5b3598fa2162e9712fc98781d2cb4ceda31e (patch)
tree0e7f7051a59aad879561b5c4ee885e24d3c04bc6 /nix/libstore
parent9f6210cc5c114310a38ad1cc0ff5900409a7e7cc (diff)
parent1a9f267f51f97b8ca7049aa72763ddd64aad5b62 (diff)
Merge branch 'master' into wip-webkit
Diffstat (limited to 'nix/libstore')
-rw-r--r--nix/libstore/build.cc6
-rw-r--r--nix/libstore/worker-protocol.hh5
2 files changed, 9 insertions, 2 deletions
diff --git a/nix/libstore/build.cc b/nix/libstore/build.cc
index e8259aa4e8..54555b92d7 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. */
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;