Skip to content

ARM64 Incompatibilies #119

Open
Open

Description

@amcique

The @nanonets/graft CLI cannot be initialized on an ARM64 Linux platform due to a fundamental native module limitation.
What happened:

  1. npm install -g @nanonets/graft ✅ — Successfully installed (36 packages)
  • Warnings about blocked install scripts (expected on this platform)
  1. graft init ❌ — Failed with native build error:
    Error: No native build was found for platform=linux arch=arm64
    runtime=node abi=147 uv=1 armv=8 libc=glibc node=26.6.0
  • The tree-sitter native module (required by graft) has no pre-built binary for ARM64 Linux
  • node-gyp cannot compile the C++ addon on this architecture
    Why this happens:
  • @nanonets/graft uses tree-sitter for parsing source code into ASTs
  • tree-sitter compiles native C++ addons via node-gyp
  • ARM64 Linux lacks pre-built binaries in the npm registry for this combination
  • node-gyp build fails at runtime when trying to require('tree-sitter')
    Result:
  • No graft/ folder was created — the init step errored before any graph could be built
  • 0 map files built — the process errored out during initialization

Activity

  1. Frankie-Xu commented on Aug 24, 2026

    @Frankie-Xu
    Contributor

    Diagnosis (linux/arm64 graft init / native tree-sitter)

    Confirmed unclaimed; no existing PR targets #119. Failure is at require("tree-sitter") on CLI load, not npm install and not scripts/postinstall.mjs (that script is a one-line nudge and never throws). src/cli.ts → engine.ts → build.ts / source-files.ts → extract.ts, which statically imports tree-sitter and the depth grammars. One missing .node takes down every command (init, build, check, statusline).

    Prebuild matrix (published tarballs)

    package (what graft 0.12.0 pins) linux-arm64 prebuild?
    tree-sitter@0.21.1 (runtime) no (only darwin-arm64/x64, linux-x64, win32-x64)
    tree-sitter-python@0.21.0 no (same four)
    tree-sitter-typescript@0.23.2 yes
    tree-sitter-go@0.23.4 yes
    tree-sitter-java@0.23.5 yes
    tree-sitter-php@0.23.12 yes
    tree-sitter@0.22.4 / 0.25.1 yes
    tree-sitter@0.25.0 no prebuilds at all (publish gap)
    tree-sitter-python@0.25.0 yes

    Reporter's No native build was found for platform=linux arch=arm64 (Node 26 / ABI 147, glibc) matches the missing platform directory, not an ABI mismatch. node-gyp-build is N-API (prebuildify --napi); blocked install scripts are a red herring when the prebuild isn't in the tarball.

    Options

    A. Version bump to tree-sitter@0.25.1 + tree-sitter-python@0.25.0 would ship linux-arm64 prebuilds, but that's #40's ABI migration (0.21 → 0.25). #40 is still OPEN, CONFLICTING, last Ubuntu CI failed. Mixing tree-sitter@0.25 with today's tree-sitter-typescript@0.23.2 / java / php is not a small bump. 0.25.0 also shipped with zero prebuilds, so the supply chain is not something we should treat as the only safety net. Alpine/musl and "no compiler" would still lose.

    B+C (proposed): keep native parsers when they load (darwin/linux-x64 unchanged). If require("tree-sitter") (or a per-grammar require) throws, route depth extensions through the existing WASM breadth path (web-tree-sitter + tree-sitter-wasm, which already has typescript/tsx/javascript/python/go/java/php). Print one warning:

    native parser unavailable on this platform — falling back to WASM (reduced binding fidelity)

    Fidelity drop (not papered over): no bindings / recvType precision; call edges only if a tags.scm exists (otherwise the walker emits symbols only). graft check / statusline must not error.

    Will implement as a non-draft PR against main unless a maintainer prefers waiting on #40.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions