fix: skip tree-sitter native build via trustedDependencies allowlist (#2278)

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 <grammar-dir>.

Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
Alex Newman
2026-05-03 14:58:54 -07:00
committed by GitHub
parent 794745b3a3
commit 99ff296f6f
2 changed files with 6 additions and 0 deletions
+3
View File
@@ -35,6 +35,9 @@
"overrides": {
"tree-sitter": "^0.25.0"
},
"trustedDependencies": [
"tree-sitter-cli"
],
"engines": {
"node": ">=18.0.0",
"bun": ">=1.0.0"
+3
View File
@@ -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'