about summary refs log tree commit diff
path: root/src/libstore/build.cc
diff options
context:
space:
mode:
authorEelco Dolstra <eelco.dolstra@logicblox.com>2016-09-21T14·53+0200
committerEelco Dolstra <eelco.dolstra@logicblox.com>2016-09-21T14·54+0200
commit818ab58cc67a2b80f47d2cfcc1de2d07fe83a11f (patch)
tree4d55ce62613d2637f821d34d9f8963cdd8f7b03c /src/libstore/build.cc
parent4546be1b3efd9956fe0f548fbf952b5912024577 (diff)
Add sandbox-dev-shm-size option
Fixes #1069.
Diffstat (limited to 'src/libstore/build.cc')
-rw-r--r--src/libstore/build.cc3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/libstore/build.cc b/src/libstore/build.cc
index 476453412b0f..e7054a05a53a 100644
--- a/src/libstore/build.cc
+++ b/src/libstore/build.cc
@@ -2346,7 +2346,8 @@ void DerivationGoal::runChild()
 
             /* Mount a new tmpfs on /dev/shm to ensure that whatever
                the builder puts in /dev/shm is cleaned up automatically. */
-            if (pathExists("/dev/shm") && mount("none", (chrootRootDir + "/dev/shm").c_str(), "tmpfs", 0, 0) == -1)
+            if (pathExists("/dev/shm") && mount("none", (chrootRootDir + "/dev/shm").c_str(), "tmpfs", 0,
+                    fmt("size=%s", settings.get("sandbox-dev-shm-size", std::string("50%"))).c_str()) == -1)
                 throw SysError("mounting /dev/shm");
 
             /* Mount a new devpts on /dev/pts.  Note that this