fix: make sure platform binary exists (#7676)

This commit is contained in:
Lifei Zhou
2026-03-05 13:23:27 -05:00
committed by GitHub
parent 42fc5152bf
commit ade0839804
7 changed files with 1119 additions and 351 deletions
+1 -1
View File
@@ -134,7 +134,7 @@ jobs:
run: |
source ./bin/activate-hermit
cd ui/desktop
npm install
npm ci
# Verify installation
ls -la node_modules/.bin/ | head -5
+1 -1
View File
@@ -137,7 +137,7 @@ jobs:
run: |
cd ui/desktop
npm install
npm ci
node scripts/build-main.js
node scripts/prepare-platform-binaries.js
npm run make -- --platform=win32 --arch=x64
+4
View File
@@ -151,6 +151,10 @@ jobs:
# restore-keys: |
# ci-npm-cache-v1-${{ runner.os }}-
- name: Check lockfile has cross-platform entries
run: ./scripts/check-lockfile-platforms.sh
working-directory: ui/desktop
- name: Install Dependencies
run: source ../../bin/activate-hermit && npm ci
working-directory: ui/desktop
+8 -8
View File
@@ -125,7 +125,7 @@ copy-binary-windows:
run-ui:
@just release-binary
@echo "Running UI..."
cd ui/desktop && npm install && npm run start-gui
cd ui/desktop && npm ci && npm run start-gui
run-ui-playwright:
#!/usr/bin/env sh
@@ -138,14 +138,14 @@ run-ui-playwright:
run-ui-only:
@echo "Running UI..."
cd ui/desktop && npm install && npm run start-gui
cd ui/desktop && npm ci && npm run start-gui
debug-ui *alpha:
@echo "🚀 Starting goose frontend in external backend mode{{ if alpha == "alpha" { " with alpha features enabled" } else { "" } }}"
cd ui/desktop && \
export GOOSE_EXTERNAL_BACKEND=true && \
{{ if alpha == "alpha" { "export ALPHA=true &&" } else { "" } }} \
npm install && \
npm ci && \
npm run {{ if alpha == "alpha" { "start-alpha-gui" } else { "start-gui" } }}
# Run UI with main process debugging enabled
@@ -159,7 +159,7 @@ debug-ui-main-process:
@echo "🔍 Starting goose UI with main process debugging enabled"
@just release-binary
cd ui/desktop && \
npm install && \
npm ci && \
npm run start-gui-debug
# Package the desktop app locally for testing (macOS)
@@ -167,7 +167,7 @@ debug-ui-main-process:
package-ui:
@just release-binary
@echo "Packaging desktop app..."
cd ui/desktop && npm install && npm run package
cd ui/desktop && npm ci && npm run package
@echo "Signing with entitlements..."
codesign --force --deep --sign - --entitlements ui/desktop/entitlements.plist ui/desktop/out/Goose-darwin-arm64/Goose.app
@echo "Done! Launch with: open ui/desktop/out/Goose-darwin-arm64/Goose.app"
@@ -176,14 +176,14 @@ package-ui:
run-ui-alpha:
@just release-binary
@echo "Running UI with alpha features..."
cd ui/desktop && npm install && ALPHA=true npm run start-alpha-gui
cd ui/desktop && npm ci && ALPHA=true npm run start-alpha-gui
# Run UI with latest (Windows version)
run-ui-windows:
@just release-windows
@powershell.exe -Command "Write-Host 'Copying Windows binary...'"
@just copy-binary-windows
@powershell.exe -Command "Write-Host 'Running UI...'; Set-Location ui/desktop; npm install; npm run start-gui"
@powershell.exe -Command "Write-Host 'Running UI...'; Set-Location ui/desktop; npm ci; npm run start-gui"
# Run Docusaurus server for documentation
run-docs:
@@ -386,7 +386,7 @@ win-bld-rls-all:
### Install npm stuff
win-app-deps:
cd ui{{s}}desktop ; npm install
cd ui{{s}}desktop ; npm ci
### Windows copy {release|debug} files to ui\desktop\src\bin
### s = os dependent file separator
+1072 -338
View File
File diff suppressed because it is too large Load Diff
+3 -3
View File
@@ -56,7 +56,7 @@
"@radix-ui/react-slot": "^1.2.4",
"@radix-ui/react-tabs": "^1.1.13",
"@radix-ui/themes": "^3.3.0",
"@tanstack/react-form": "^1.28.3",
"@tanstack/react-form": "1.28.3",
"@types/react-router-dom": "^5.3.3",
"class-variance-authority": "^0.7.1",
"clsx": "^2.1.1",
@@ -71,7 +71,7 @@
"electron-window-state": "^5.0.3",
"express": "^5.2.1",
"framer-motion": "^12.34.3",
"katex": "^0.16.33",
"katex": "0.16.33",
"lodash": "^4.17.23",
"lucide-react": "^0.575.0",
"qrcode.react": "^4.2.0",
@@ -110,7 +110,7 @@
"@electron/fuses": "^1.8.0",
"@electron/remote": "^2.1.3",
"@eslint/js": "^9.39.2",
"@hey-api/openapi-ts": "^0.93.0",
"@hey-api/openapi-ts": "0.93.0",
"@modelcontextprotocol/sdk": "^1.27.0",
"@playwright/test": "^1.58.2",
"@tailwindcss/line-clamp": "^0.4.4",
+30
View File
@@ -0,0 +1,30 @@
#!/usr/bin/env bash
# Verify package-lock.json has cross-platform optional dependency entries.
#
# npm has a bug where running `npm install` with an existing node_modules/
# prunes platform-specific entries from the lockfile, breaking CI on other platforms.
# See: https://github.com/npm/cli/issues/4828
#
set -euo pipefail
LOCKFILE="${1:-package-lock.json}"
fail=0
grep -q '"node_modules/@esbuild/win32-x64"' "$LOCKFILE" || { echo "MISSING: @esbuild/win32-x64"; fail=1; }
grep -q '"node_modules/@esbuild/linux-x64"' "$LOCKFILE" || { echo "MISSING: @esbuild/linux-x64"; fail=1; }
if [ "$fail" -eq 1 ]; then
echo ""
echo "ERROR: package-lock.json is missing cross-platform optional dependencies."
echo "This happens when 'npm install' is run with an existing node_modules/ directory."
echo ""
echo "To fix, run from ui/desktop/:"
echo " rm -rf node_modules package-lock.json"
echo " npm install"
echo ""
echo "Then commit the regenerated package-lock.json."
exit 1
fi
echo "OK: package-lock.json has cross-platform entries"