Skip to content

Make strip_include_prefix apply to textual_hdrs #26327

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

keith
Copy link
Member

@keith keith commented Jun 18, 2025

Fixes #12424

This reverts commit 35fb97f.

@keith keith requested a review from Copilot June 18, 2025 05:08
@keith
Copy link
Member Author

keith commented Jun 18, 2025

new version of #25749

@github-actions github-actions bot added the awaiting-review PR is awaiting review from an assigned reviewer label Jun 18, 2025
@keith
Copy link
Member Author

keith commented Jun 18, 2025

@pzembrod ptal for a reland 🙏🏻 hopefully the solution of allowing textual_hdrs to not start with strip_include_prefix is acceptable. I don't see another solution that won't break existing code. I can squash these commits once you review

Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR reverts a previous change to re-enable applying strip_include_prefix to textual_hdrs. It adds a test case and updates the helper logic to handle textual headers similarly to public headers.

  • Add textual_hdrs test files and BUILD rule
  • Extend _compute_public_headers signature and logic for non-module headers
  • Integrate textual_headers into compilation context (include paths, coverage mapping, declared inputs)

Reviewed Changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
src/main/starlark/tests/.../test_include_textual.cc New C++ test covering strip_include_prefix on textual headers
src/main/starlark/tests/.../not_nested.h New textual header outside nested dir
src/main/starlark/tests/.../nested/lib.h New nested header
src/main/starlark/tests/.../nested/lib.cc Implementation of foo() and its include
src/main/starlark/tests/.../BUILD.builtin_test Add cc_library/cc_test with strip_include_prefix and textual_hdrs
src/main/starlark/builtins_bzl/common/cc/compile/cc_compilation_helper.bzl Update _compute_public_headers signature and logic; wire textual headers into context
Comments suppressed due to low confidence (1)

src/main/starlark/tests/builtins_bzl/cc/basics/test/nested/lib.cc:14

  • When using strip_include_prefix = "nested", the header should be included as #include "lib.h" (or #include "nested/lib.h" before stripping) instead of the full workspace path to match the virtual include layout.
#include "src/main/starlark/tests/builtins_bzl/cc/basics/test/nested/lib.h"

@pzembrod pzembrod assigned pzembrod and unassigned pzembrod Jun 18, 2025
@pzembrod pzembrod self-requested a review June 18, 2025 18:24
@pzembrod
Copy link
Contributor

@pzembrod ptal for a reland 🙏🏻 hopefully the solution of allowing textual_hdrs to not start with strip_include_prefix is acceptable. I don't see another solution that won't break existing code. I can squash these commits once you review

Yes, your reasoning makes sense to me. And I'd actually be okay with leaving the two commits; once they get piped through the import and export mechanism, they will turn into one commit in the end anyway, I think.

@pzembrod pzembrod added awaiting-PR-merge PR has been approved by a reviewer and is ready to be merge internally and removed awaiting-review PR is awaiting review from an assigned reviewer labels Jun 18, 2025
@keith
Copy link
Member Author

keith commented Jun 18, 2025

ok great, any thoughts on #25749 (comment)

@iancha1992
Copy link
Member

@bazel-io fork 8.3.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
awaiting-PR-merge PR has been approved by a reviewer and is ready to be merge internally
Projects
None yet
Development

Successfully merging this pull request may close these issues.

strip_include_prefix doesn't apply to textual_hdrs
3 participants