Skip to content

Comments

feat: add Linux x64 and arm64 Homebrew support#104

Open
yetmike wants to merge 6 commits intosteipete:mainfrom
yetmike:main
Open

feat: add Linux x64 and arm64 Homebrew support#104
yetmike wants to merge 6 commits intosteipete:mainfrom
yetmike:main

Conversation

@yetmike
Copy link

@yetmike yetmike commented Feb 18, 2026

Summary

Adds prebuilt Linux binaries so brew install steipete/tap/summarize works on Linux x64 and arm64, not just macOS.

Three small, focused changes — no CI added, everything stays in the existing manual release flow.

Follow-up: steipete/homebrew-tap#18 restructures the formula with on_macos/on_linux blocks. Merge this PR first, cut a release, then merge that one.


scripts/build-bun.js

  • Added buildLinuxX64() / buildLinuxArm64() using bun-linux-x64 / bun-linux-arm64 compile targets
  • Extracted shared buildPlatform() helper (all three platforms share identical logic)
  • Cross-platform sha256() helper — shasum -a 256 on macOS, sha256sum on Linux
  • detectNativePlatform() — auto-detects host so the existing pnpm build:bun:test on macOS is completely unchanged
  • New --platform <macos-arm64|linux-x64|linux-arm64> flag for a single platform
  • New --all flag to build all three in one run; native platform is always built last so dist-bun/summarize is the runnable binary for smoke tests
  • New --test on --all only runs smoke tests against the native binary

package.json

Two new scripts that mirror the existing build:bun / build:bun:test convention:

build:bun:all       bun scripts/build-bun.js --all
build:bun:all:test  bun scripts/build-bun.js --all --test

scripts/release.sh tap

  • sha256_file() helper works on macOS (shasum) and Linux (sha256sum)
  • Downloads all three platform tarballs, computes their sha256s
  • Rewrites the formula in full with on_macos/on_linux blocks (no more manual editing)
  • Missing tarballs print a warning and are skipped
  • Repo URL is derived from git remote get-url origin — works for any fork automatically

RELEASING.md

Step 3 now reads:

pnpm -s build:bun:all:test — builds macOS arm64 natively (smoke-tested) and cross-compiles linux-x64 and linux-arm64

Step 7 (gh release create) now includes all three Bun tarballs alongside the extension zips.
Step 8 (tap) now says to run bash scripts/release.sh tap instead of editing the formula by hand.


How cross-compilation works

Bun supports cross-compilation out of the box. Running pnpm build:bun:all:test on your Mac:

  1. Cross-compiles bun-darwin-arm64dist-bun/summarize-macos-arm64-v<ver>.tar.gz
  2. Cross-compiles bun-linux-arm64dist-bun/summarize-linux-arm64-v<ver>.tar.gz
  3. Builds bun-linux-x64 natively... wait, wrong — on macOS the native is macos-arm64, built last. On Linux x64 the native is linux-x64, built last. The native platform is always last so smoke tests run on the correct binary.

Test plan

  • pnpm build:bun:all:test on Linux x64 — all three tarballs built, smoke test + E2E pass on the x64 binary
  • brew tap yetmike/tap && brew install summarize && summarize --version on Linux — works
  • pnpm build:bun:all:test on macOS — builds all three tarballs, smoke-tests macOS binary
  • bash scripts/release.sh tap fills in real sha256s and rewrites formula correctly
  • pnpm build:bun:test on macOS still works exactly as before (no regression)

🤖 Generated with Claude Code

Mike and others added 5 commits February 18, 2026 23:06
- Add buildLinuxX64() and buildLinuxArm64() using bun-linux-x64/arm64 targets
- Extract sha256() helper that uses shasum on macOS and sha256sum on Linux
- Refactor buildPlatform() shared logic for all platforms
- Add detectNativePlatform() to auto-detect the build host
- Support --platform <macos-arm64|linux-x64|linux-arm64> flag for cross-compilation
- Support --all flag to build every platform in one run
- E2E tests only run on the native platform binary

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Add sha256_file() helper that works on both macOS (shasum) and Linux (sha256sum)
- Update phase_tap to download and verify all 3 platform tarballs: macos-arm64, linux-x64, linux-arm64
- Rewrite formula using on_macos/on_linux blocks instead of a single flat url+sha256
- Derive GitHub repo from git remote so forks automatically use their own releases
- Formula is fully regenerated on each tap update for consistency

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- .github/workflows/build-binary.yml builds linux-x64 and linux-arm64 on every
  push/PR using native ubuntu-latest and ubuntu-24.04-arm runners
