From e0e520a5191542ba6b204f1226bf97299b85b286 Mon Sep 17 00:00:00 2001 From: c74d <8573dd@gmail.com> Date: Fri, 24 Mar 2017 00:52:56 +0000 Subject: [PATCH] google-compute-image: copy store paths with rsync In `nixos/modules/virtualisation/google-compute-image.nix`, copy store paths with `rsync -a` rather than `cp -prd`, because `rsync` seems better able to handle the hard-links that may be present in the store, whereas `cp` may fail to copy them. I have tested that the Google Compute Engine image builds successfully for me with this patch, whereas it did not without this patch. This is the same fix applied for Azure images in commit 097ef6e435d5b3fcde92e67abbaaaaaf05c0723d. Fixes #23973. --- nixos/modules/virtualisation/google-compute-image.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nixos/modules/virtualisation/google-compute-image.nix b/nixos/modules/virtualisation/google-compute-image.nix index 556454c6b5f..a03c45bfeff 100644 --- a/nixos/modules/virtualisation/google-compute-image.nix +++ b/nixos/modules/virtualisation/google-compute-image.nix @@ -62,7 +62,7 @@ in mkdir -p /mnt/nix/store echo "copying everything (will take a while)..." - cp -prd $storePaths /mnt/nix/store/ + ${pkgs.rsync}/bin/rsync -a $storePaths /mnt/nix/store/ # Register the paths in the Nix database. printRegistration=1 perl ${pkgs.pathsFromGraph} /tmp/xchg/closure | \