about summary refs log tree commit diff
path: root/src/libstore/build.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/libstore/build.cc')
-rw-r--r--src/libstore/build.cc7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/libstore/build.cc b/src/libstore/build.cc
index 77e968ddd08e..acc2923059db 100644
--- a/src/libstore/build.cc
+++ b/src/libstore/build.cc
@@ -1708,8 +1708,11 @@ void DerivationGoal::startBuilder()
                     /* Hard-linking fails if we exceed the maximum
                        link count on a file (e.g. 32000 of ext3),
                        which is quite possible after a `nix-store
-                       --optimise'.  Make a copy instead. */
-                    if (errno != EMLINK)
+                       --optimise'.  It can also fail if another
+                       process called makeImmutable() on *i after we
+                       did makeMutable().  In those cases, make a copy
+                       instead. */
+                    if (errno != EMLINK && errno != EPERM)
                         throw SysError(format("linking `%1%' to `%2%'") % p % *i);
                     StringSink sink;
                     dumpPath(*i, sink);