- On tag push (v*): uploads Linux tarballs to the GitHub release alongside the
  macOS artifact steipete publishes manually
- No macOS runner added — steipete's existing local build:bun:test flow is untouched
- RELEASING.md updated to document the new multi-platform workflow and the
  scripts/release.sh tap helper for updating the formula

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Drop the GitHub Actions workflow in favour of cross-compiling all
three platform binaries locally in a single step:

  pnpm build:bun:all:test

Bun supports cross-compilation, so macOS arm64, linux-x64 and
linux-arm64 tarballs are all produced from the release machine.
macOS is smoke-tested natively; Linux targets are cross-compiled
and uploaded together with the extension zips in `gh release create`.

Changes:
- Remove .github/workflows/build-binary.yml
- Add build:bun:all and build:bun:all:test scripts to package.json
- Update RELEASING.md: step 3 now runs build:bun:all:test, step 7
  uploads all three tarballs, Homebrew section updated accordingly

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
When --all is used, each platform overwrites dist-bun/summarize.
By building the native platform last, dist-bun/summarize ends up
as the locally runnable binary so --test can smoke-test it.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@yetmike
Copy link
Author

yetmike commented Feb 18, 2026

Fix: 6189ac4--all mode now builds the native platform last.

Each build overwrites dist-bun/summarize in place (by design, so the tarball always contains a file named summarize). In --all mode this meant the last platform in the list clobbered the native binary before --test could run it. The fix reorders the build list so the native platform is always built last, leaving dist-bun/summarize as the runnable binary for smoke tests.

Verified on Linux x64: pnpm build:bun:all:test now builds macos-arm64 → linux-arm64 → linux-x64 (native last), then smoke-tests and E2E-passes the x64 binary.

…ing empty sha256

If a platform tarball is absent from the release (e.g. macos-arm64 when
building from Linux), the Python formula generator now omits that
on_macos/on_linux block entirely rather than writing sha256 "". This
makes the formula valid and installable even when only a subset of
platform tarballs exist.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@yetmike
Copy link
Author

yetmike commented Feb 18, 2026

Fix: 1902177scripts/release.sh tap now skips missing platform blocks instead of writing sha256 "".

Tested the full flow on Linux (where no macOS tarball exists in the release):

  • macOS tarball 404 → warning printed, on_macos block omitted entirely
  • Linux x64 + arm64 downloaded, sha256 computed, written correctly
  • brew uninstall && brew install from the rewritten formula — ✅ summarize --version0.11.2

On steipete's Mac, all three tarballs will be present so all three blocks will appear in the formula.

@yetmike
Copy link
Author

yetmike commented Feb 18, 2026

Note on cross-compilation: pnpm build:bun:all:test works from either macOS or Linux — bun's cross-compilation is bidirectional. Running on Linux produces a valid bun-darwin-aarch64 binary alongside the Linux ones (we can see it in the build log: compile dist-bun/summarize bun-darwin-aarch64-v1.3.9). The --test flag only smoke-tests the native binary, but all three tarballs are produced either way.

One outstanding item in the test plan that requires a Mac: verify the macOS binary cross-compiled from Linux actually runs on Apple Silicon. Everything else has been tested on Linux x64.

@uniuuu
Copy link

uniuuu commented Feb 19, 2026

Hi @steipete @yetmike
Run into same issue when do openclaw onboard --install-daemon while selecting summarize

summarize: The arm64 architecture is required for this software.
Error: summarize: An unsatisfied requirement failed this build.

no other skills failed during onboarding.

And npm i -g @steipete/summarize also works.

@steipete
Copy link
Owner

Homebrew is only meant for macOS. Use npm for other OSes

@steipete steipete closed this Feb 19, 2026
@steipete steipete reopened this Feb 19, 2026
@yetmike
Copy link
Author

yetmike commented Feb 19, 2026

Homebrew does support Linux

Let me check the openclaw errors and come with the fix

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants