From 7e27fef10f70aeb764e26861ddc172661728ce05 Mon Sep 17 00:00:00 2001 From: genisis0x Date: Thu, 14 May 2026 14:14:27 +0530 Subject: [PATCH] fix(gbrain-install): skip postinstall scripts on Windows MSYS/Cygwin bun install in fails on Windows MSYS/Cygwin shells because gbrain's native postinstall script mis-parses path arguments and aborts with a non-zero exit, breaking gstack-gbrain-install for Windows users running git-bash/MSYS2. The package installs cleanly without scripts. Detect MINGW/MSYS/CYGWIN/Windows_NT via uname -s and pass --ignore-scripts to bun install on those shells. macOS and Linux paths unchanged. Refs #1271 --- bin/gstack-gbrain-install | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/bin/gstack-gbrain-install b/bin/gstack-gbrain-install index c247ff2df5..e9db6281e9 100755 --- a/bin/gstack-gbrain-install +++ b/bin/gstack-gbrain-install @@ -131,9 +131,24 @@ if $DRY_RUN; then fi # --- install + link --- +# On Windows MSYS/Cygwin shells, bun's postinstall scripts (notably gbrain's +# native-bindings setup) fail to parse path arguments correctly and abort +# `bun install` with a non-zero exit. The package itself installs fine +# without scripts, so detect Windows and pass --ignore-scripts there. The +# `bun link` step below is unaffected. +IS_WINDOWS=0 +case "$(uname -s)" in + MINGW*|MSYS*|CYGWIN*|Windows_NT) IS_WINDOWS=1 ;; +esac + if ! $VALIDATE_ONLY; then - log "running bun install in $INSTALL_DIR" - ( cd "$INSTALL_DIR" && bun install --silent ) + if [ "$IS_WINDOWS" -eq 1 ]; then + log "running bun install --ignore-scripts in $INSTALL_DIR (Windows shell detected)" + ( cd "$INSTALL_DIR" && bun install --silent --ignore-scripts ) + else + log "running bun install in $INSTALL_DIR" + ( cd "$INSTALL_DIR" && bun install --silent ) + fi log "running bun link in $INSTALL_DIR" ( cd "$INSTALL_DIR" && bun link --silent ) fi