build: pin node-addon-api 6.x at root to avoid MSBuild tlog race#319398
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR mitigates a Windows MSBuild tlog race during parallel native module builds by preventing node-addon-api from being hoisted to the workspace root, forcing each consumer to get its own nested copy.
Changes:
- Add a root-level
node-addon-api^6.0.0dependency to occupy the hoisted slot. - Update root
package-lock.jsonsonode-addon-api@7.xis nested under each native-addon consumer instead of shared. - Apply the same dependency/lockfile change to
remote/to cover remote server builds as well.
Reviewed changes
Copilot reviewed 2 out of 4 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| package.json | Adds a root node-addon-api@^6.0.0 dependency to block hoisting of 7.x used by native addons. |
| package-lock.json | Updates resolution so node-addon-api@7.x is nested per consumer, with root node-addon-api resolving to 6.1.0. |
| remote/package.json | Mirrors the root change for the remote server package’s dependency graph. |
| remote/package-lock.json | Mirrors the lockfile resolution updates for the remote server package. |
Files not reviewed (1)
- remote/package-lock.json: Language not supported
rzhao271
approved these changes
Jun 1, 2026
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.
@vscode/spdlog, @vscode/windows-mutex, and @vscode/windows-process-tree all depend on node-addon-api ^7.1.0, so npm hoists a single copy to node_modules/node-addon-api. node-gyp then references it via a relative path that is one level too shallow, landing MSBuild artifacts under
node_modules/@vscode/node-addon-api/— a directory written to in parallel by every consumer. This races with tlog file generationAfter reading dotnet/msbuild#10814 msbuild already generates a unique folder under the parent directory. Adding an unused node-addon-api ^6.0.0 dep at the root occupies the hoisted slot without matching any real consumer, forcing each 7.1.0 consumer into its own private nested copy avoiding any file locks.