aboutsummaryrefslogtreecommitdiff
path: root/src/libstore/build/local-derivation-goal.cc
diff options
context:
space:
mode:
authormidnightveil <midnight@trainwit.ch>2024-05-10 15:25:12 +1000
committerJade Lovelace <lix@jade.fyi>2024-05-16 17:11:21 -0700
commit5b7dcb3005ed38d4634f228f01852ae18b2d9cd4 (patch)
treea254515d74a24144865ae37ef468306b2e112a85 /src/libstore/build/local-derivation-goal.cc
parent9322a1cbe775a32c7019a91236d9e37037b9241a (diff)
Allow enabling core dumps from builds for nix & child processes
Fixes https://git.lix.systems/lix-project/lix/issues/268 Change-Id: I3f1b0ddf064f891cca8b53229c5c31c74cea3d9f
Diffstat (limited to 'src/libstore/build/local-derivation-goal.cc')
-rw-r--r--src/libstore/build/local-derivation-goal.cc3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/libstore/build/local-derivation-goal.cc b/src/libstore/build/local-derivation-goal.cc
index 3429afafa..cdbd0f5a7 100644
--- a/src/libstore/build/local-derivation-goal.cc
+++ b/src/libstore/build/local-derivation-goal.cc
@@ -1977,6 +1977,9 @@ void LocalDerivationGoal::runChild()
/* Disable core dumps by default. */
struct rlimit limit = { 0, RLIM_INFINITY };
+ if (settings.enableCoreDumps) {
+ limit.rlim_cur = RLIM_INFINITY;
+ }
setrlimit(RLIMIT_CORE, &limit);
// FIXME: set other limits to deterministic values?