Repository navigation
add headers support to node toolchain - #2
Open
nguyend2017 wants to merge 1 commit into
Open
nguyend2017 wants to merge 1 commit into
nguyend2017 wants to merge 1 commit into
Conversation
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.
| "CcInfo": ctx.attr.headers[CcInfo], | ||
| "DefaultInfo": ctx.attr.headers[DefaultInfo], | ||
| }, | ||
| ), |
There was a problem hiding this comment.
Missing headers crashes custom toolchain definitions
High Severity
The headers attribute is optional (not mandatory, no default), but _node_toolchain_impl unconditionally accesses ctx.attr.headers[CcInfo] and ctx.attr.headers[DefaultInfo]. When a user defines a custom node_toolchain without specifying headers, ctx.attr.headers is None, causing a crash. This breaks backwards compatibility for all existing custom toolchain definitions. The rule's own doc example on line 164 shows a toolchain without headers.
Additional Locations (1)
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.


Note
Medium Risk
Touches toolchain/provider plumbing and repository-generated BUILD content, which can affect toolchain resolution and consumers’ C++ deps; changes are additive but could break custom toolchains if
headersisn’t provided.Overview
The
node_toolchainrule now accepts aheaderscc_librarylabel and propagates its providers throughNodeInfo, and the generated toolchain repositories wire this to a new:headerstarget.Adds
current_node_cc_headers(a toolchain-resolving wrapper that forwardsCcInfo/DefaultInfo) so consumers can depend on@rules_nodejs//nodejs:current_node_cc_headerswithout knowing which Node toolchain is selected, plus an e2e smokecc_binarythat includesnode.h(disabled on Windows where release artifacts don’t ship headers). Documentation is updated to include the new attribute.Written by Cursor Bugbot for commit de9e080. This will update automatically on new commits. Configure here.