From bdac0fa35d69d2ea454deeb71b0c826aef53886c Mon Sep 17 00:00:00 2001 From: Romanos Skiadas Date: Thu, 28 Nov 2024 16:57:10 +0200 Subject: [PATCH] pkgs/stdenv: fix defaultUnpack on nfs -p preserves permission,mode,timestamps. When trying to copy with permission on NFS, it can fail; The closest documentation I found on this was: https://access.redhat.com/solutions/725513 One suggestion is to change the netapp configuration, but another that should work for everyone is to use the cp command presented in this patch. With this, builds on nfs work for me. I however cannot say that I'm certain that removing the permission preservation won't cause any other troubles elsewhere, e.g. by perhaps introducing some sort of non-determinism. --- pkgs/stdenv/generic/setup.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/stdenv/generic/setup.sh b/pkgs/stdenv/generic/setup.sh index 72fdbef981da..0660c6b642db 100644 --- a/pkgs/stdenv/generic/setup.sh +++ b/pkgs/stdenv/generic/setup.sh @@ -1211,7 +1211,7 @@ _defaultUnpack() { # We can't preserve hardlinks because they may have been # introduced by store optimization, which might break things # in the build. - cp -pr --reflink=auto -- "$fn" "$destination" + cp -r --preserve=mode,timestamps --reflink=auto -- "$fn" "$destination" else