77
77
if materialized != null && ! __pathExists materialized
78
78
then ''
79
79
echo "Materialized nix used for ${ name } is missing. To fix run :" >> $ERR
80
- echo " cp -r ${ calculateNoHash } ${ toString materialized } " >> $ERR
80
+ echo " cp -Lr ${ calculateNoHash } ${ toString materialized } " >> $ERR
81
81
echo " chmod -R +w ${ toString materialized } " >> $ERR
82
82
cat $ERR
83
83
false
91
91
diff -ru ${ materialized } ${ calculateNoHash } || true
92
92
echo "Materialized nix used for ${ name } incorrect. To fix run :" >> $ERR
93
93
echo " rm -rf ${ toString materialized } " >> $ERR
94
- echo " cp -r ${ calculateNoHash } ${ toString materialized } " >> $ERR
94
+ echo " cp -Lr ${ calculateNoHash } ${ toString materialized } " >> $ERR
95
95
echo " chmod -R +w ${ toString materialized } " >> $ERR
96
96
fi
97
97
'' )
100
100
cat $ERR
101
101
false
102
102
else
103
- cp -r ${ unchecked } $out
103
+ cp -Lr ${ unchecked } $out
104
104
# Make sure output files can be removed from the sandbox
105
105
chmod -R +w $out
106
106
fi
@@ -114,18 +114,18 @@ let
114
114
} ;
115
115
calculateNoHash = derivation ;
116
116
calculateUseHash =
117
- # Use `cp -r ` here to get rid of symlinks so we know the result
117
+ # Use `cp -Lr ` here to get rid of symlinks so we know the result
118
118
# can be safely materialized (no symlinks to the store).
119
119
runCommand name hashArgs ''
120
- cp -r ${ derivation } $out
120
+ cp -Lr ${ derivation } $out
121
121
# Make sure output files can be removed from the sandbox
122
122
chmod -R +w $out
123
123
'' ;
124
124
calculateUseMaterialized =
125
125
assert materialized != null ;
126
126
assert __pathExists materialized ;
127
127
runCommand name ( pkgs . lib . optionalAttrs ( sha256 == null ) hashArgs ) ''
128
- cp -r ${ materialized } $out
128
+ cp -Lr ${ materialized } $out
129
129
# Make sure output files can be removed from the sandbox
130
130
chmod -R +w $out
131
131
'' ;
0 commit comments