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.
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_hdrstest files and BUILD rule - Extend
_compute_public_headerssignature and logic for non-module headers - Integrate
textual_headersinto 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"
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 bazelbuild#12424 This reverts commit 35fb97f. Closes bazelbuild#26327. PiperOrigin-RevId: 776069042 Change-Id: Iecbcf1db90dc021582c08753517b2d27dd04eb34
5b24d05 to
6b8ed14
Compare
|
this was reverted again in dfc72d0 |
|
I pushed the fix here |
trybka
left a comment
There was a problem hiding this comment.
LGTM. Tested with some of the internal breakages I was tracking. The added test failed before these fixes, and passes now.
|
I'll start importing this one. |
|
@iancha1992 hit any blockers? |
|
|
Can you rebase this? I suspect some changes may need to be made after some changes to introduce _ModuleMapInfo provider. Currently getting : |
2a85b83 to
8734d18
Compare
|
fixed, looks like it was just that thing needing a new field |
29317f9 to
0bbb178
Compare
0bbb178 to
28f3f6d
Compare
|
rebased to fix the conflict and add missing rules_cc imports, AFAIUI the tests are only failing because of how this has to mirrored to rules_cc at the same time as the import |
|
is there a separate change for rules_cc as well? |
|
No but I can make one if that is easier |
|
created bazelbuild/rules_cc#537 if that's easier |
b366afe to
63fc241
Compare
|
The goal would be to enable it internally soon as well, but to be able to approve this change without blocking on said clean-up. Are the buildkite failures something we can address in this change, or are they just related to rules_cc version skew? |
|
Yea it's that it's reading the rules_cc one for the tests which isn't sync'd. |
Copybara Import from #537 BEGIN_PUBLIC Make strip_include_prefix apply to textual_hdrs (#537) Mirror of bazelbuild/bazel#26327 Closes #537 END_PUBLIC COPYBARA_INTEGRATE_REVIEW=#537 from keith:ks/make-strip_include_prefix-apply-to-textual_hdrs 72348e4 PiperOrigin-RevId: 859124025 Change-Id: I5425de1829802ee03b8d8a793bea83998ae5aebd
63fc241 to
2aa0e68
Compare
2aa0e68 to
174d23c
Compare
|
@trybka want to merge this test case for the changes we landed in rules_cc? |
|
moved this to rules_cc instead bazelbuild/rules_cc#634 |
Fixes #12424
This reverts commit dfc72d0.