Skip to content

fix(@stdlib/_tools/pkgs/addons): require binding.gyp to detect a native add-on#13233

Draft
Planeshifter wants to merge 2 commits into
developfrom
philipp/ci-fix-random-benchmarks-wasm-addon-2026-07-02
Draft

fix(@stdlib/_tools/pkgs/addons): require binding.gyp to detect a native add-on#13233
Planeshifter wants to merge 2 commits into
developfrom
philipp/ci-fix-random-benchmarks-wasm-addon-2026-07-02

Conversation

@Planeshifter

Copy link
Copy Markdown
Member

Description

What is the purpose of this pull request?

This pull request:

  • fixes native add-on detection in @stdlib/_tools/pkgs/addons to also require a binding.gyp file, not just src/Makefile.

Failing run: https://github.com/stdlib-js/stdlib/actions/runs/28557481039

Symptom: random_benchmarks fails whenever its daily random package sample includes a WebAssembly-only package under blas/base/wasm/*, with gyp: binding.gyp not found. 24 of the last 30 nightly runs on develop failed this way.

Root cause: inspect.js (async) and sync.js classify a package as a native add-on solely by checking for src/Makefile. WASM-only packages also ship a src/Makefile (used to build .wasm/.wat artifacts via wasm2wat/wasm2js), but have no binding.gyp anywhere in the package. When install-node-addons runs node-gyp rebuild against one of these, it fails immediately, aborting the job.

Fix: additionally require a binding.gyp file — the file node-gyp itself needs to build — before classifying a package as a native add-on. Applied to both the async (inspect.js) and sync (sync.js) detectors, which duplicate the same detection logic and are both part of this package's public API (findAddons / findAddons.sync).

Related Issues

Does this pull request have any related issues?

This pull request has no related issues.

Questions

Any questions for reviewers of this pull request?

No.

Other

Any other information relevant to this pull request? This may include screenshots, references, and/or implementation notes.

Validation: confirmed via direct filesystem check that all real native add-on packages (e.g. math/base/special/abs) carry binding.gyp at the package root alongside src/Makefile, and that WASM-only packages (e.g. blas/base/wasm/scnrm2) have no binding.gyp anywhere. A repo-wide audit (part of review) found zero binding.gyp files outside package roots, so this cannot misclassify a legitimate add-on. node -c syntax check passed on both files; full package tests could not be run in this environment (third-party dependencies such as glob/tape are not installed). Three independent agent reviews (correctness, regression scope, style) all approved with no blocking findings.

Checklist

Please ensure the following tasks are completed before submitting this pull request.

AI Assistance

When authoring the changes proposed in this PR, did you use any kind of AI assistance?

  • Yes
  • No

If you answered "yes" above, how did you use AI assistance?

  • Code generation (e.g., when writing an implementation or fixing a bug)
  • Test/benchmark generation
  • Documentation (including examples)
  • Research and understanding

Disclosure

This pull request was prepared by Claude Code as part of an automated CI-failure investigation routine. Root cause was identified by reading job logs and the add-on detection source, confirmed against real package fixtures on disk, and validated by three independent agent reviews.


@stdlib-js/reviewers


Generated by Claude Code

…tive add-on

The job `Run random benchmarks` in workflow `random_benchmarks` fails
whenever its daily random package sample includes one of the
WebAssembly-only packages under `blas/base/wasm/*`, with
`gyp: binding.gyp not found`. 24 of the last 30 nightly runs on
develop failed this way.

Root cause: `inspect.js`/`sync.js` classify a package as a native
add-on solely by checking for `src/Makefile`. WASM-only packages also
ship a `src/Makefile` (used to build `.wasm`/`.wat` artifacts via
`wasm2wat`/`wasm2js`), but have no `binding.gyp`, so `install-node-addons` runs `node-gyp rebuild` against them and fails immediately.

This commit additionally requires a `binding.gyp` file — the file
`node-gyp` itself needs to build — before classifying a package as a
native add-on, applied to both the async (`inspect.js`) and sync
(`sync.js`) detectors, which duplicate the same detection logic.

Ref: https://github.com/stdlib-js/stdlib/actions/runs/28557481039
@stdlib-bot stdlib-bot added the Tools Issue or pull request related to project tooling. label Jul 2, 2026
…`inspect.js`

`Lint Changed Files` failed on PR #13233 with `stdlib/vars-order`:
variable declarations inside a function must be ordered by name
length in decreasing order. `onExistsMakefile` declared `j` before
the longer `gpath`. Swap the declaration order to fix.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Tools Issue or pull request related to project tooling.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants