fix(@stdlib/_tools/pkgs/addons): require binding.gyp to detect a native add-on#13233
Draft
Planeshifter wants to merge 2 commits into
Draft
fix(@stdlib/_tools/pkgs/addons): require binding.gyp to detect a native add-on#13233Planeshifter wants to merge 2 commits into
binding.gyp to detect a native add-on#13233Planeshifter wants to merge 2 commits into
Conversation
…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
…`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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This pull request:
@stdlib/_tools/pkgs/addonsto also require abinding.gypfile, not justsrc/Makefile.Failing run: https://github.com/stdlib-js/stdlib/actions/runs/28557481039
Symptom:
random_benchmarksfails whenever its daily random package sample includes a WebAssembly-only package underblas/base/wasm/*, withgyp: binding.gyp not found. 24 of the last 30 nightly runs ondevelopfailed this way.Root cause:
inspect.js(async) andsync.jsclassify a package as a native add-on solely by checking forsrc/Makefile. WASM-only packages also ship asrc/Makefile(used to build.wasm/.watartifacts viawasm2wat/wasm2js), but have nobinding.gypanywhere in the package. Wheninstall-node-addonsrunsnode-gyp rebuildagainst one of these, it fails immediately, aborting the job.Fix: additionally require a
binding.gypfile — the filenode-gypitself 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
This pull request has no related issues.
Questions
No.
Other
Validation: confirmed via direct filesystem check that all real native add-on packages (e.g.
math/base/special/abs) carrybinding.gypat the package root alongsidesrc/Makefile, and that WASM-only packages (e.g.blas/base/wasm/scnrm2) have nobinding.gypanywhere. A repo-wide audit (part of review) found zerobinding.gypfiles outside package roots, so this cannot misclassify a legitimate add-on.node -csyntax check passed on both files; full package tests could not be run in this environment (third-party dependencies such asglob/tapeare not installed). Three independent agent reviews (correctness, regression scope, style) all approved with no blocking findings.Checklist
AI Assistance
If you answered "yes" above, how did you use AI assistance?
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