From 2c1b4c7c357fd03979bcc27cc6e256a71f6cf2f3 Mon Sep 17 00:00:00 2001 From: Felipe Coury Date: Fri, 20 Nov 2026 02:08:02 +0000 Subject: [PATCH] Fix standalone release pruning on macOS with GNU coreutils (#62648) GNU `stat` can take precedence on `PATH` and interprets `-f` differently from macOS `stat`, causing the installer's device checks to fail. Use the system `stat` for both device checks before pruning old releases. GitOrigin-RevId: 180b62ba6e2ea4ec4419c2d6e51ba4d6ce819a2d --- scripts/install/install.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/scripts/install/install.sh b/scripts/install/install.sh index e6d9dd0987..fed4c49770 100755 --- a/scripts/install/install.sh +++ b/scripts/install/install.sh @@ -919,8 +919,9 @@ prune_standalone_releases() ( continue fi else - device="$(stat -f '%d' "$releases")" || return 1 - if ! find "$candidate" -xdev -exec stat -f '%d' {} + > "$tmp_dir/devices"; then + # Use macOS stat even when GNU coreutils comes first on PATH. + device="$(/usr/bin/stat -f '%d' "$releases")" || return 1 + if ! find "$candidate" -xdev -exec /usr/bin/stat -f '%d' {} + > "$tmp_dir/devices"; then continue fi grep -vxF "$device" "$tmp_dir/devices" >/dev/null && continue