fix: pre-download node-gyp headers to avoid install race condition#260
fix: pre-download node-gyp headers to avoid install race condition#260
Conversation
Co-authored-by: Cursor <cursoragent@cursor.com>
There was a problem hiding this comment.
Pull request overview
This PR aims to prevent race conditions during native addon compilation in the CI workflow by pre-downloading Node.js headers using npx node-gyp install before running yarn install. However, upon review of the repository, this appears to be a documentation/specification repository with only prettier as a dependency—a pure JavaScript package that requires no native compilation.
Changes:
- Modified the CI workflow to run
npx node-gyp installbeforeyarn install
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
.github/workflows/ci.yml
Outdated
| - name: Install dependencies | ||
| run: yarn install | ||
| run: | | ||
| npx node-gyp install |
There was a problem hiding this comment.
The npx node-gyp install command appears unnecessary for this repository. According to package.json, the only dependency is prettier (a pure JavaScript package with no native components). The node-gyp tool is only needed when installing packages with native C/C++ addons that require compilation. Adding this step will slow down CI builds without providing any benefit, as there are no native modules to compile. Consider removing this line unless there are plans to add native dependencies in the future.
| npx node-gyp install |
| run: | | ||
| npx node-gyp install | ||
| yarn install |
There was a problem hiding this comment.
The PR description mentions preventing race conditions when "multiple native addon compilations" occur, but this repository only has prettier as a dependency, which is a pure JavaScript package with no native components. There appears to be a mismatch between the stated purpose of this change and the actual dependencies in package.json. If this change is intended to prevent a specific race condition issue, please provide details about which native addons are being compiled.
Co-authored-by: Cursor <cursoragent@cursor.com>
|
@copilot fix this workflow failure: |
Summary
npx node-gyp installbeforeyarn installin the CI workflowyarn installdon't race to download the same headers simultaneouslyFiles changed
.github/workflows/ci.yml- addednpx node-gyp installbeforeyarn install