From ec505766bb65891471fdb236914f958de8e7c6ef Mon Sep 17 00:00:00 2001 From: TomaSajt <62384384+TomaSajt@users.noreply.github.com> Date: Sat, 15 Mar 2025 16:47:55 +0100 Subject: [PATCH] rustPlatform.importCargoLock: use `cp -L` again, but ignore error We accidentally broke the dereferencing logic of copying in https://github.com/NixOS/nixpkgs/pull/379049 The new solution is just to revert back to using `cp -L` but to also ignore the non-zero exit code with the || operator --- pkgs/build-support/rust/import-cargo-lock.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/build-support/rust/import-cargo-lock.nix b/pkgs/build-support/rust/import-cargo-lock.nix index 077ff80efe0b..d63cfb8c52b9 100644 --- a/pkgs/build-support/rust/import-cargo-lock.nix +++ b/pkgs/build-support/rust/import-cargo-lock.nix @@ -228,7 +228,7 @@ let echo Found crate ${pkg.name} at $crateCargoTOML tree=$(dirname $crateCargoTOML) - ${python3Packages.python.interpreter} -c 'import sys, shutil; shutil.copytree(sys.argv[1], sys.argv[2], ignore_dangling_symlinks=True)' "$tree" "$out" + cp -prvL "$tree" "$out" || echo "Warning: certain files couldn't be copied!" >&2 chmod u+w $out if grep -q workspace "$out/Cargo.toml"; then