diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 13787f219..be1409317 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -64,10 +64,18 @@ jobs: - run: bun install --frozen-lockfile - name: Install cross-platform native bindings run: | - bun install --os darwin --cpu arm64 - bun install --os darwin --cpu x64 - bun install --os linux --cpu arm64 - bun install --os win32 --cpu x64 + # bun install only fetches optional deps for current platform (linux-x64) + # Explicitly install all platform binaries for bun cross-compilation + bun add --no-save \ + @img/sharp-darwin-arm64@0.34.5 \ + @img/sharp-darwin-x64@0.34.5 \ + @img/sharp-linux-x64@0.34.5 \ + @img/sharp-linux-arm64@0.34.5 \ + @img/sharp-win32-x64@0.34.5 \ + @img/sharp-libvips-darwin-arm64@1.2.4 \ + @img/sharp-libvips-darwin-x64@1.2.4 \ + @img/sharp-libvips-linux-x64@1.2.4 \ + @img/sharp-libvips-linux-arm64@1.2.4 - name: Build binaries run: | cd packages/coding-agent diff --git a/bun.lock b/bun.lock index 327e0e468..fe043b86b 100644 --- a/bun.lock +++ b/bun.lock @@ -83,7 +83,6 @@ "nanoid": "^5.1.6", "ndjson": "^2.0.0", "node-html-parser": "^6.1.13", - "sharp": "^0.34.2", "smol-toml": "^1.6.0", "strip-ansi": "^7.1.2", "winston": "^3.17.0", @@ -97,6 +96,9 @@ "@types/node": "^24.3.0", "ms": "^2.1.3", }, + "optionalDependencies": { + "sharp": "^0.34.2", + }, }, "packages/git-tool": { "name": "@oh-my-pi/pi-git-tool", diff --git a/packages/coding-agent/CHANGELOG.md b/packages/coding-agent/CHANGELOG.md index 67177a463..02e6ac264 100644 --- a/packages/coding-agent/CHANGELOG.md +++ b/packages/coding-agent/CHANGELOG.md @@ -2,6 +2,10 @@ ## [Unreleased] +### Fixed + +- Move `sharp` to optional dependencies with all platform binaries to fix arm64 runtime errors + ## [4.7.0] - 2026-01-12 ### Added diff --git a/packages/coding-agent/package.json b/packages/coding-agent/package.json index 61c227594..2855a6ac5 100644 --- a/packages/coding-agent/package.json +++ b/packages/coding-agent/package.json @@ -58,7 +58,7 @@ "nanoid": "^5.1.6", "ndjson": "^2.0.0", "node-html-parser": "^6.1.13", - "sharp": "^0.34.2", + "smol-toml": "^1.6.0", "strip-ansi": "^7.1.2", "winston": "^3.17.0", @@ -72,6 +72,9 @@ "@types/node": "^24.3.0", "ms": "^2.1.3" }, + "optionalDependencies": { + "sharp": "^0.34.2" + }, "keywords": [ "coding-agent", "ai",