-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
base: master
Are you sure you want to change the base?
Make strip_include_prefix apply to textual_hdrs #26327
Conversation
new version of #25749 |
@pzembrod ptal for a reland 🙏🏻 hopefully the solution of allowing |
There was a problem hiding this 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"
src/main/starlark/builtins_bzl/common/cc/compile/cc_compilation_helper.bzl
Show resolved
Hide resolved
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. |
ok great, any thoughts on #25749 (comment) |
@bazel-io fork 8.3.0 |
Fixes #12424
This reverts commit 35fb97f.