aboutsummaryrefslogtreecommitdiff
path: root/src/libstore
diff options
context:
space:
mode:
authorYueh-Shun Li <shamrocklee@posteo.net>2023-06-30 21:11:59 +0800
committerYueh-Shun Li <shamrocklee@posteo.net>2023-06-30 21:12:26 +0800
commiteebfe989a5dc3aac622b9b5f2edef4461d8968c1 (patch)
tree94e9d425ac0e65a648a59b4dfbca5de8172dba00 /src/libstore
parenta0c617348b636d4a6f239450a61e029719e2c832 (diff)
linkOrCopy: Fallback upon cross-device link error (EXDEV)
Fix building derivations in local chroot store on OpenAFS, where hard linking accross directories causes cross-device link error (EXDEV).
Diffstat (limited to 'src/libstore')
-rw-r--r--src/libstore/build/local-derivation-goal.cc3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/libstore/build/local-derivation-goal.cc b/src/libstore/build/local-derivation-goal.cc
index ea7c52098..ee66ee500 100644
--- a/src/libstore/build/local-derivation-goal.cc
+++ b/src/libstore/build/local-derivation-goal.cc
@@ -395,8 +395,9 @@ static void linkOrCopy(const Path & from, const Path & to)
bind-mount in this case?
It can also fail with EPERM in BeegFS v7 and earlier versions
+ or fail with EXDEV in OpenAFS
which don't allow hard-links to other directories */
- if (errno != EMLINK && errno != EPERM)
+ if (errno != EMLINK && errno != EPERM && errno != EXDEV)
throw SysError("linking '%s' to '%s'", to, from);
copyPath(from, to);
}