-
Notifications
You must be signed in to change notification settings - Fork 4k
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
strip_include_prefix
doesn't apply to textual_hdrs
#12424
Comments
This caused every single directory tree with a tblgen output in it to be in the `-isystem` header search path. That is far from desirable, and was hiding a large number of issues reaching both generated files and source files with `#include`. On MacOS it also manifested in an amazing problem where a header in Clang's AST library called `Availability.h` ended up being used instead of an internal header by the same name inside of the MacOS libc to provide system availability macros to the libc headers. The resulting errors were... fun. To get these generated files to be found, this change adds `strip_include_prefix` where necessary to make the relevant headers available at the expected paths. This is much more narrow and focused. Making it fully work requires two other workarounds. First, we need to introduce extra globs or libraries to provide the same headers through different include paths in a few places that were being hidden by the `includes` from `tblgen`. Second, we have to switch to `hdrs` instead of `textual_hdrs` in numerous places to work around a Bazel bug: bazelbuild/bazel#12424 However, with this, we get the Bazel side to a clean, principled implementation of the requirements of LLVM.
Thank you for contributing to the Bazel repository! This issue has been marked as stale since it has not had any activity in the last 2+ years. It will be closed in the next 14 days unless any other activity occurs or one of the following labels is added: "not stale", "awaiting-bazeler". Please reach out to the triage team ( |
@bazelbuild/triage - This is definitely still relevant and I'd like to see it resolved. Pretty sure it was triaged and a team added back in 2020, but then marked as untriaged... 🤷 |
Description of the problem / feature request:
strip_include_prefix
incc_*
rules is super useful, but it needs to apply totextual_hdrs
as well ashdrs
. The inconsistency is extremely problematic for rules successfully using eithertextual_hdrs
orstrip_include_prefix
.Bugs: what's the simplest, easiest way to reproduce this bug? Please provide a minimal example if possible.
Given this rule:
Rules depending on
:test
can#include "normal_header.h"
as expected, but cannot#include "textual_header.h"
.What operating system are you running Bazel on?
Impacts all OSes AFAICT, tested on Linux.
What's the output of
bazel info release
?release 3.3.1
The text was updated successfully, but these errors were encountered: