From cf69ff82653dd459418f93ad2903eda8dc0bbdfe Mon Sep 17 00:00:00 2001 From: Zhaofeng Li Date: Wed, 22 Jan 2025 14:08:22 -0700 Subject: [PATCH] newlib-nano: Fix build The original check, while terse, causes the shell to exit after the `for` loop if any file is non-existent. --- pkgs/development/misc/newlib/default.nix | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/pkgs/development/misc/newlib/default.nix b/pkgs/development/misc/newlib/default.nix index fe71113a6f7d..25eacc38f009 100644 --- a/pkgs/development/misc/newlib/default.nix +++ b/pkgs/development/misc/newlib/default.nix @@ -118,7 +118,11 @@ stdenv.mkDerivation (finalAttrs: { for f in librdimon.a libc.a libm.a libg.a libgloss.a; do # Some libraries are only available for specific architectures. # For example, librdimon.a is only available on ARM. - [ -f "$f" ] && cp "$f" "''${f%%\.a}_nano.a" + if [ -f "$f" ]; then + dst="''${f%%\.a}_nano.a" + >&2 echo "$f -> $dst" + cp "$f" "$dst" + fi done ) ''