https://gcc.gnu.org/bugzilla/show_bug.cgi?id=119154
--- Comment #15 from Nathaniel Shead <nshead at gcc dot gnu.org> --- (In reply to Igor Machado Coelho from comment #14) > P.S.: > > If I can quickly hijack this issue for another question, I really need to > understand something about module map file on -fmodule-mapper on GCC, for > this same Bazel experiment, and couldn't find this information anywhere... > maybe it's another bug, I don't know (if it is, I will open it too). If I > have two gcm modules stored in a folder gcm.cache/ differently from where > I'm running the gcc command, example, > ./myproject/bla/bla/gcm.cache/module1.gcm (and module2.gcm) and then I try > to build in the following way: > g++-15 -fmodules -std=c++23 -c ./myproject/bla/bla/module3.cppm > -fmodule-mapper=myproject/bla/bla/mapper.txt > > And mapper.txt is: > module1 gcm.cache/module1.gcm > module2 gcm.cache/module2.gcm > > Is it supposed to work or the mapper.txt format is supposed to be much more > complicated than just module_name and module_path, one per line? I could not > make it work on g++-15. Thanks again! I assume you've seen https://gcc.gnu.org/onlinedocs/gcc/C_002b_002b-Module-Mapper.html which has documentation on the various syntaxes available for module mappers. The thing I immediately notice is that the paths in the module mapper are relative to the working directory of the compiler invocation, not the working directory of the mapper file itself, which may be what's causing your issue. You can use: $root myproject/bla/bla as the first line of the mapper to change that, but perhaps there should be a more convenient way to express this (especially if the mapper file doesn't know where it lives); if you need this feel free to open an enhancement request.