Skip to content

fix(ci): drop broken -t 22 from prebuildify in build-tree-sitter-prebuilds#2121

Merged
magyargergo merged 1 commit into
abhigyanpatwari:mainfrom
magyargergo:fix/prebuildify-napi-target
Jun 9, 2026
Merged

fix(ci): drop broken -t 22 from prebuildify in build-tree-sitter-prebuilds#2121
magyargergo merged 1 commit into
abhigyanpatwari:mainfrom
magyargergo:fix/prebuildify-napi-target

Conversation

@magyargergo

Copy link
Copy Markdown
Collaborator

Problem

The first real run of build-tree-sitter-prebuilds (dispatched on main after #2113 merged) failed on every matrix job — e.g. c linux-arm64:

TypeError: v.indexOf is not a function
    at resolveTargets (prebuildify/index.js:317:21)

The build step ran prebuildify --napi --strip -t 22. prebuildify parses the bare -t 22 as the number 22, then calls .indexOf (a string method) on it in resolveTargets → crash. The workflow had never actually run before (swift's prebuilds were upstream-copied), so this was latent.

Fix

Drop -t 22. An N-API prebuild is Node-version-agnostic, so targeting a Node version is both unnecessary and the cause.

Verification

Reproduced + verified locally against the vendored tree-sitter-c source:

  • prebuildify --napi --strip -t 22 → the exact v.indexOf is not a function crash.
  • prebuildify --napi --strip (no -t) → exit 0, produces prebuilds/linux-x64/tree-sitter-c.node, which exports napi_register_module_v1 (confirmed N-API).

After this merges, re-dispatch build-tree-sitter-prebuilds (grammars=all, force=true) to populate c/dart/proto/kotlin prebuilds.

🤖 Generated with Claude Code

…prebuilds)

The native build step ran `prebuildify --napi --strip -t 22`, but prebuildify
parses the bare `-t 22` as the NUMBER 22 and crashes in resolveTargets
(`TypeError: v.indexOf is not a function`) — so every matrix job (c/dart/proto/
kotlin × 6 tuples) failed on its first real run. N-API prebuilds are
Node-version-agnostic, so `-t <node-version>` is both wrong and the cause; drop
it. Verified locally: `prebuildify --napi --strip` builds the vendored c source
cleanly into prebuilds/<tuple>/tree-sitter-c.node and exports
napi_register_module_v1.
@vercel

vercel Bot commented Jun 9, 2026

Copy link
Copy Markdown

@magyargergo is attempting to deploy a commit to the NexusCore Team on Vercel.

A member of the Team first needs to authorize it.

@github-actions

github-actions Bot commented Jun 9, 2026

Copy link
Copy Markdown
Contributor

CI Report

All checks passed

Pipeline Status

Stage Status Details
✅ Typecheck success tsc --noEmit
✅ Tests success unit tests, 3 platforms
✅ E2E success gitnexus-web changes only

Test Results

Tests Passed Failed Skipped Duration
10841 10825 0 16 540s

✅ All 10825 tests passed

16 test(s) skipped — expand for details
  • COBOL pipeline benchmark > scales with file count
  • C++ ADL emit benchmark > emit phase scales sub-quadratically with co-scaled files and sites
  • C++ pipeline benchmark > scales with file count
  • C# pipeline benchmark > scales with file count — namespaces spread across the solution
  • C# pipeline benchmark > scales with file count — all types in one (global) namespace bucket
  • C# pipeline benchmark > scales with file count — all types in one (named) namespace bucket
  • Go pipeline benchmark > scales with file count (workers enabled)
  • Go pipeline benchmark — worker pool (issue Worker idle timeout kills long Go scope extraction and surfaces as Napi::Error during analyze #1848) > does not quarantine the large generated Go file on sub-batch idle timeout
  • Go structural interface detection benchmark > scales linearly with interface × struct count
  • Go structural interface detection split-phase benchmark > separates index-build and detection time
  • PHP pipeline benchmark > scales with file count (workers enabled)
  • Ruby pipeline benchmark > scales with file count (workers enabled)
  • Rust pipeline benchmark > scales with file count (workers enabled)
  • Vue pipeline benchmark > scales with component count
  • run.cjs direct-exec entrypoint (fix(cli): steer docs, skills, and hooks through a CLI-neutral project-local runner (#1939) #1945) > resolves a .cmd shim via the Windows shell branch, passing args and exit code
  • buildTypeEnv > known limitations (documented skip tests) > Ruby block parameter: users.each { |user| } — closure param inference, different feature

Code Coverage

Tests

Metric Coverage Covered Base Delta Status
Statements 75.06% 35448/47221 N/A% 🟢 ███████████████░░░░░
Branches 62.81% 21902/34869 N/A% 🟢 ████████████░░░░░░░░
Functions 80.81% 3829/4738 N/A% 🟢 ████████████████░░░░
Lines 78.87% 32052/40639 N/A% 🟢 ███████████████░░░░░

📋 View full run · Generated by CI

@magyargergo magyargergo merged commit 6ab3f64 into abhigyanpatwari:main Jun 9, 2026
54 of 57 checks passed
@magyargergo magyargergo deleted the fix/prebuildify-napi-target branch June 9, 2026 18:02
magyargergo added a commit to buihongduc132/GitNexus that referenced this pull request Jun 10, 2026
…bhigyanpatwari#2124)

The describe() title cited abhigyanpatwari#2121, which is the unrelated prebuildify CI
fix (drop broken -t 22 from prebuildify), not the registry-wipe bug. No
dedicated issue exists for this fix, so reference PR abhigyanpatwari#2124 instead so
git blame / bisect readers land on the actual change.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
magyargergo added a commit that referenced this pull request Jun 10, 2026
* fix(storage): prevent registry wipe on transient I/O errors

listRegisteredRepos({ validate: true }) used a bare catch {} that
treated ALL fs.access() errors as 'index gone.' Under swap pressure
or I/O storms, EIO/EAGAIN/EBUSY/EACCES errors caused ALL entries to
be pruned and writeRegistry([]) was called — permanently wiping the
registry.

Fix: only prune on ENOENT (file genuinely gone) or ENOTDIR (structural
removal). Transient errors keep the entry alive.

Includes 5 regression tests covering ENOENT, ENOTDIR, EACCES, EIO,
and EAGAIN.

* test(storage): point registry transient-error test at the right PR (#2124)

The describe() title cited #2121, which is the unrelated prebuildify CI
fix (drop broken -t 22 from prebuildify), not the registry-wipe bug. No
dedicated issue exists for this fix, so reference PR #2124 instead so
git blame / bisect readers land on the actual change.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* test(storage): remove unused os import (CodeQL alert 693)

The os import was never referenced. Removes the code-scanning
unused-import alert and the PR autofix finding.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* test(storage): cover partial prune, on-disk persistence, and EBUSY

The original bug was about *persisting* the wrong registry list, but the
tests only checked the in-memory return value of a single-entry registry.
Add coverage for the paths that actually exercise persistence:

- mixed-batch partial prune: register two repos, fail one with ENOENT and
  the other with EIO in the same validation call, then read registry.json
  off disk and assert exactly the EIO survivor was persisted (not [] from
  over-prune, not both from a no-op). This is the off-by-one path.
- assert the on-disk registry is unchanged in the EACCES/EIO/EAGAIN keep
  tests (the keep path must not rewrite/shrink the file).
- assert the ENOENT prune is persisted ([] written) as a regression guard.
- add the EBUSY keep case named in the source comment but previously
  untested.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* docs(storage): clarify the keep-branch comment (EACCES may be permanent)

The previous comment called EACCES "transient," but EACCES is often
permanent (e.g. a chmod'd directory). Reframe the comment around the
actual decision rule — prune only when the index is provably gone
(ENOENT/ENOTDIR), keep on everything else — and note that keeping a
possibly-permanent error is still the correct conservative choice
(a stale entry is harmless and removable; an over-prune destroys data).
Comment-only; behavior unchanged.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* feat(storage): warn when keeping a registry entry on a non-fatal fs error

The keep branch was silent, so an I/O storm that keeps entries alive (the
whole point of the fix) was invisible in logs. Emit a structured
logger.warn naming the entry and the fs.access error code on the keep
path only. Observability-only: the keep/prune decision is unchanged and
the warn cannot throw.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* docs(storage): describe listRegisteredRepos validate semantics accurately

The doc comment said validation checks each entry's .gitnexus/ "still
exists," which no longer matches the keep-on-transient behavior. Spell
out that validation prunes only provably-gone indexes (ENOENT/ENOTDIR)
and keeps entries that are merely not provably absent — so a kept entry
is "not confirmed present," not "confirmed present."

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* style(storage): prettier-format the transient-error test imports

Collapse the multi-line repo-manager import to a single line per Prettier,
clearing the PR autofix formatting finding. Formatting-only.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: buihongduc132 <buihongduc132@gmail.com>
Co-authored-by: Gergő Magyar <gergomagyar@icloud.com>
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant