Skip to content

fix(publish): build linux-arm64 and darwin-amd64 native bundles - #18

Merged
TeoSlayer merged 1 commit into
mainfrom
fix/publish-linux-arm64-and-darwin-amd64
Jul 27, 2026
Merged

fix(publish): build linux-arm64 and darwin-amd64 native bundles#18
TeoSlayer merged 1 commit into
mainfrom
fix/publish-linux-arm64-and-darwin-amd64

Conversation

@TeoSlayer

Copy link
Copy Markdown
Contributor

Launch blocker (partial)

npm install pilotprotocol@1.13.6 succeeds everywhere, but new Driver() throws on two platforms the README lists as supported.

Verified in clean node:22-slim containers and on a macOS host:

env install import new Driver()
linux/amd64 ok ok ok — reaches "daemon not running"
macOS arm64 ok ok ok — returned live info()
linux/arm64 ok ok Cannot find libpilot.so
macOS Intel ok ok untested, same missing bundle
DRIVER_CTOR_ERR: Error | Cannot find libpilot.so.
Expected locations:
  - node_modules/pilotprotocol/bin/linux-arm64/libpilot.so (npm package, linux-arm64)

The published tarball only ships two of the four bundles:

package/bin/darwin-arm64/...
package/bin/linux-amd64/...

That is every arm64 Linux host — Graviton, Ampere, and every Docker container on an Apple Silicon laptop, which is how a lot of people will first try this.

Fix

Add the two missing matrix jobs on native runners. libpilot is a CGO c-shared build so it cannot be cross-compiled from the amd64 runner. Also pins the darwin jobs to macos-14/macos-13 rather than the drifting macos-latest, so the Apple Silicon and Intel bundles stay distinct.

Unrelated but worth noting

The README claims the native bundle arrives via optionalDependencies (pilotprotocol-linux-x64 etc). The published package.json has "optionalDependencies": null and bundles the binaries directly. The README is stale; not changed here to keep this diff to the blocker.

Note

npm will not accept a republish of 1.13.6, so shipping this requires cutting a new version.

🤖 Generated with Claude Code

src/ffi.ts resolves the shared library from bin/<os>-<goarch>/, but the
publish matrix only ever built linux-amd64 and darwin-arm64. On any other
supported target `npm install pilotprotocol` succeeded, `import { Driver }`
succeeded, and then `new Driver()` threw:

  Cannot find libpilot.so.
  Expected locations:
    - node_modules/pilotprotocol/bin/linux-arm64/libpilot.so (npm package, linux-arm64)

That covers arm64 Linux — Graviton, Ampere, and every Docker container on an
Apple Silicon laptop — plus Intel macOS, all of which the README lists as
supported.

Add the two missing jobs on native runners (libpilot is a CGO c-shared
build, so it cannot be cross-compiled from the amd64 runner), and pin the
darwin jobs to macos-14/macos-13 rather than the drifting macos-latest so
the Apple Silicon and Intel bundles stay distinct.

The .pilot-version marker now comes from exactly one job instead of "any
Linux job", since all four artifacts are merged into the same bin/ root.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@TeoSlayer
TeoSlayer merged commit 3c7db23 into main Jul 27, 2026
6 checks passed
@TeoSlayer
TeoSlayer deleted the fix/publish-linux-arm64-and-darwin-amd64 branch July 27, 2026 14:44
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.

2 participants