stdenv: don't preserve ownership information in defaultUnpack hook (#359873)

From the GNU coreutils manual <https://www.gnu.org/software/coreutils/manual/coreutils.html#index-_002dp-3>:

    Using --preserve with no attributes listed is equivalent to --preserve=mode,ownership,timestamps.

Thus, what this patch drops is --preserve=ownership.

Since the contents in the Nix store do not need ownership (they are owned by root), I think this is a fine patch to take.
This commit is contained in:
Philip Taron
2024-11-29 15:48:32 -08:00
committed by GitHub
+1 -1
View File
@@ -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