about summary refs log tree commit diff
path: root/pkgs/stdenv/generic/setup.sh
diff options
context:
space:
mode:
authorWout Mertens <Wout.Mertens@gmail.com>2014-10-28 23:10:26 +0100
committerPeter Simons <simons@cryp.to>2014-10-31 11:13:03 +0100
commitc04e49289871232ff3c2fd1239b64c2513f18fd1 (patch)
tree3c98bc2907a05cd18c803a947da7f4c75924cb80 /pkgs/stdenv/generic/setup.sh
parent114a775254da06d9833deb1d513b47afe0684d73 (diff)
downloadnixlib-c04e49289871232ff3c2fd1239b64c2513f18fd1.tar
nixlib-c04e49289871232ff3c2fd1239b64c2513f18fd1.tar.gz
nixlib-c04e49289871232ff3c2fd1239b64c2513f18fd1.tar.bz2
nixlib-c04e49289871232ff3c2fd1239b64c2513f18fd1.tar.lz
nixlib-c04e49289871232ff3c2fd1239b64c2513f18fd1.tar.xz
nixlib-c04e49289871232ff3c2fd1239b64c2513f18fd1.tar.zst
nixlib-c04e49289871232ff3c2fd1239b64c2513f18fd1.zip
stdenv: Prevent issues like #4266
Don't preserve hardlinks, and instead use reflinks if they're available.
Diffstat (limited to 'pkgs/stdenv/generic/setup.sh')
-rw-r--r--pkgs/stdenv/generic/setup.sh4
1 files changed, 3 insertions, 1 deletions
diff --git a/pkgs/stdenv/generic/setup.sh b/pkgs/stdenv/generic/setup.sh
index 24deac21c59f..fe801c6bb971 100644
--- a/pkgs/stdenv/generic/setup.sh
+++ b/pkgs/stdenv/generic/setup.sh
@@ -463,7 +463,9 @@ _defaultUnpack() {
     if [ -d "$fn" ]; then
 
         stripHash "$fn"
-        cp -prd --no-preserve=timestamps "$fn" $strippedName
+        # 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 --no-preserve=timestamps "$fn" $strippedName
 
     else