diff options
author | Rodrigo <rodarima@gmail.com> | 2020-06-25 12:03:26 +0200 |
---|---|---|
committer | Rodrigo <rodarima@gmail.com> | 2020-06-25 12:03:26 +0200 |
commit | 3a642187c33ed46d952d3a50a83b2576b704fab7 (patch) | |
tree | 23a2ff24712d8c561c45f51c7e27027a07fcde7f /src/libstore/build.cc | |
parent | 3c50e84387e51858f10c540e721a938592f30949 (diff) |
Fall back to copyPath if link fails with EPERM
BeeGFS doesn't allow hard-links and returns EPERM, so we fall back
to copyPath. See https://github.com/NixOS/nix/issues/3748
Diffstat (limited to 'src/libstore/build.cc')
-rw-r--r-- | src/libstore/build.cc | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/libstore/build.cc b/src/libstore/build.cc index 0c25897f8..9ac5fd923 100644 --- a/src/libstore/build.cc +++ b/src/libstore/build.cc @@ -1950,8 +1950,11 @@ void linkOrCopy(const Path & from, const Path & to) /* 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'. FIXME: actually, why don't we just - bind-mount in this case? */ - if (errno != EMLINK) + bind-mount in this case? + + It can also fail with EPERM in BeegFS v7 and earlier versions + which don't allow hard-links to other directories */ + if (errno != EMLINK && errno != EPERM) throw SysError("linking '%s' to '%s'", to, from); copyPath(from, to); } |