-
Notifications
You must be signed in to change notification settings - Fork 4.4k
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_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"
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 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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Tested with some of the internal breakages I was tracking. The added test failed before these fixes, and passes now.
|
@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 |
src/main/starlark/builtins_bzl/common/cc/compile/cc_compilation_helper.bzl
Outdated
Show resolved
Hide resolved
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 |
This makes the test fail in blaze but not bazel to spot issues with this feature.
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. |
Fixes #12424
This reverts commit dfc72d0.