Skip to content

Support OpenHarmony (openharmony-arm64) prebuilt #341

Description

@SB-Moloo

Support OpenHarmony (openharmony-arm64) prebuilt

Problem

npm install tree-sitter-bash fails on OpenHarmony because node-gyp-build cannot find an openharmony-arm64 prebuilt, falling back to source compilation. Source compilation fails due to a V8 TLS compatibility issue on OpenHarmony (Node.js v24 __errno_location() crash).

Root Cause

The existing linux-arm64 prebuilt is compiled with the glibc/GNU toolchain, while OpenHarmony uses the clang/LLVM toolchain with its own libc. These ABIs are incompatible:

linux-arm64 prebuilt OpenHarmony required
C++ stdlib libstdc++.so.6 (GNU) libc++_shared.so (LLVM)
C runtime libc.so.6 (glibc) libc.so (OpenHarmony libc)
Dynamic linker ld-linux-aarch64.so.1 — (embedded)

Fix

Add prebuilds/openharmony-arm64/tree-sitter-bash.node, compiled with the OpenHarmony clang toolchain.

A pre-compiled binary is attached as tree-sitter-bash-openharmony-arm64.node.zip (1.4MB unzipped). It was compiled with:

CC=clang CXX=clang++ npx node-gyp rebuild

on OpenHarmony using the official DevBox clang (v15.0.4).

Verification

  • node-gyp-build correctly finds the openharmony-arm64 prebuilt
  • ✅ Binary loads and runs successfully on OpenHarmony
  • ✅ Correct runtime dependencies: libc++_shared.so + libc.so
  • ✅ OpenClaw (the AI agent framework that depends on tree-sitter-bash) works normally

Context

This issue was discovered while investigating why npm install -g openclaw@latest fails on OpenHarmony.

Detailed analysis (5-layer blocking chain, ABI comparison, and full verification log) is attached as README.md.

Adding this single prebuilt would enable tree-sitter-bash to work out-of-the-box on OpenHarmony, without requiring users to install additional toolchains or manually compile native modules.

README.md

tree-sitter-bash-openharmony-arm64.node.zip

Activity

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