[libcxx-commits] [libcxx] Commit mostly working single wrapped module map (PR #87402)

Ian Anderson via libcxx-commits libcxx-commits at lists.llvm.org
Fri Apr 5 09:58:29 PDT 2024


ian-twilightcoder wrote:

> > Once you do have proper modules for the C headers, they quickly introduce cycles. i.e. inttypes.h includes stdint.h. If those are in the same module in libc++ then you get a module cycle: std -> c_inttypes -> std -> c_stdint. Single giant module just doesn't work, and it's not an Apple SDK specific problem, it's any system that actually supports clang modules.
> 
> What systems support Clang modules? What can I build today, on Linux using Clang modules?

Out of the box only the Apple SDK supports clang modules. Swift adds module maps to Linux and Windows (and soon Android and musl) via vfs, though admittedly some of those module maps have similar issues.
 
> Could you please try building LLVM with modules enabled `-DLLVM_ENABLE_LIBCXX=ON -DLLVM_ENABLE_MODULES=ON` and tell me what happens on your end before and after this patch?

@vsapsai didn't you try this recently? I remember it came up at the team meeting a few weeks ago at least...

> I'm frustrated by your claims that differ entirely from my lived experience using Clang modules. Given that I can and have compiled LLVM with modules on Linux, without issue, I'm unsure how to reproduce the issues.
> 
> I would like to work with you, but I'm unable to experimentally verify your claims. Please help me do that. If we're unable to produce concrete breakages using this module map, then this change should proceed.

This change will definitely break on Apple systems, though the ones in CI are too old to exhibit the breakage.

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


More information about the libcxx-commits mailing list