Skip to content

v0.6.5 — Fix Cross-Platform Native Binaries

Latest

Choose a tag to compare

@JasonDocton JasonDocton released this 20 Feb 20:20

Fix: Cross-Platform Native Binaries (0.6.5)

All .node binaries shipped since January 30th were macOS ARM64 Mach-O files regardless of target platform, causing immediate segfaults on Linux and Windows. Only macOS Apple Silicon users were unaffected.

Root Cause

The CI workflow had two interacting bugs:

  1. Upload step (path: *.node) uploaded all checked-out .node files per artifact — not just the one built for that platform
  2. Rename step picked the first .node file alphabetically from checkout (the pre-existing darwin-arm64 binary) and renamed it to the target platform name, overwriting the correctly built binary

Fixes

  • Clean stale binaries before building so only the fresh build output exists
  • Upload only the specific target file (lucid-native.{platform}.node) instead of *.node
  • Add binary format validation (file command checks ELF/Mach-O/PE32+) in both publish and release jobs
  • Add format validation to install.sh download fallback — wrong-format downloads are now rejected and deleted
  • Fix release job permissions for asset uploads
  • Add Linux ARM64 pre-built binary for lucid-native (new platform — previously required building from source)

Defense in Depth

Six layers now prevent this from recurring:

  1. rm -f *.node before build (eliminates checkout contamination)
  2. Verify step confirms expected filename exists after build
  3. Upload only the specific target file
  4. Publish job validates binary format before committing
  5. Release job validates binary format before attaching
  6. install.sh validates downloaded binary matches host OS

Platform Support

Platform lucid-native lucid-perception
macOS ARM64 (Apple Silicon) pre-built pre-built
macOS x64 (Intel) build from source pre-built
Linux x64 pre-built pre-built
Linux ARM64 pre-built (new!) build from source
Windows x64 pre-built pre-built

Thanks to @loster-nimmer for reporting the binary issue in #7!