diff --git a/overlays.nix b/overlays.nix index edaeb67..6678942 100755 --- a/overlays.nix +++ b/overlays.nix @@ -268,17 +268,23 @@ let prev.runCommandLocal "${finalAttrs.finalPackage.name}-ldd" { nativeBuildInputs = [ + prev.glibc.bin prev.fd ]; } '' worker() ( local output - set +e - output="$(ldd "$1")" - if [[ $? -ne 0 ]] || grep <<<"$output" -q " not found"; then - echo "$1" + set -u +e + output="$(ldd "$1" 2>&1)" + retcode="$?" + if [[ "$retcode" -ne 0 && "$output" != $'$\tnot a dynamic executable' ]]; then + echo "error: ldd $1 (retcode=$retcode)" + cat <<<"$output" + touch any_error + elif grep <<<"$output" -q " not found"; then # TODO: show executable permission errors too + echo "error: ldd $1 (log detection)" grep <<<"$output" " not found" touch any_error fi @@ -295,7 +301,7 @@ let --hidden --no-ignore --follow # symlinks - -x bash -c "$(declare -f worker); worker \"\$@\"" + -x bash -c "$(declare -f worker); worker \"\$@\"" -- ) fd "''${fd_args[@]}"