From 99ff296f6f7aa3e22c738654f6c89b7ce524228f Mon Sep 17 00:00:00 2001 From: Alex Newman Date: Sun, 3 May 2026 14:58:54 -0700 Subject: [PATCH] fix: skip tree-sitter native build via trustedDependencies allowlist (#2278) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit bun install fails on Node 25+ because the upstream tree-sitter@0.25.0 package's binding.gyp specifies C++17, but Node 25's V8 headers require C++20 and #error on older standards. The package ships no prebuilds for this platform/Node combo, so node-gyp-build falls back to source compile and dies with hundreds of errors. claude-mem doesn't use the tree-sitter runtime — it only shells out to the prebuilt tree-sitter-cli Rust binary (see Hu/CS in the bundled mcp-server). Add trustedDependencies: ["tree-sitter-cli"] so bun runs the CLI's install.js (downloads the Rust binary) but blocks every other postinstall, including the failing native compile and the unused .node bindings of all 24+ grammar packages. Verified end-to-end on darwin-arm64 / Node 25.9.0: 37 packages install in ~30s, 28 postinstalls correctly blocked, CLI binary works, grammars still JIT-compile via tree-sitter query -p . Co-authored-by: Claude Opus 4.7 (1M context) --- plugin/package.json | 3 +++ scripts/build-hooks.js | 3 +++ 2 files changed, 6 insertions(+) diff --git a/plugin/package.json b/plugin/package.json index 9eadee31..cd48d9d3 100644 --- a/plugin/package.json +++ b/plugin/package.json @@ -35,6 +35,9 @@ "overrides": { "tree-sitter": "^0.25.0" }, + "trustedDependencies": [ + "tree-sitter-cli" + ], "engines": { "node": ">=18.0.0", "bun": ">=1.0.0" diff --git a/scripts/build-hooks.js b/scripts/build-hooks.js index 0add5e52..77a1d6f0 100644 --- a/scripts/build-hooks.js +++ b/scripts/build-hooks.js @@ -101,6 +101,9 @@ async function buildHooks() { overrides: { 'tree-sitter': '^0.25.0' }, + trustedDependencies: [ + 'tree-sitter-cli' + ], engines: { node: '>=18.0.0', bun: '>=1.0.0'