Skip to content

Make strip_include_prefix apply to textual_hdrs - #537

Closed
keith wants to merge 2 commits into
bazelbuild:mainfrom
keith:ks/make-strip_include_prefix-apply-to-textual_hdrs
Closed

Make strip_include_prefix apply to textual_hdrs#537
keith wants to merge 2 commits into
bazelbuild:mainfrom
keith:ks/make-strip_include_prefix-apply-to-textual_hdrs

Conversation

@keith

@keith keith commented Nov 27, 2025

Copy link
Copy Markdown
Member

@keith

keith commented Nov 27, 2025

Copy link
Copy Markdown
Member Author

cc @trybka

@armandomontanez armandomontanez left a comment

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.

Will probably take a bit to get this one merged.

@armandomontanez

Copy link
Copy Markdown
Collaborator

Still seeing failures internally, we might need to put this behind a flag if we don't want to block on Whatever Problems Google Has.

@keith

keith commented Dec 19, 2025

Copy link
Copy Markdown
Member Author

are you thinking a top level bazel flag, or a magic feature to opt out of this behavior, or?

also is there a bug in the implementation that only google is seeing? or is it just that maybe you have to update your #include if the textual_hdrs match the strip_include_prefix? (I thought you would still be able to access them through the fully path 🤔 )

@trybka

trybka commented Dec 19, 2025

Copy link
Copy Markdown
Collaborator

I think we could handle it in semantics.bzl rather than a flag or a feature.

The former would need to either be in Java or Starlark Build Flags both of which seem pretty onerous, the latter of which would need to be yet-another-feature we need to check and we've already encoutered issues using features for this in the past (notably things like platform.flags dropping them on the floor: https://bazel.build/reference/be/platforms-and-toolchains#platform_flags_repeated).

@keith
keith force-pushed the ks/make-strip_include_prefix-apply-to-textual_hdrs branch from 6e30a20 to 72348e4 Compare December 19, 2025 21:06
@keith

keith commented Dec 19, 2025

Copy link
Copy Markdown
Member Author

pushed a boolean to that file which can disable this behavior, wdyt about that? idk how your replacements for that file work but I assume it might have the downside that it cannot be enabled in some places and not others (notably the original feature requester of this is a googler)

@trybka

trybka commented Dec 23, 2025

Copy link
Copy Markdown
Collaborator

(Replied to the wrong PR...)

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.

(The buildkite failures are only in the other PR)

It looks like this is passing most of the builds that were failing before.

@keith
keith deleted the ks/make-strip_include_prefix-apply-to-textual_hdrs branch January 21, 2026 18:05
Comment on lines +465 to +466
if external or feature_configuration.is_requested("system_include_paths"):
external_include_dirs.append(textual_headers.virtual_include_path)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Should this be updating system_include_dirs_for_context too / instead? That is, perhaps

Suggested change
if external or feature_configuration.is_requested("system_include_paths"):
external_include_dirs.append(textual_headers.virtual_include_path)
if external:
external_include_dirs.append(textual_headers.virtual_include_path)
elif feature_configuration.is_requested("system_include_paths"):
system_include_dirs_for_context.append(textual_headers.virtual_include_path)

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

thanks! #800

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.

4 participants