feat: add linux-arm64-gnu and linux-x64-musl platform packages#341
feat: add linux-arm64-gnu and linux-x64-musl platform packages#341carlos-alm wants to merge 2 commits intomainfrom
Conversation
Add native binary support for ARM64 Linux (Docker on Apple Silicon, AWS Graviton) and Alpine Linux (musl), closing the two biggest platform gaps that currently force a ~35x slower WASM fallback. - Add aarch64-unknown-linux-gnu and x86_64-unknown-linux-musl napi targets - Add detectLibc() helper using process.report to distinguish glibc/musl - Update PLATFORM_PACKAGES with libc-qualified Linux keys - Add cross-compilation steps in CI (gcc-aarch64-linux-gnu, musl-tools) - Add npm libc field to generated platform package.json for auto-selection - Switch artifact naming to artifact_key for consistency across platforms Impact: 2 functions changed, 3 affected
Greptile SummaryThis PR adds native binary support for ARM64 Linux (glibc) and Alpine Linux x64 (musl), closing major platform gaps that previously forced WASM fallback. The implementation is well-structured with a new Key changes:
Note: ARM64 Alpine ( Confidence Score: 5/5
Important Files Changed
Last reviewed commit: e0fe0c1 |
Additional Comments (1)
|
Summary
detectLibc()helper innative.jsusingprocess.report.getReport().header.glibcVersionRuntimeto auto-select glibc vs musl packagesgcc-aarch64-linux-gnufor arm64,musl-toolsfor musl) in bothbuild-native.ymlandpublish.ymlpackage.jsonfiles now include npm'slibcfield for automatic variant selection (supported since npm v10 / Node 20+)Changes
crates/codegraph-core/package.jsonaarch64-unknown-linux-gnu+x86_64-unknown-linux-muslnapi targetssrc/native.jsdetectLibc(), updatePLATFORM_PACKAGESwith libc-qualified Linux keyspackage.json@optave/codegraph-linux-arm64-gnu+@optave/codegraph-linux-x64-musloptionalDependencies.github/workflows/build-native.ymlartifact_keynaming.github/workflows/publish.ymlPACKAGESmap with libc field in pack stepsTest plan
npm run lintpasses (only pre-existing warning)loadNative()verified working on win32-x64 (non-Linux path unchanged)build-nativeworkflow to verify cross-compilation succeeds