diff options
author | Liliana Marie Prikler <liliana.prikler@gmail.com> | 2023-12-20 00:05:21 +0100 |
---|---|---|
committer | Liliana Marie Prikler <liliana.prikler@gmail.com> | 2023-12-20 00:05:21 +0100 |
commit | 24d4d6fdd67561e0de4b1cea6380e43e63d69646 (patch) | |
tree | 9c3f946b6e7c3d67af44cdcd9710ad8320e90080 /nix/libstore/build.cc | |
parent | 92982ecca4efe857666d8b94ad95d2cc7d2ab54b (diff) | |
parent | a512bbd23a2e129cf3d8e71255d504ce8bac77d3 (diff) |
Merge branch 'master' into gnome-team
Diffstat (limited to 'nix/libstore/build.cc')
-rw-r--r-- | nix/libstore/build.cc | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/nix/libstore/build.cc b/nix/libstore/build.cc index c5383bc756..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. */ @@ -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]; |