Skip to content

fix(nodejs): expose headers as a standalone target - #3929

Open
alexeagle wants to merge 1 commit into
bazel-contrib:mainfrom
alexeagle:alexeagle/expose-standalone-node-headers
Open

alexeagle wants to merge 1 commit into
bazel-contrib:mainfrom
alexeagle:alexeagle/expose-standalone-node-headers

Conversation

@alexeagle

Copy link
Copy Markdown
Collaborator

Problem

include_headers = True currently creates the generated :headers cc_library and also wires it into NodeInfo. That makes every consumer of the Node toolchain depend on C++ toolchain resolution.

Some native consumers only need to reference the headers explicitly and should not add that dependency to unrelated Node targets.

Change

Always generate the standalone :headers target, while preserving the existing conditional NodeInfo.headers behavior. Users can depend directly on @nodejs_<platform>//:headers without enabling include_headers.

The existing include_headers = True behavior remains unchanged.

Test

  • bazel test //:using_headers_test --test_output=errors from e2e/headers

@alexeagle
alexeagle marked this pull request as ready for review September 16, 2026 17:59
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 16, 2026

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review Completed 2026-09-16T18:03:11.396341Z cd11276 Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@alexeagle alexeagle changed the title nodejs: expose headers as a standalone target fix(nodejs): expose headers as a standalone target Sep 16, 2026
Comment thread nodejs/repositories.bzl
build_content += """
build_content += """
load("@rules_cc//cc:defs.bzl", "cc_library")
cc_library(

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you just want access to the files or are you explicitly looking for the compiled cc_library?

We could always put the files into a filegroup but keep the cc_library behind the flag 🤷

Comment thread nodejs/repositories.bzl
build_content += """
build_content += """
load("@rules_cc//cc:defs.bzl", "cc_library")
cc_library(

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this be tagged as manual? Even without your change, but especially after it...

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.

2 participants