Skip to content

fix: make CcInfo/cc dep in nodejs toolchain opt-in via include_headers attribute#3760

Merged
gregmagolan merged 1 commit into
mainfrom
add_include_headers_option
Jun 8, 2024
Merged

fix: make CcInfo/cc dep in nodejs toolchain opt-in via include_headers attribute#3760
gregmagolan merged 1 commit into
mainfrom
add_include_headers_option

Conversation

@gregmagolan

@gregmagolan gregmagolan commented Jun 8, 2024

Copy link
Copy Markdown
Collaborator

Fixes #3722.

Having a cc_library target always included in the headers field of the NodeInfo provided by the Node.js toolchain means that there must be always c++ toolchain available when using rules_nodejs which is not desirable. This change makes the cc_library target in headers an opt-in via the include_headers attribute.

Users can set this attribute as follows,

WORKSPACE:

load("@rules_nodejs//nodejs:repositories.bzl", "nodejs_register_toolchains")
nodejs_register_toolchains(include_headers = True, ...)

MODULE.bazel

node = use_extension("@rules_nodejs//nodejs:extensions.bzl", "node", dev_dependency = True)
node.toolchain(include_headers = True, ...)

@gregmagolan gregmagolan force-pushed the add_include_headers_option branch 4 times, most recently from 6d8c697 to afbee5a Compare June 8, 2024 15:47
@gregmagolan gregmagolan force-pushed the add_include_headers_option branch from afbee5a to 98d12b7 Compare June 8, 2024 15:47
@gregmagolan gregmagolan marked this pull request as ready for review June 8, 2024 15:51
Comment thread .bazelci/presubmit.yml
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[FR]: Separate toolchain for for C++ headers

2 participants