[libcxx-commits] [libcxx] [libcxx][clang-modules] Fix headers being marked as textual (PR #130723)

Louis Dionne via libcxx-commits libcxx-commits at lists.llvm.org
Thu Mar 20 12:34:47 PDT 2025


https://github.com/ldionne approved this pull request.

> None of these should be `textual` because they have declarations, which becomes a problem because their declarations build into all of their (transitive) includers' modules.

@ian-twilightcoder Correction, they don't contain declarations -- macros only. That may not change the fact that these shouldn't be textual, but I still wanted to clarify.

> I'm on the chrome build team, and we're trying resolve #127012. We want to build libc++ into .pcm files, but this is currently not possible. We have a ([build file](https://source.chromium.org/chromium/chromium/src/+/main:buildtools/third_party/libc++/BUILD.gn;l=144-263;drc=9169de248fc0782050be0aec43372d77156dcf62)) that you can see the general idea in.

Thanks, that's very helpful context.

There's a few places where you folks mentioned "explicit" modules -- what do you mean by that? Do you mean just Clang's `-fmodules` flag, or something else? I usually hear `-fmodules` referred to as "just Clang Modules", and I wonder if "explicit" modules is something else I should pay attention to?

> I'm hoping you'll be satisfied with "it doesn't break anything existing, and @ian-twilightcoder it shouldn't be textual, so the current definition is incorrect".

Having green CI tells me that this is at least not a regression as far as we can tell, so yes, that's helpful. And having someone else with modules expertise chime in and confirm that we want to eliminate textual headers as much as possible is also helpful. I still do think that if this doesn't fail in our CI, then there must be a way to compile libc++'s own code without this patch. For example, you could probably switch to using public includes only from libc++'s own source files and I believe that would fix this issue. That being said, I am also happy (probably happier, even) with actually fixing our modulemap, so this LGTM assuming CI passes.

https://github.com/llvm/llvm-project/pull/130723


More information about the libcxx-commits mailing list