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:
- Upload step (
path: *.node) uploaded all checked-out.nodefiles per artifact — not just the one built for that platform - Rename step picked the first
.nodefile alphabetically from checkout (the pre-existingdarwin-arm64binary) 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 (
filecommand checks ELF/Mach-O/PE32+) in both publish and release jobs - Add format validation to
install.shdownload 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:
rm -f *.nodebefore build (eliminates checkout contamination)- Verify step confirms expected filename exists after build
- Upload only the specific target file
- Publish job validates binary format before committing
- Release job validates binary format before attaching
install.shvalidates 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!