Skip to content

feat: add jobs option to control node-gyp parallel compilation - #1290

Merged
erickzhao merged 1 commit into
mainfrom
feat/node-gyp-jobs
Jul 3, 2026
Merged

feat: add jobs option to control node-gyp parallel compilation#1290
erickzhao merged 1 commit into
mainfrom
feat/node-gyp-jobs

Conversation

@claude

@claude claude Bot commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

Requested by Samuel Attard · Slack thread

Before

Native module compilation always ran single-threaded because rebuild never passed node-gyp a job count, leaving node-gyp to build with a single compile job.

After

Callers can set a jobs option (or the --jobs / -j CLI flag) to control how many parallel compile jobs node-gyp runs. When unset, node-gyp's own default is used, so existing behavior is unchanged.

How

A flat top-level jobs?: number option is threaded through RebuildOptionsIRebuilderbuildArgs(), matching the existing flat convention (arch, debug, etc.) rather than a nested bag. In buildArgs() the value is emitted as node-gyp's --jobs=<n> flag only when set. The CLI exposes it as --jobs/-j, validated as numeric and passed into the rebuild call.

Closes #303

Native module builds ran single-threaded because rebuild never passed
node-gyp a job count. Add a flat `jobs` option (CLI `--jobs`/`-j`) that
is threaded through RebuildOptions -> IRebuilder -> buildArgs and emitted
as node-gyp's `--jobs=<n>` flag when set.

Closes #303
@MarshallOfSound
MarshallOfSound marked this pull request as ready for review July 1, 2026 05:48
@MarshallOfSound
MarshallOfSound requested a review from a team as a code owner July 1, 2026 05:48
@erickzhao
erickzhao merged commit 2d5d8e5 into main Jul 3, 2026
10 checks passed
@erickzhao
erickzhao deleted the feat/node-gyp-jobs branch July 3, 2026 14:12
@electron-npm-package-publisher

Copy link
Copy Markdown

🎉 This PR is included in version 4.2.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Expose node-gyp's jobs For Multi Core Building

3 participants