Skip to content
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

使用 c++ 20 的 modules (clang++ 19),能否单独清除 module 的依赖文件并重新生成? #5856

Closed
vrecluse opened this issue Nov 21, 2024 · 49 comments

Comments

@vrecluse
Copy link

你在什么场景下需要该功能?

modules 的依赖文件缓存似乎不够聪明,比如
import wrong_module; // wrong_module 不存在
编译生成 module 依赖后,编译到该文件时报错
把它改为正确的如 import right_module;
仍然会报错没有 wrong_module

描述可能的解决方案

有没有单独的命令可以清理module依赖重新生成?现在似乎只能删build目录重新编译

描述你认为的候选方案

No response

其他信息

No response

@Issues-translate-bot
Copy link

Bot detected the issue body's language is not English, translate it automatically.


Title: When using c++ 20 modules (clang++ 19), can you clear the module's dependency files separately and regenerate them?

In what scenario do you need this function?

The dependency file caching of modules seems not smart enough, for example
import wrong_module; // wrong_module does not exist
After compiling and generating module dependencies, an error occurs when compiling to this file.
Change it to the correct one such as import right_module;
The error will still be reported and there is no wrong_module

Describe possible solutions

Is there a separate command to clean up module dependencies and regenerate them? Now it seems that the only option is to delete the build directory and recompile.

Describe your alternatives

No response

Other information

No response

@vrecluse
Copy link
Author

另外如果修改 c++ module include 的其它头文件,似乎不会触发 module 重新编译

@Issues-translate-bot
Copy link

Bot detected the issue body's language is not English, translate it automatically.


In addition, if you modify other header files of c++ module include, it does not seem to trigger module recompilation.

@waruqi
Copy link
Member

waruqi commented Nov 22, 2024

这边可以的么。没法复现。

ruki-2:hello ruki$ xmake
checking for Xcode directory ... /Applications/Xcode.app
checking for SDK version of Xcode for macosx (x86_64) ... 14.0
[  0%]: <hello> generating.module.deps src/main.cpp
error: module dependency hello2 required for src/main.cpp not found
warning: some modules have got culled, use verbose (-v) mode to more informations

ruki-2:hello ruki$ perl -pi -e "s/hello2/hello/g" src/main.cpp

ruki-2:hello ruki$ xmake
checking for Xcode directory ... /Applications/Xcode.app
checking for SDK version of Xcode for macosx (x86_64) ... 14.0
[  0%]: <hello> generating.module.deps src/main.cpp
[ 71%]: compiling.release src/main.cpp
[ 85%]: linking.release hello
[100%]: build ok, spent 2.091s

另外,确保安装了 clang-scan-deps 并已被使用,否则 xmake 只能 fallback 内建的模块依赖分析,精准度肯定没 clang-scan-deps 自带的准。

@vrecluse
Copy link
Author

vrecluse commented Nov 27, 2024

试了下简单小工程没有找到复现的办法。
用的是 clang-scan-deps。
在实际项目中还会时不时出现类似这样的错误,把相应的pcm文件删除后再重新保存一下 .cppm 文件触发重新编译,有时能恢复正常。

error: llvm-ar.exe: error: build\.objs\zfilter\windows\x64\debug\zcode-server\zmod\zmod.absl.cppm.obj: no such file or directory
error: error: unable to open output file 'build\.gens\zutil\windows\x64\debug\rules\bmi\cache\modules\c7a941ae\zmod.absl.pcm': '<C7><EB><C7><F3><B5>IJ<D9><D7><F7><CE><U+07B7><A8><D4><DA>ʹ<D3><C3><D3>û<A7>ӳ<C9><E4><C7><F8><D3><F2><B4><U+BFAB5><C4><
CE>ļ<FE><C9><CF>ִ<D0>С<A3>'

此外,还出现过 cxxmodules 里的信息,应该是 module 的 cppm 文件,识别为 cpp,不去分析 module 依赖的情况。

@Issues-translate-bot
Copy link

Bot detected the issue body's language is not English, translate it automatically.


I tried a simple small project but couldn't find a way to reproduce it.
In actual projects, errors like this will occur from time to time. Delete the corresponding pcm file and then resave the .cppm file to trigger recompilation, and sometimes it can return to normal.

error: llvm-ar.exe: error: build\.objs\zfilter\windows\x64\debug\zcode-server\zmod\zmod.absl.cppm.obj: no such file or directory
error: error: unable to open output file 'build\.gens\zutil\windows\x64\debug\rules\bmi\cache\modules\c7a941ae\zmod.absl.pcm': '<C7><EB><C7><F3><B5>IJ<D9><D7><F7><CE><U+07B7><A8><D4><DA>ʹ<D3><C3> <D3>û<A7> <C9><E4><C7><F8><D3><F2><B4><U+BFAB5><C4><
CE>ļ<FE><C9><CF>ִ<D0>С<A3>'

@waruqi
Copy link
Member

waruqi commented Nov 27, 2024

除非有可复现的步骤,不然这边没法调。或者你这自己跟下源码 调下。

@Issues-translate-bot
Copy link

Bot detected the issue body's language is not English, translate it automatically.


Unless there are reproducible steps, there is no way to adjust it here. Or you can download the source code yourself.

@vrecluse
Copy link
Author

试了下简单小工程没有找到复现的办法。 用的是 clang-scan-deps。 在实际项目中还会时不时出现类似这样的错误,把相应的pcm文件删除后再重新保存一下 .cppm 文件触发重新编译,有时能恢复正常。

error: llvm-ar.exe: error: build\.objs\zfilter\windows\x64\debug\zcode-server\zmod\zmod.absl.cppm.obj: no such file or directory
error: error: unable to open output file 'build\.gens\zutil\windows\x64\debug\rules\bmi\cache\modules\c7a941ae\zmod.absl.pcm': '<C7><EB><C7><F3><B5>IJ<D9><D7><F7><CE><U+07B7><A8><D4><DA>ʹ<D3><C3><D3>û<A7>ӳ<C9><E4><C7><F8><D3><F2><B4><U+BFAB5><C4><
CE>ļ<FE><C9><CF>ִ<D0>С<A3>'

此外,还出现过 cxxmodules 里的信息,应该是 module 的 cppm 文件,识别为 cpp,不去分析 module 依赖的情况。

测试了下,似乎是并行编译 module 的时候有 bug,改了 cppm 并使用 -j1 编译,试了几次没出问题:
企业微信截图_17326869176101

但是如果开启并行编译,就容易出现各种各样的诡异问题:
企业微信截图_17326868941577

image

@waruqi 有什么解决方案么?

@Issues-translate-bot
Copy link

Bot detected the issue body's language is not English, translate it automatically.


I tried a simple small project but couldn't find a way to reproduce it. Use clang-scan-deps. In actual projects, errors like this will occur from time to time. Delete the corresponding pcm file and then resave the .cppm file to trigger recompilation, and sometimes it can return to normal.

error: llvm-ar.exe: error: build\.objs\zfilter\windows\x64\debug\zcode-server\zmod\zmod.absl.cppm.obj: no such file or directory
error: error: unable to open output file 'build\.gens\zutil\windows\x64\debug\rules\bmi\cache\modules\c7a941ae\zmod.absl.pcm': '<C7><EB><C7><F3><B5>IJ<D9><D7><F7><CE><U+07B7><A8><D4><DA>ʹ<D3><C3> <D3>û<A7> <C9><E4><C7><F8><D3><F2><B4><U+BFAB5><C4><
CE>ļ<FE><C9><CF>ִ<D0>С<A3>'

In addition, there is also information in cxxmodules, which should be the cppm file of the module, identified as cpp, and the module dependency is not analyzed.

After testing, it seems that there is a bug when compiling the module in parallel. I changed cppm and used -j1 to compile. I tried it several times and there was no problem:
Enterprise WeChat screenshot_17326869176101

But if parallel compilation is turned on, various weird problems are prone to occur:
Enterprise WeChat screenshot_17326868941577

image

@waruqi Is there any solution?

@waruqi
Copy link
Member

waruqi commented Nov 27, 2024

没,除非能复现,才能调试,我刚说了。目前我这复现不出来

@Issues-translate-bot
Copy link

Bot detected the issue body's language is not English, translate it automatically.


No, you can't debug it unless it can be reproduced, as I just said. I can't reproduce it now

@vrecluse
Copy link
Author

vrecluse commented Nov 27, 2024

error: llvm-ar.exe: error: build\.objs\test6\mingw\x86_64\release\mod\zmod.std.cppm.obj: no such file or directory

这个问题找到一个稳定复现的办法,不过可能跟并行编译的 bug 无关
这个项目先编译一遍
然后把 test6 文件夹复制一份,改名为 test7,把里面 xmake target 改名 test7,再添加 test7 到 xmake.lua 的 includes,
重新编译就会报上面的错误
test.zip

也就是已经编译过的工程,再添加依赖module的项目,会找不到module的obj

@Issues-translate-bot
Copy link

Bot detected the issue body's language is not English, translate it automatically.


error: llvm-ar.exe: error: build\.objs\test6\mingw\x86_64\release\mod\zmod.std.cppm.obj: no such file or directory

Find a stable way to reproduce this problem, but it may not be related to the bug of parallel compilation.
Compile this project first
Then copy the test6 folder and rename it to test7, rename the xmake target inside it to test7, and then add test7 to the includes of xmake.lua.
Recompiling will report the above error
test.zip

@vrecluse
Copy link
Author

error: error: unable to open output file 'build\.gens\test1\mingw\x86_64\release\rules\bmi\cache\modules\3bbb4f22\zmod.std.pcm': '<C7><EB><C7><F3><B5>IJ<D9><D7><F7><CE><U+07B7><A8><D4><DA>ʹ<D3><C3><D3>û<A7>ӳ<C9><E4><C7><F8><D3><F2><B4><U+BFAB5><C4><CE>ļ<FE><C9><CF>ִ<D0>С<A3>'

这个问题也复现了,但不是 100%,重复以下步骤我机器上平均三四次会出现一次,怀疑是并行编译读写文件竞争

rm -rf build && rm -rf .xmake
xmake -j28

重复几次就会出现
test.zip

@Issues-translate-bot
Copy link

Bot detected the issue body's language is not English, translate it automatically.


error: error: unable to open output file 'build\.gens\test1\mingw\x86_64\release\rules\bmi\cache\modules\3bbb4f22\zmod.std.pcm': '<C7><EB><C7><F3><B5>IJ<D9><D7><F7><CE><U+07B7><A8><D4><DA>ʹ<D3><C3> <D3>û< A7> <C9><E4><C7><F8><D3><F2><B4><U+BFAB5><C4><CE>ļ<FE><C9><CF>ִ<D0>С <A3>'

This problem has also been reproduced, but not 100%. Repeating the following steps will occur on my machine once every three or four times on average. I suspect that it is due to parallel compilation reading and writing file competition.

rm -rf build && rm -rf .xmake
xmake -j28

It will appear after repeating it several times
test.zip

@vrecluse
Copy link
Author

error: error: unable to open output file 'build\.gens\test1\mingw\x86_64\release\rules\bmi\cache\modules\3bbb4f22\zmod.std.pcm': '<C7><EB><C7><F3><B5>IJ<D9><D7><F7><CE><U+07B7><A8><D4><DA>ʹ<D3><C3><D3>û<A7>ӳ<C9><E4><C7><F8><D3><F2><B4><U+BFAB5><C4><CE>ļ<FE><C9><CF>ִ<D0>С<A3>'

现在这个工程在我机器上并行编译基本可以必现
@waruqi
似乎跟target依赖和module依赖的复杂程度,以及并行程度都有关系
test8 - test17 都用了同样的依赖,并行编译就容易有文件冲突
test.zip

@vrecluse
Copy link
Author

test.zip
去除了一些噪音的工程
复现条件:
一个 moduleonly 的 target: mod
一个 public 依赖 mod 的静态库 target: test1
多个依赖 test1,并间接依赖 mod 静态库
然后并行编译
xmake -j28

@waruqi
Copy link
Member

waruqi commented Nov 28, 2024

试了几次,还是正常的么。

PS C:\Users\wangrunqing\Downloads\test\test> xmake -r -j28
[  0%]: <test10> generating.module.deps test10\mod.cpp
[  0%]: <test10> generating.module.deps mod\zmod.std.cppm
[  0%]: <test1> generating.module.deps test1\mod.cpp
[  0%]: <test1> generating.module.deps mod\zmod.std.cppm
[  0%]: <zmod> generating.module.deps mod\zmod.std.cppm
[  0%]: <test11> generating.module.deps test11\mod.cpp
[  0%]: <test11> generating.module.deps mod\zmod.std.cppm
[  0%]: <test12> generating.module.deps test12\mod.cpp
[  0%]: <test12> generating.module.deps mod\zmod.std.cppm
[  0%]: <test13> generating.module.deps test13\mod.cpp
[  0%]: <test13> generating.module.deps mod\zmod.std.cppm
[  0%]: <test14> generating.module.deps test14\mod.cpp
[  0%]: <test14> generating.module.deps mod\zmod.std.cppm
[  0%]: <test15> generating.module.deps test15\mod.cpp
[  0%]: <test15> generating.module.deps mod\zmod.std.cppm
[  0%]: <test16> generating.module.deps test16\mod.cpp
[  0%]: <test16> generating.module.deps mod\zmod.std.cppm
[  0%]: <test17> generating.module.deps test17\mod.cpp
[  0%]: <test17> generating.module.deps mod\zmod.std.cppm
[  0%]: <test7> generating.module.deps test7\mod.cpp
[  0%]: <test7> generating.module.deps mod\zmod.std.cppm
[  0%]: <test8> generating.module.deps test8\mod.cpp
[  0%]: <test8> generating.module.deps test9\mod.cpp
[  0%]: <test8> generating.module.deps mod\zmod.std.cppm
[  7%]: <test1> compiling.module.release zmod.std
[  9%]: compiling.release test1\mod.cpp
[ 10%]: archiving.release test1.lib
[ 37%]: <test10> compiling.module.release zmod.std
[ 39%]: <test11> compiling.module.release zmod.std
[ 40%]: <test12> compiling.module.release zmod.std
[ 41%]: <test13> compiling.module.release zmod.std
[ 42%]: <test14> compiling.module.release zmod.std
[ 43%]: <test15> compiling.module.release zmod.std
[ 45%]: <test16> compiling.module.release zmod.std
[ 46%]: <test17> compiling.module.release zmod.std
[ 47%]: <test7> compiling.module.release zmod.std
[ 48%]: <test8> compiling.module.release zmod.std
[ 51%]: compiling.release test10\mod.cpp
[ 53%]: compiling.release test12\mod.cpp
[ 57%]: compiling.release test11\mod.cpp
[ 58%]: compiling.release test13\mod.cpp
[ 63%]: compiling.release test14\mod.cpp
[ 64%]: compiling.release test15\mod.cpp
[ 65%]: compiling.release test16\mod.cpp
[ 71%]: compiling.release test7\mod.cpp
[ 73%]: compiling.release test8\mod.cpp
[ 74%]: compiling.release test9\mod.cpp
[ 75%]: compiling.release test17\mod.cpp
[ 76%]: archiving.release test12.lib
[ 78%]: archiving.release test10.lib
[ 79%]: archiving.release test13.lib
[ 80%]: archiving.release test11.lib
[ 82%]: archiving.release test14.lib
[ 85%]: archiving.release test15.lib
[ 87%]: archiving.release test7.lib
[ 89%]: archiving.release test16.lib
[ 96%]: archiving.release test8.lib
[ 98%]: archiving.release test17.lib
[100%]: build ok, spent 25.281s
warning: std and std.compat modules not found! maybe try to add --sdk=<PATH/TO/LLVM> or install libc++
PS C:\Users\wangrunqing\Downloads\test\test> xmake -r -j28
[  0%]: <test10> generating.module.deps test10\mod.cpp
[  0%]: <test10> generating.module.deps mod\zmod.std.cppm
[  0%]: <test1> generating.module.deps test1\mod.cpp
[  0%]: <test1> generating.module.deps mod\zmod.std.cppm
[  0%]: <zmod> generating.module.deps mod\zmod.std.cppm
[  0%]: <test11> generating.module.deps test11\mod.cpp
[  0%]: <test11> generating.module.deps mod\zmod.std.cppm
[  0%]: <test12> generating.module.deps test12\mod.cpp
[  0%]: <test12> generating.module.deps mod\zmod.std.cppm
[  0%]: <test13> generating.module.deps test13\mod.cpp
[  0%]: <test13> generating.module.deps mod\zmod.std.cppm
[  0%]: <test14> generating.module.deps test14\mod.cpp
[  0%]: <test14> generating.module.deps mod\zmod.std.cppm
[  0%]: <test15> generating.module.deps test15\mod.cpp
[  0%]: <test15> generating.module.deps mod\zmod.std.cppm
[  0%]: <test16> generating.module.deps test16\mod.cpp
[  0%]: <test16> generating.module.deps mod\zmod.std.cppm
[  0%]: <test17> generating.module.deps test17\mod.cpp
[  0%]: <test17> generating.module.deps mod\zmod.std.cppm
[  0%]: <test7> generating.module.deps test7\mod.cpp
[  0%]: <test7> generating.module.deps mod\zmod.std.cppm
[  0%]: <test8> generating.module.deps test8\mod.cpp
[  0%]: <test8> generating.module.deps test9\mod.cpp
[  0%]: <test8> generating.module.deps mod\zmod.std.cppm
[  7%]: <test1> compiling.module.release zmod.std
[  9%]: compiling.release test1\mod.cpp
[ 10%]: archiving.release test1.lib
[ 37%]: <test10> compiling.module.release zmod.std
[ 39%]: <test11> compiling.module.release zmod.std
[ 40%]: <test12> compiling.module.release zmod.std
[ 41%]: <test13> compiling.module.release zmod.std
[ 42%]: <test14> compiling.module.release zmod.std
[ 43%]: <test15> compiling.module.release zmod.std
[ 45%]: <test16> compiling.module.release zmod.std
[ 46%]: <test17> compiling.module.release zmod.std
[ 47%]: <test7> compiling.module.release zmod.std
[ 48%]: <test8> compiling.module.release zmod.std
[ 51%]: compiling.release test10\mod.cpp
[ 54%]: compiling.release test11\mod.cpp
[ 56%]: compiling.release test13\mod.cpp
[ 59%]: compiling.release test12\mod.cpp
[ 60%]: compiling.release test15\mod.cpp
[ 64%]: compiling.release test16\mod.cpp
[ 65%]: compiling.release test14\mod.cpp
[ 71%]: compiling.release test17\mod.cpp
[ 73%]: compiling.release test7\mod.cpp
[ 74%]: compiling.release test8\mod.cpp
[ 75%]: compiling.release test9\mod.cpp
[ 76%]: archiving.release test13.lib
[ 78%]: archiving.release test10.lib
[ 79%]: archiving.release test11.lib
[ 80%]: archiving.release test12.lib
[ 81%]: archiving.release test16.lib
[ 82%]: archiving.release test15.lib
[ 85%]: archiving.release test14.lib
[ 87%]: archiving.release test17.lib
[ 96%]: archiving.release test7.lib
[ 98%]: archiving.release test8.lib
[100%]: build ok, spent 25.093s
warning: std and std.compat modules not found! maybe try to add --sdk=<PATH/TO/LLVM> or install libc++
PS C:\Users\wangrunqing\Downloads\test\test> xmake -r -j28
[  0%]: <test10> generating.module.deps test10\mod.cpp
[  0%]: <test10> generating.module.deps mod\zmod.std.cppm
[  0%]: <test1> generating.module.deps test1\mod.cpp
[  0%]: <test1> generating.module.deps mod\zmod.std.cppm
[  0%]: <zmod> generating.module.deps mod\zmod.std.cppm
[  0%]: <test11> generating.module.deps test11\mod.cpp
[  0%]: <test11> generating.module.deps mod\zmod.std.cppm
[  0%]: <test12> generating.module.deps test12\mod.cpp
[  0%]: <test12> generating.module.deps mod\zmod.std.cppm
[  0%]: <test13> generating.module.deps test13\mod.cpp
[  0%]: <test13> generating.module.deps mod\zmod.std.cppm
[  0%]: <test14> generating.module.deps test14\mod.cpp
[  0%]: <test14> generating.module.deps mod\zmod.std.cppm
[  0%]: <test15> generating.module.deps test15\mod.cpp
[  0%]: <test15> generating.module.deps mod\zmod.std.cppm
[  0%]: <test16> generating.module.deps test16\mod.cpp
[  0%]: <test16> generating.module.deps mod\zmod.std.cppm
[  0%]: <test17> generating.module.deps test17\mod.cpp
[  0%]: <test17> generating.module.deps mod\zmod.std.cppm
[  0%]: <test7> generating.module.deps test7\mod.cpp
[  0%]: <test7> generating.module.deps mod\zmod.std.cppm
[  0%]: <test8> generating.module.deps test8\mod.cpp
[  0%]: <test8> generating.module.deps test9\mod.cpp
[  0%]: <test8> generating.module.deps mod\zmod.std.cppm
[  7%]: <test1> compiling.module.release zmod.std
[  9%]: compiling.release test1\mod.cpp
[ 10%]: archiving.release test1.lib
[ 37%]: <test10> compiling.module.release zmod.std
[ 39%]: <test11> compiling.module.release zmod.std
[ 40%]: <test12> compiling.module.release zmod.std
[ 41%]: <test13> compiling.module.release zmod.std
[ 42%]: <test14> compiling.module.release zmod.std
[ 43%]: <test15> compiling.module.release zmod.std
[ 45%]: <test16> compiling.module.release zmod.std
[ 46%]: <test17> compiling.module.release zmod.std
[ 47%]: <test7> compiling.module.release zmod.std
[ 48%]: <test8> compiling.module.release zmod.std
[ 51%]: compiling.release test13\mod.cpp
[ 54%]: compiling.release test12\mod.cpp
[ 56%]: compiling.release test11\mod.cpp
[ 59%]: compiling.release test10\mod.cpp
[ 60%]: compiling.release test14\mod.cpp
[ 63%]: compiling.release test16\mod.cpp
[ 65%]: compiling.release test15\mod.cpp
[ 68%]: compiling.release test7\mod.cpp
[ 70%]: compiling.release test17\mod.cpp
[ 74%]: compiling.release test8\mod.cpp
[ 75%]: compiling.release test9\mod.cpp
[ 76%]: archiving.release test13.lib
[ 78%]: archiving.release test16.lib
[ 79%]: archiving.release test10.lib
[ 80%]: archiving.release test12.lib
[ 81%]: archiving.release test14.lib
[ 82%]: archiving.release test11.lib
[ 84%]: archiving.release test15.lib
[ 85%]: archiving.release test7.lib
[ 91%]: archiving.release test17.lib
[ 98%]: archiving.release test8.lib
[100%]: build ok, spent 24.75s
warning: std and std.compat modules not found! maybe try to add --sdk=<PATH/TO/LLVM> or install libc++

@Issues-translate-bot
Copy link

Bot detected the issue body's language is not English, translate it automatically.


Tried a few times, still normal.

PS C:\Users\wangrunqing\Downloads\test\test> xmake -r -j28
[ 0%]: <test10> generating.module.deps test10\mod.cpp
[ 0%]: <test10> generating.module.deps mod\zmod.std.cppm
[ 0%]: <test1> generating.module.deps test1\mod.cpp
[ 0%]: <test1> generating.module.deps mod\zmod.std.cppm
[ 0%]: <zmod> generating.module.deps mod\zmod.std.cppm
[ 0%]: <test11> generating.module.deps test11\mod.cpp
[ 0%]: <test11> generating.module.deps mod\zmod.std.cppm
[ 0%]: <test12> generating.module.deps test12\mod.cpp
[ 0%]: <test12> generating.module.deps mod\zmod.std.cppm
[ 0%]: <test13> generating.module.deps test13\mod.cpp
[ 0%]: <test13> generating.module.deps mod\zmod.std.cppm
[ 0%]: <test14> generating.module.deps test14\mod.cpp
[ 0%]: <test14> generating.module.deps mod\zmod.std.cppm
[ 0%]: <test15> generating.module.deps test15\mod.cpp
[ 0%]: <test15> generating.module.deps mod\zmod.std.cppm
[ 0%]: <test16> generating.module.deps test16\mod.cpp
[ 0%]: <test16> generating.module.deps mod\zmod.std.cppm
[ 0%]: <test17> generating.module.deps test17\mod.cpp
[ 0%]: <test17> generating.module.deps mod\zmod.std.cppm
[ 0%]: <test7> generating.module.deps test7\mod.cpp
[ 0%]: <test7> generating.module.deps mod\zmod.std.cppm
[ 0%]: <test8> generating.module.deps test8\mod.cpp
[ 0%]: <test8> generating.module.deps test9\mod.cpp
[ 0%]: <test8> generating.module.deps mod\zmod.std.cppm
[ 7%]: <test1> compiling.module.release zmod.std
[ 9%]: compiling.release test1\mod.cpp
[ 10%]: archiving.release test1.lib
[ 37%]: <test10> compiling.module.release zmod.std
[ 39%]: <test11> compiling.module.release zmod.std
[ 40%]: <test12> compiling.module.release zmod.std
[ 41%]: <test13> compiling.module.release zmod.std
[ 42%]: <test14> compiling.module.release zmod.std
[ 43%]: <test15> compiling.module.release zmod.std
[ 45%]: <test16> compiling.module.release zmod.std
[ 46%]: <test17> compiling.module.release zmod.std
[ 47%]: <test7> compiling.module.release zmod.std
[ 48%]: <test8> compiling.module.release zmod.std
[ 51%]: compiling.release test10\mod.cpp
[ 53%]: compiling.release test12\mod.cpp
[ 57%]: compiling.release test11\mod.cpp
[ 58%]: compiling.release test13\mod.cpp
[ 63%]: compiling.release test14\mod.cpp
[ 64%]: compiling.release test15\mod.cpp
[ 65%]: compiling.release test16\mod.cpp
[ 71%]: compiling.release test7\mod.cpp
[ 73%]: compiling.release test8\mod.cpp
[ 74%]: compiling.release test9\mod.cpp
[ 75%]: compiling.release test17\mod.cpp
[ 76%]: archiving.release test12.lib
[ 78%]: archiving.release test10.lib
[ 79%]: archiving.release test13.lib
[ 80%]: archiving.release test11.lib
[ 82%]: archiving.release test14.lib
[ 85%]: archiving.release test15.lib
[ 87%]: archiving.release test7.lib
[ 89%]: archiving.release test16.lib
[ 96%]: archiving.release test8.lib
[ 98%]: archiving.release test17.lib
[100%]: build ok, spent 25.281s
warning: std and std.compat modules not found! maybe try to add --sdk=<PATH/TO/LLVM> or install libc++
PS C:\Users\wangrunqing\Downloads\test\test> xmake -r -j28
[ 0%]: <test10> generating.module.deps test10\mod.cpp
[ 0%]: <test10> generating.module.deps mod\zmod.std.cppm
[ 0%]: <test1> generating.module.deps test1\mod.cpp
[ 0%]: <test1> generating.module.deps mod\zmod.std.cppm
[ 0%]: <zmod> generating.module.deps mod\zmod.std.cppm
[ 0%]: <test11> generating.module.deps test11\mod.cpp
[ 0%]: <test11> generating.module.deps mod\zmod.std.cppm
[ 0%]: <test12> generating.module.deps test12\mod.cpp
[ 0%]: <test12> generating.module.deps mod\zmod.std.cppm
[ 0%]: <test13> generating.module.deps test13\mod.cpp
[ 0%]: <test13> generating.module.deps mod\zmod.std.cppm
[ 0%]: <test14> generating.module.deps test14\mod.cpp
[ 0%]: <test14> generating.module.deps mod\zmod.std.cppm
[ 0%]: <test15> generating.module.deps test15\mod.cpp
[ 0%]: <test15> generating.module.deps mod\zmod.std.cppm
[ 0%]: <test16> generating.module.deps test16\mod.cpp
[ 0%]: <test16> generating.module.deps mod\zmod.std.cppm
[ 0%]: <test17> generating.module.deps test17\mod.cpp
[ 0%]: <test17> generating.module.deps mod\zmod.std.cppm
[ 0%]: <test7> generating.module.deps test7\mod.cpp
[ 0%]: <test7> generating.module.deps mod\zmod.std.cppm
[ 0%]: <test8> generating.module.deps test8\mod.cpp
[ 0%]: <test8> generating.module.deps test9\mod.cpp
[ 0%]: <test8> generating.module.deps mod\zmod.std.cppm
[ 7%]: <test1> compiling.module.release zmod.std
[ 9%]: compiling.release test1\mod.cpp
[ 10%]: archiving.release test1.lib
[ 37%]: <test10> compiling.module.release zmod.std
[ 39%]: <test11> compiling.module.release zmod.std
[ 40%]: <test12> compiling.module.release zmod.std
[ 41%]: <test13> compiling.module.release zmod.std
[ 42%]: <test14> compiling.module.release zmod.std
[ 43%]: <test15> compiling.module.release zmod.std
[ 45%]: <test16> compiling.module.release zmod.std
[ 46%]: <test17> compiling.module.release zmod.std
[ 47%]: <test7> compiling.module.release zmod.std
[ 48%]: <test8> compiling.module.release zmod.std
[ 51%]: compiling.release test10\mod.cpp
[ 54%]: compiling.release test11\mod.cpp
[ 56%]: compiling.release test13\mod.cpp
[ 59%]: compiling.release test12\mod.cpp
[ 60%]: compiling.release test15\mod.cpp
[ 64%]: compiling.release test16\mod.cpp
[ 65%]: compiling.release test14\mod.cpp
[ 71%]: compiling.release test17\mod.cpp
[ 73%]: compiling.release test7\mod.cpp
[ 74%]: compiling.release test8\mod.cpp
[ 75%]: compiling.release test9\mod.cpp
[ 76%]: archiving.release test13.lib
[ 78%]: archiving.release test10.lib
[ 79%]: archiving.release test11.lib
[ 80%]: archiving.release test12.lib
[ 81%]: archiving.release test16.lib
[ 82%]: archiving.release test15.lib
[ 85%]: archiving.release test14.lib
[ 87%]: archiving.release test17.lib
[ 96%]: archiving.release test7.lib
[ 98%]: archiving.release test8.lib
[100%]: build ok, spent 25.093s
warning: std and std.compat modules not found! maybe try to add --sdk=<PATH/TO/LLVM> or install libc++
PS C:\Users\wangrunqing\Downloads\test\test> xmake -r -j28
[ 0%]: <test10> generating.module.deps test10\mod.cpp
[ 0%]: <test10> generating.module.deps mod\zmod.std.cppm
[ 0%]: <test1> generating.module.deps test1\mod.cpp
[ 0%]: <test1> generating.module.deps mod\zmod.std.cppm
[ 0%]: <zmod> generating.module.deps mod\zmod.std.cppm
[ 0%]: <test11> generating.module.deps test11\mod.cpp
[ 0%]: <test11> generating.module.deps mod\zmod.std.cppm
[ 0%]: <test12> generating.module.deps test12\mod.cpp
[ 0%]: <test12> generating.module.deps mod\zmod.std.cppm
[ 0%]: <test13> generating.module.deps test13\mod.cpp
[ 0%]: <test13> generating.module.deps mod\zmod.std.cppm
[ 0%]: <test14> generating.module.deps test14\mod.cpp
[ 0%]: <test14> generating.module.deps mod\zmod.std.cppm
[ 0%]: <test15> generating.module.deps test15\mod.cpp
[ 0%]: <test15> generating.module.deps mod\zmod.std.cppm
[ 0%]: <test16> generating.module.deps test16\mod.cpp
[ 0%]: <test16> generating.module.deps mod\zmod.std.cppm
[ 0%]: <test17> generating.module.deps test17\mod.cpp
[ 0%]: <test17> generating.module.deps mod\zmod.std.cppm
[ 0%]: <test7> generating.module.deps test7\mod.cpp
[ 0%]: <test7> generating.module.deps mod\zmod.std.cppm
[ 0%]: <test8> generating.module.deps test8\mod.cpp
[ 0%]: <test8> generating.module.deps test9\mod.cpp
[ 0%]: <test8> generating.module.deps mod\zmod.std.cppm
[ 7%]: <test1> compiling.module.release zmod.std
[ 9%]: compiling.release test1\mod.cpp
[ 10%]: archiving.release test1.lib
[ 37%]: <test10> compiling.module.release zmod.std
[ 39%]: <test11> compiling.module.release zmod.std
[ 40%]: <test12> compiling.module.release zmod.std
[ 41%]: <test13> compiling.module.release zmod.std
[ 42%]: <test14> compiling.module.release zmod.std
[ 43%]: <test15> compiling.module.release zmod.std
[ 45%]: <test16> compiling.module.release zmod.std
[ 46%]: <test17> compiling.module.release zmod.std
[ 47%]: <test7> compiling.module.release zmod.std
[ 48%]: <test8> compiling.module.release zmod.std
[ 51%]: compiling.release test13\mod.cpp
[ 54%]: compiling.release test12\mod.cpp
[ 56%]: compiling.release test11\mod.cpp
[ 59%]: compiling.release test10\mod.cpp
[ 60%]: compiling.release test14\mod.cpp
[ 63%]: compiling.release test16\mod.cpp
[ 65%]: compiling.release test15\mod.cpp
[ 68%]: compiling.release test7\mod.cpp
[ 70%]: compiling.release test17\mod.cpp
[ 74%]: compiling.release test8\mod.cpp
[ 75%]: compiling.release test9\mod.cpp
[ 76%]: archiving.release test13.lib
[ 78%]: archiving.release test16.lib
[ 79%]: archiving.release test10.lib
[ 80%]: archiving.release test12.lib
[ 81%]: archiving.release test14.lib
[ 82%]: archiving.release test11.lib
[ 84%]: archiving.release test15.lib
[ 85%]: archiving.release test7.lib
[ 91%]: archiving.release test17.lib
[ 98%]: archiving.release test8.lib
[100%]: build ok, spent 24.75s
warning: std and std.compat modules not found! maybe try to add --sdk=<PATH/TO/LLVM> or install libc++

@vrecluse
Copy link
Author

vrecluse commented Nov 28, 2024

我机器上倒是很好复现,怎么调试有切入点么,比较有嫌疑的lua模块是哪个?

liaoxinwei@jszj-liao MINGW64 /f/dev/workspace/test
$ xmake -r -v -j28
[  0%]: <test10> generating.module.deps test10\mod.cpp
clang-scan-deps --format=p1689 -- F:\llvm19\bin\clang -x c++ -c test10\mod.cpp -o build\.objs\test10\mingw\x86_64\release\test10\mod.cpp.obj -Qunused-arguments -m64 -std=c++23
[  0%]: <test10> generating.module.deps mod\zmod.std.cppm
clang-scan-deps --format=p1689 -- F:\llvm19\bin\clang -x c++ -c mod\zmod.std.cppm -o build\.objs\test10\mingw\x86_64\release\mod\zmod.std.cppm.obj -Qunused-arguments -m64 -std=c++23
[  0%]: <test1> generating.module.deps test1\mod.cpp
clang-scan-deps --format=p1689 -- F:\llvm19\bin\clang -x c++ -c test1\mod.cpp -o build\.objs\test1\mingw\x86_64\release\test1\mod.cpp.obj -Qunused-arguments -m64 -std=c++23
[  0%]: <test1> generating.module.deps mod\zmod.std.cppm
clang-scan-deps --format=p1689 -- F:\llvm19\bin\clang -x c++ -c mod\zmod.std.cppm -o build\.objs\test1\mingw\x86_64\release\mod\zmod.std.cppm.obj -Qunused-arguments -m64 -std=c++23
[  0%]: <zmod> generating.module.deps mod\zmod.std.cppm
clang-scan-deps --format=p1689 -- F:\llvm19\bin\clang -x c++ -c mod\zmod.std.cppm -o build\.objs\zmod\mingw\x86_64\release\mod\zmod.std.cppm.obj -Qunused-arguments -m64 -std=c++23
[  0%]: <test11> generating.module.deps test11\mod.cpp
clang-scan-deps --format=p1689 -- F:\llvm19\bin\clang -x c++ -c test11\mod.cpp -o build\.objs\test11\mingw\x86_64\release\test11\mod.cpp.obj -Qunused-arguments -m64 -std=c++23
[  0%]: <test11> generating.module.deps mod\zmod.std.cppm
clang-scan-deps --format=p1689 -- F:\llvm19\bin\clang -x c++ -c mod\zmod.std.cppm -o build\.objs\test11\mingw\x86_64\release\mod\zmod.std.cppm.obj -Qunused-arguments -m64 -std=c++23
[  0%]: <test12> generating.module.deps test12\mod.cpp
clang-scan-deps --format=p1689 -- F:\llvm19\bin\clang -x c++ -c test12\mod.cpp -o build\.objs\test12\mingw\x86_64\release\test12\mod.cpp.obj -Qunused-arguments -m64 -std=c++23
[  0%]: <test12> generating.module.deps mod\zmod.std.cppm
clang-scan-deps --format=p1689 -- F:\llvm19\bin\clang -x c++ -c mod\zmod.std.cppm -o build\.objs\test12\mingw\x86_64\release\mod\zmod.std.cppm.obj -Qunused-arguments -m64 -std=c++23
[  0%]: <test13> generating.module.deps test13\mod.cpp
clang-scan-deps --format=p1689 -- F:\llvm19\bin\clang -x c++ -c test13\mod.cpp -o build\.objs\test13\mingw\x86_64\release\test13\mod.cpp.obj -Qunused-arguments -m64 -std=c++23
[  0%]: <test13> generating.module.deps mod\zmod.std.cppm
clang-scan-deps --format=p1689 -- F:\llvm19\bin\clang -x c++ -c mod\zmod.std.cppm -o build\.objs\test13\mingw\x86_64\release\mod\zmod.std.cppm.obj -Qunused-arguments -m64 -std=c++23
[  0%]: <test14> generating.module.deps test14\mod.cpp
clang-scan-deps --format=p1689 -- F:\llvm19\bin\clang -x c++ -c test14\mod.cpp -o build\.objs\test14\mingw\x86_64\release\test14\mod.cpp.obj -Qunused-arguments -m64 -std=c++23
[  0%]: <test14> generating.module.deps mod\zmod.std.cppm
clang-scan-deps --format=p1689 -- F:\llvm19\bin\clang -x c++ -c mod\zmod.std.cppm -o build\.objs\test14\mingw\x86_64\release\mod\zmod.std.cppm.obj -Qunused-arguments -m64 -std=c++23
[  0%]: <test15> generating.module.deps test15\mod.cpp
clang-scan-deps --format=p1689 -- F:\llvm19\bin\clang -x c++ -c test15\mod.cpp -o build\.objs\test15\mingw\x86_64\release\test15\mod.cpp.obj -Qunused-arguments -m64 -std=c++23
[  0%]: <test15> generating.module.deps mod\zmod.std.cppm
clang-scan-deps --format=p1689 -- F:\llvm19\bin\clang -x c++ -c mod\zmod.std.cppm -o build\.objs\test15\mingw\x86_64\release\mod\zmod.std.cppm.obj -Qunused-arguments -m64 -std=c++23
[  0%]: <test16> generating.module.deps test16\mod.cpp
clang-scan-deps --format=p1689 -- F:\llvm19\bin\clang -x c++ -c test16\mod.cpp -o build\.objs\test16\mingw\x86_64\release\test16\mod.cpp.obj -Qunused-arguments -m64 -std=c++23
[  0%]: <test16> generating.module.deps mod\zmod.std.cppm
clang-scan-deps --format=p1689 -- F:\llvm19\bin\clang -x c++ -c mod\zmod.std.cppm -o build\.objs\test16\mingw\x86_64\release\mod\zmod.std.cppm.obj -Qunused-arguments -m64 -std=c++23
[  0%]: <test17> generating.module.deps test17\mod.cpp
clang-scan-deps --format=p1689 -- F:\llvm19\bin\clang -x c++ -c test17\mod.cpp -o build\.objs\test17\mingw\x86_64\release\test17\mod.cpp.obj -Qunused-arguments -m64 -std=c++23
[  0%]: <test17> generating.module.deps mod\zmod.std.cppm
clang-scan-deps --format=p1689 -- F:\llvm19\bin\clang -x c++ -c mod\zmod.std.cppm -o build\.objs\test17\mingw\x86_64\release\mod\zmod.std.cppm.obj -Qunused-arguments -m64 -std=c++23
[  0%]: <test7> generating.module.deps test7\mod.cpp
clang-scan-deps --format=p1689 -- F:\llvm19\bin\clang -x c++ -c test7\mod.cpp -o build\.objs\test7\mingw\x86_64\release\test7\mod.cpp.obj -Qunused-arguments -m64 -std=c++23
[  0%]: <test7> generating.module.deps mod\zmod.std.cppm
clang-scan-deps --format=p1689 -- F:\llvm19\bin\clang -x c++ -c mod\zmod.std.cppm -o build\.objs\test7\mingw\x86_64\release\mod\zmod.std.cppm.obj -Qunused-arguments -m64 -std=c++23
[  0%]: <test8> generating.module.deps test8\mod.cpp
clang-scan-deps --format=p1689 -- F:\llvm19\bin\clang -x c++ -c test8\mod.cpp -o build\.objs\test8\mingw\x86_64\release\test8\mod.cpp.obj -Qunused-arguments -m64 -std=c++23
[  0%]: <test8> generating.module.deps test9\mod.cpp
clang-scan-deps --format=p1689 -- F:\llvm19\bin\clang -x c++ -c test9\mod.cpp -o build\.objs\test8\mingw\x86_64\release\test9\mod.cpp.obj -Qunused-arguments -m64 -std=c++23
[  0%]: <test8> generating.module.deps mod\zmod.std.cppm
clang-scan-deps --format=p1689 -- F:\llvm19\bin\clang -x c++ -c mod\zmod.std.cppm -o build\.objs\test8\mingw\x86_64\release\mod\zmod.std.cppm.obj -Qunused-arguments -m64 -std=c++23
[  7%]: <test1> compiling.module.release zmod.std
clang -c -Qunused-arguments -m64 -std=c++23 -x c++-module -fmodule-output=build\.gens\test1\mingw\x86_64\release\rules\bmi\cache\modules\3bbb4f22\zmod.std.pcm -o build\.objs\test1\mingw\x86_64\release\mod\zmod.std.cppm.obj mod\zmod.std.cppm
[  9%]: compiling.release test1\mod.cpp
clang -c -Qunused-arguments -m64 -std=c++23 -fmodule-file=zmod.std=build\.gens\test1\mingw\x86_64\release\rules\bmi\cache\modules\3bbb4f22\zmod.std.pcm -o build\.objs\test1\mingw\x86_64\release\test1\mod.cpp.obj test1\mod.cpp
[ 10%]: archiving.release libtest1.a
llvm-ar cr build\mingw\x86_64\release\libtest1.a build\.objs\test1\mingw\x86_64\release\test1\mod.cpp.obj build\.objs\test1\mingw\x86_64\release\mod\zmod.std.cppm.obj
[ 37%]: <test10> compiling.module.release zmod.std
clang -c -Qunused-arguments -m64 -std=c++23 -x c++-module -fmodule-output=build\.gens\test1\mingw\x86_64\release\rules\bmi\cache\modules\3bbb4f22\zmod.std.pcm -o build\.objs\test10\mingw\x86_64\release\mod\zmod.std.cppm.obj mod\zmod.std.cppm
[ 39%]: <test11> compiling.module.release zmod.std
clang -c -Qunused-arguments -m64 -std=c++23 -x c++-module -fmodule-output=build\.gens\test1\mingw\x86_64\release\rules\bmi\cache\modules\3bbb4f22\zmod.std.pcm -o build\.objs\test11\mingw\x86_64\release\mod\zmod.std.cppm.obj mod\zmod.std.cppm
[ 40%]: <test12> compiling.module.release zmod.std
clang -c -Qunused-arguments -m64 -std=c++23 -x c++-module -fmodule-output=build\.gens\test1\mingw\x86_64\release\rules\bmi\cache\modules\3bbb4f22\zmod.std.pcm -o build\.objs\test12\mingw\x86_64\release\mod\zmod.std.cppm.obj mod\zmod.std.cppm
[ 41%]: <test13> compiling.module.release zmod.std
clang -c -Qunused-arguments -m64 -std=c++23 -x c++-module -fmodule-output=build\.gens\test1\mingw\x86_64\release\rules\bmi\cache\modules\3bbb4f22\zmod.std.pcm -o build\.objs\test13\mingw\x86_64\release\mod\zmod.std.cppm.obj mod\zmod.std.cppm
[ 42%]: <test14> compiling.module.release zmod.std
clang -c -Qunused-arguments -m64 -std=c++23 -x c++-module -fmodule-output=build\.gens\test1\mingw\x86_64\release\rules\bmi\cache\modules\3bbb4f22\zmod.std.pcm -o build\.objs\test14\mingw\x86_64\release\mod\zmod.std.cppm.obj mod\zmod.std.cppm
[ 43%]: <test15> compiling.module.release zmod.std
clang -c -Qunused-arguments -m64 -std=c++23 -x c++-module -fmodule-output=build\.gens\test1\mingw\x86_64\release\rules\bmi\cache\modules\3bbb4f22\zmod.std.pcm -o build\.objs\test15\mingw\x86_64\release\mod\zmod.std.cppm.obj mod\zmod.std.cppm
[ 45%]: <test16> compiling.module.release zmod.std
clang -c -Qunused-arguments -m64 -std=c++23 -x c++-module -fmodule-output=build\.gens\test1\mingw\x86_64\release\rules\bmi\cache\modules\3bbb4f22\zmod.std.pcm -o build\.objs\test16\mingw\x86_64\release\mod\zmod.std.cppm.obj mod\zmod.std.cppm
[ 46%]: <test17> compiling.module.release zmod.std
clang -c -Qunused-arguments -m64 -std=c++23 -x c++-module -fmodule-output=build\.gens\test1\mingw\x86_64\release\rules\bmi\cache\modules\3bbb4f22\zmod.std.pcm -o build\.objs\test17\mingw\x86_64\release\mod\zmod.std.cppm.obj mod\zmod.std.cppm
[ 47%]: <test7> compiling.module.release zmod.std
clang -c -Qunused-arguments -m64 -std=c++23 -x c++-module -fmodule-output=build\.gens\test1\mingw\x86_64\release\rules\bmi\cache\modules\3bbb4f22\zmod.std.pcm -o build\.objs\test7\mingw\x86_64\release\mod\zmod.std.cppm.obj mod\zmod.std.cppm
[ 48%]: <test8> compiling.module.release zmod.std
clang -c -Qunused-arguments -m64 -std=c++23 -x c++-module -fmodule-output=build\.gens\test1\mingw\x86_64\release\rules\bmi\cache\modules\3bbb4f22\zmod.std.pcm -o build\.objs\test8\mingw\x86_64\release\mod\zmod.std.cppm.obj mod\zmod.std.cppm
[ 51%]: compiling.release test10\mod.cpp
clang -c -Qunused-arguments -m64 -std=c++23 -fmodule-file=zmod.std=build\.gens\test1\mingw\x86_64\release\rules\bmi\cache\modules\3bbb4f22\zmod.std.pcm -o build\.objs\test10\mingw\x86_64\release\test10\mod.cpp.obj test10\mod.cpp
error: error: unable to open output file 'build\.gens\test1\mingw\x86_64\release\rules\bmi\cache\modules\3bbb4f22\zmod.std.pcm': '<C7><EB><C7><F3><B5>IJ<D9><D7><F7><CE><U+07B7><A8><D4><DA>ʹ<D3><C3><D3>û<A7>ӳ<C9><E4><C7><F8><D3><F2><B4><U+BFAB5><C4><CE>ļ<FE><C9><CF>ִ<D0>С<A3>'
1 error generated.

@Issues-translate-bot
Copy link

Bot detected the issue body's language is not English, translate it automatically.


试了凤次,or normal的么。

PS C:\Users\wangrunqing\Downloads\test\test> xmake -r -j28
[ 0%]: <test10> generating.module.deps test10\mod.cpp
[ 0%]: <test10> generating.module.deps mod\zmod.std.cppm
[ 0%]: <test1> generating.module.deps test1\mod.cpp
[ 0%]: <test1> generating.module.deps mod\zmod.std.cppm
[ 0%]: <zmod> generating.module.deps mod\zmod.std.cppm
[ 0%]: <test11> generating.module.deps test11\mod.cpp
[ 0%]: <test11> generating.module.deps mod\zmod.std.cppm
[ 0%]: <test12> generating.module.deps test12\mod.cpp
[ 0%]: <test12> generating.module.deps mod\zmod.std.cppm
[ 0%]: <test13> generating.module.deps test13\mod.cpp
[ 0%]: <test13> generating.module.deps mod\zmod.std.cppm
[ 0%]: <test14> generating.module.deps test14\mod.cpp
[ 0%]: <test14> generating.module.deps mod\zmod.std.cppm
[ 0%]: <test15> generating.module.deps test15\mod.cpp
[ 0%]: <test15> generating.module.deps mod\zmod.std.cppm
[ 0%]: <test16> generating.module.deps test16\mod.cpp
[ 0%]: <test16> generating.module.deps mod\zmod.std.cppm
[ 0%]: <test17> generating.module.deps test17\mod.cpp
[ 0%]: <test17> generating.module.deps mod\zmod.std.cppm
[ 0%]: <test7> generating.module.deps test7\mod.cpp
[ 0%]: <test7> generating.module.deps mod\zmod.std.cppm
[ 0%]: <test8> generating.module.deps test8\mod.cpp
[ 0%]: <test8> generating.module.deps test9\mod.cpp
[ 0%]: <test8> generating.module.deps mod\zmod.std.cppm
[ 7%]: <test1> compiling.module.release zmod.std
[ 9%]: compiling.release test1\mod.cpp
[ 10%]: archiving.release test1.lib
[ 37%]: <test10> compiling.module.release zmod.std
[ 39%]: <test11> compiling.module.release zmod.std
[ 40%]: <test12> compiling.module.release zmod.std
[ 41%]: <test13> compiling.module.release zmod.std
[ 42%]: <test14> compiling.module.release zmod.std
[ 43%]: <test15> compiling.module.release zmod.std
[ 45%]: <test16> compiling.module.release zmod.std
[ 46%]: <test17> compiling.module.release zmod.std
[ 47%]: <test7> compiling.module.release zmod.std
[ 48%]: <test8> compiling.module.release zmod.std
[ 51%]: compiling.release test10\mod.cpp
[ 53%]: compiling.release test12\mod.cpp
[ 57%]: compiling.release test11\mod.cpp
[ 58%]: compiling.release test13\mod.cpp
[ 63%]: compiling.release test14\mod.cpp
[ 64%]: compiling.release test15\mod.cpp
[ 65%]: compiling.release test16\mod.cpp
[ 71%]: compiling.release test7\mod.cpp
[ 73%]: compiling.release test8\mod.cpp
[ 74%]: compiling.release test9\mod.cpp
[ 75%]: compiling.release test17\mod.cpp
[ 76%]: archiving.release test12.lib
[ 78%]: archiving.release test10.lib
[ 79%]: archiving.release test13.lib
[ 80%]: archiving.release test11.lib
[ 82%]: archiving.release test14.lib
[ 85%]: archiving.release test15.lib
[ 87%]: archiving.release test7.lib
[ 89%]: archiving.release test16.lib
[ 96%]: archiving.release test8.lib
[ 98%]: archiving.release test17.lib
[100%]: build ok, spent 25.281s
warning: std and std.compat modules not found! maybe try to add --sdk=<PATH/TO/LLVM> or install libc++
PS C:\Users\wangrunqing\Downloads\test\test> xmake -r -j28
[ 0%]: <test10> generating.module.deps test10\mod.cpp
[ 0%]: <test10> generating.module.deps mod\zmod.std.cppm
[ 0%]: <test1> generating.module.deps test1\mod.cpp
[ 0%]: <test1> generating.module.deps mod\zmod.std.cppm
[ 0%]: <zmod> generating.module.deps mod\zmod.std.cppm
[ 0%]: <test11> generating.module.deps test11\mod.cpp
[ 0%]: <test11> generating.module.deps mod\zmod.std.cppm
[ 0%]: <test12> generating.module.deps test12\mod.cpp
[ 0%]: <test12> generating.module.deps mod\zmod.std.cppm
[ 0%]: <test13> generating.module.deps test13\mod.cpp
[ 0%]: <test13> generating.module.deps mod\zmod.std.cppm
[ 0%]: <test14> generating.module.deps test14\mod.cpp
[ 0%]: <test14> generating.module.deps mod\zmod.std.cppm
[ 0%]: <test15> generating.module.deps test15\mod.cpp
[ 0%]: <test15> generating.module.deps mod\zmod.std.cppm
[ 0%]: <test16> generating.module.deps test16\mod.cpp
[ 0%]: <test16> generating.module.deps mod\zmod.std.cppm
[ 0%]: <test17> generating.module.deps test17\mod.cpp
[ 0%]: <test17> generating.module.deps mod\zmod.std.cppm
[ 0%]: <test7> generating.module.deps test7\mod.cpp
[ 0%]: <test7> generating.module.deps mod\zmod.std.cppm
[ 0%]: <test8> generating.module.deps test8\mod.cpp
[ 0%]: <test8> generating.module.deps test9\mod.cpp
[ 0%]: <test8> generating.module.deps mod\zmod.std.cppm
[ 7%]: <test1> compiling.module.release zmod.std
[ 9%]: compiling.release test1\mod.cpp
[ 10%]: archiving.release test1.lib
[ 37%]: <test10> compiling.module.release zmod.std
[ 39%]: <test11> compiling.module.release zmod.std
[ 40%]: <test12> compiling.module.release zmod.std
[ 41%]: <test13> compiling.module.release zmod.std
[ 42%]: <test14> compiling.module.release zmod.std
[ 43%]: <test15> compiling.module.release zmod.std
[ 45%]: <test16> compiling.module.release zmod.std
[ 46%]: <test17> compiling.module.release zmod.std
[ 47%]: <test7> compiling.module.release zmod.std
[ 48%]: <test8> compiling.module.release zmod.std
[ 51%]: compiling.release test10\mod.cpp
[ 54%]: compiling.release test11\mod.cpp
[ 56%]: compiling.release test13\mod.cpp
[ 59%]: compiling.release test12\mod.cpp
[ 60%]: compiling.release test15\mod.cpp
[ 64%]: compiling.release test16\mod.cpp
[ 65%]: compiling.release test14\mod.cpp
[ 71%]: compiling.release test17\mod.cpp
[ 73%]: compiling.release test7\mod.cpp
[ 74%]: compiling.release test8\mod.cpp
[ 75%]: compiling.release test9\mod.cpp
[ 76%]: archiving.release test13.lib
[ 78%]: archiving.release test10.lib
[ 79%]: archiving.release test11.lib
[ 80%]: archiving.release test12.lib
[ 81%]: archiving.release test16.lib
[ 82%]: archiving.release test15.lib
[ 85%]: archiving.release test14.lib
[ 87%]: archiving.release test17.lib
[ 96%]: archiving.release test7.lib
[ 98%]: archiving.release test8.lib
[100%]: build ok, spent 25.093s
warning: std and std.compat modules not found! maybe try to add --sdk=<PATH/TO/LLVM> or install libc++
PS C:\Users\wangrunqing\Downloads\test\test> xmake -r -j28
[ 0%]: <test10> generating.module.deps test10\mod.cpp
[ 0%]: <test10> generating.module.deps mod\zmod.std.cppm
[ 0%]: <test1> generating.module.deps test1\mod.cpp
[ 0%]: <test1> generating.module.deps mod\zmod.std.cppm
[ 0%]: <zmod> generating.module.deps mod\zmod.std.cppm
[ 0%]: <test11> generating.module.deps test11\mod.cpp
[ 0%]: <test11> generating.module.deps mod\zmod.std.cppm
[ 0%]: <test12> generating.module.deps test12\mod.cpp
[ 0%]: <test12> generating.module.deps mod\zmod.std.cppm
[ 0%]: <test13> generating.module.deps test13\mod.cpp
[ 0%]: <test13> generating.module.deps mod\zmod.std.cppm
[ 0%]: <test14> generating.module.deps test14\mod.cpp
[ 0%]: <test14> generating.module.deps mod\zmod.std.cppm
[ 0%]: <test15> generating.module.deps test15\mod.cpp
[ 0%]: <test15> generating.module.deps mod\zmod.std.cppm
[ 0%]: <test16> generating.module.deps test16\mod.cpp
[ 0%]: <test16> generating.module.deps mod\zmod.std.cppm
[ 0%]: <test17> generating.module.deps test17\mod.cpp
[ 0%]: <test17> generating.module.deps mod\zmod.std.cppm
[ 0%]: <test7> generating.module.deps test7\mod.cpp
[ 0%]: <test7> generating.module.deps mod\zmod.std.cppm
[ 0%]: <test8> generating.module.deps test8\mod.cpp
[ 0%]: <test8> generating.module.deps test9\mod.cpp
[ 0%]: <test8> generating.module.deps mod\zmod.std.cppm
[ 7%]: <test1> compiling.module.release zmod.std
[ 9%]: compiling.release test1\mod.cpp
[ 10%]: archiving.release test1.lib
[ 37%]: <test10> compiling.module.release zmod.std
[ 39%]: <test11> compiling.module.release zmod.std
[ 40%]: <test12> compiling.module.release zmod.std
[ 41%]: <test13> compiling.module.release zmod.std
[ 42%]: <test14> compiling.module.release zmod.std
[ 43%]: <test15> compiling.module.release zmod.std
[ 45%]: <test16> compiling.module.release zmod.std
[ 46%]: <test17> compiling.module.release zmod.std
[ 47%]: <test7> compiling.module.release zmod.std
[ 48%]: <test8> compiling.module.release zmod.std
[ 51%]: compiling.release test13\mod.cpp
[ 54%]: compiling.release test12\mod.cpp
[ 56%]: compiling.release test11\mod.cpp
[ 59%]: compiling.release test10\mod.cpp
[ 60%]: compiling.release test14\mod.cpp
[ 63%]: compiling.release test16\mod.cpp
[ 65%]: compiling.release test15\mod.cpp
[ 68%]: compiling.release test7\mod.cpp
[ 70%]: compiling.release test17\mod.cpp
[ 74%]: compiling.release test8\mod.cpp
[ 75%]: compiling.release test9\mod.cpp
[ 76%]: archiving.release test13.lib
[ 78%]: archiving.release test16.lib
[ 79%]: archiving.release test10.lib
[ 80%]: archiving.release test12.lib
[ 81%]: archiving.release test14.lib
[ 82%]: archiving.release test11.lib
[ 84%]: archiving.release test15.lib
[ 85%]: archiving.release test7.lib
[ 91%]: archiving.release test17.lib
[ 98%]: archiving.release test8.lib
[100%]: build ok, spent 24.75s
warning: std and std.compat modules not found! maybe try to add --sdk=<PATH/TO/LLVM> or install libc++

我最好上倒是好好复月,是正解有切入点么,公司有嫌疑的lua module是which one?

liaoxinwei@jszj-liao MINGW64 /f/dev/workspace/test
$ xmake -r -v -j28
[ 0%]: <test10> generating.module.deps test10\mod.cpp
clang-scan-deps --format=p1689 -- F:\llvm19\bin\clang -x c++ -c test10\mod.cpp -o build\.objs\test10\mingw\x86_64\release\test10\mod.cpp .obj -Qunused-argument -m64 -std=c++23
[ 0%]: <test10> generating.module.deps mod\zmod.std.cppm
clang-scan-deps --format=p1689 -- F:\llvm19\bin\clang -x c++ -c mod\zmod.std.cppm -o build\.objs\test10\mingw\x86_64\release\mod\zmod .std.cppm.obj -Qunused-argument -m64 -std=c++23
[ 0%]: <test1> generating.module.deps test1\mod.cpp
clang-scan-deps --format=p1689 -- F:\llvm19\bin\clang -x c++ -c test1\mod.cpp -o build\.objs\test1\mingw\x86_64\release\test1\mod.cpp .obj -Qunused-argument -m64 -std=c++23
[ 0%]: <test1> generating.module.deps mod\zmod.std.cppm
clang-scan-deps --format=p1689 -- F:\llvm19\bin\clang -x c++ -c mod\zmod.std.cppm -o build\.objs\test1\mingw\x86_64\release\mod\zmod .std.cppm.obj -Qunused-argument -m64 -std=c++23
[ 0%]: <zmod> generating.module.deps mod\zmod.std.cppm
clang-scan-deps --format=p1689 -- F:\llvm19\bin\clang -x c++ -c mod\zmod.std.cppm -o build\.objs\zmod\mingw\x86_64\release\mod\zmod .std.cppm.obj -Qunused-argument -m64 -std=c++23
[ 0%]: <test11> generating.module.deps test11\mod.cpp
clang-scan-deps --format=p1689 -- F:\llvm19\bin\clang -x c++ -c test11\mod.cpp -o build\.objs\test11\mingw\x86_64\release\test11\mod.cpp .obj -Qunused-argument -m64 -std=c++23
[ 0%]: <test11> generating.module.deps mod\zmod.std.cppm
clang-scan-deps --format=p1689 -- F:\llvm19\bin\clang -x c++ -c mod\zmod.std.cppm -o build\.objs\test11\mingw\x86_64\release\mod\zmod .std.cppm.obj -Qunused-argument -m64 -std=c++23
[ 0%]: <test12> generating.module.deps test12\mod.cpp
clang-scan-deps --format=p1689 -- F:\llvm19\bin\clang -x c++ -c test12\mod.cpp -o build\.objs\test12\mingw\x86_64\release\test12\mod.cpp .obj -Qunused-argument -m64 -std=c++23
[ 0%]: <test12> generating.module.deps mod\zmod.std.cppm
clang-scan-deps --format=p1689 -- F:\llvm19\bin\clang -x c++ -c mod\zmod.std.cppm -o build\.objs\test12\mingw\x86_64\release\mod\zmod .std.cppm.obj -Qunused-argument -m64 -std=c++23
[ 0%]: <test13> generating.module.deps test13\mod.cpp
clang-scan-deps --format=p1689 -- F:\llvm19\bin\clang -x c++ -c test13\mod.cpp -o build\.objs\test13\mingw\x86_64\release\test13\mod.cpp .obj -Qunused-argument -m64 -std=c++23
[ 0%]: <test13> generating.module.deps mod\zmod.std.cppm
clang-scan-deps --format=p1689 -- F:\llvm19\bin\clang -x c++ -c mod\zmod.std.cppm -o build\.objs\test13\mingw\x86_64\release\mod\zmod .std.cppm.obj -Qunused-argument -m64 -std=c++23
[ 0%]: <test14> generating.module.deps test14\mod.cpp
clang-scan-deps --format=p1689 -- F:\llvm19\bin\clang -x c++ -c test14\mod.cpp -o build\.objs\test14\mingw\x86_64\release\test14\mod.cpp .obj -Qunused-argument -m64 -std=c++23
[ 0%]: <test14> generating.module.deps mod\zmod.std.cppm
clang-scan-deps --format=p1689 -- F:\llvm19\bin\clang -x c++ -c mod\zmod.std.cppm -o build\.objs\test14\mingw\x86_64\release\mod\zmod .std.cppm.obj -Qunused-argument -m64 -std=c++23
[ 0%]: <test15> generating.module.deps test15\mod.cpp
clang-scan-deps --format=p1689 -- F:\llvm19\bin\clang -x c++ -c test15\mod.cpp -o build\.objs\test15\mingw\x86_64\release\test15\mod.cpp .obj -Qunused-argument -m64 -std=c++23
[ 0%]: <test15> generating.module.deps mod\zmod.std.cppm
clang-scan-deps --format=p1689 -- F:\llvm19\bin\clang -x c++ -c mod\zmod.std.cppm -o build\.objs\test15\mingw\x86_64\release\mod\zmod .std.cppm.obj -Qunused-argument -m64 -std=c++23
[ 0%]: <test16> generating.module.deps test16\mod.cpp
clang-scan-deps --format=p1689 -- F:\llvm19\bin\clang -x c++ -c test16\mod.cpp -o build\.objs\test16\mingw\x86_64\release\test16\mod.cpp .obj -Qunused-argument -m64 -std=c++23
[ 0%]: <test16> generating.module.deps mod\zmod.std.cppm
clang-scan-deps --format=p1689 -- F:\llvm19\bin\clang -x c++ -c mod\zmod.std.cppm -o build\.objs\test16\mingw\x86_64\release\mod\zmod .std.cppm.obj -Qunused-argument -m64 -std=c++23
[ 0%]: <test17> generating.module.deps test17\mod.cpp
clang-scan-deps --format=p1689 -- F:\llvm19\bin\clang -x c++ -c test17\mod.cpp -o build\.objs\test17\mingw\x86_64\release\test17\mod.cpp .obj -Qunused-argument -m64 -std=c++23
[ 0%]: <test17> generating.module.deps mod\zmod.std.cppm
clang-scan-deps --format=p1689 -- F:\llvm19\bin\clang -x c++ -c mod\zmod.std.cppm -o build\.objs\test17\mingw\x86_64\release\mod\zmod .std.cppm.obj -Qunused-argument -m64 -std=c++23
[ 0%]: <test7> generating.module.deps test7\mod.cpp
clang-scan-deps --format=p1689 -- F:\llvm19\bin\clang -x c++ -c test7\mod.cpp -o build\.objs\test7\mingw\x86_64\release\test7\mod.cpp .obj -Qunused-argument -m64 -std=c++23
[ 0%]: <test7> generating.module.deps mod\zmod.std.cppm
clang-scan-deps --format=p1689 -- F:\llvm19\bin\clang -x c++ -c mod\zmod.std.cppm -o build\.objs\test7\mingw\x86_64\release\mod\zmod .std.cppm.obj -Qunused-argument -m64 -std=c++23
[ 0%]: <test8> generating.module.deps test8\mod.cpp
clang-scan-deps --format=p1689 -- F:\llvm19\bin\clang -x c++ -c test8\mod.cpp -o build\.objs\test8\mingw\x86_64\release\test8\mod.cpp .obj -Qunused-argument -m64 -std=c++23
[ 0%]: <test8> generating.module.deps test9\mod.cpp
clang-scan-deps --format=p1689 -- F:\llvm19\bin\clang -x c++ -c test9\mod.cpp -o build\.objs\test8\mingw\x86_64\release\test9\mod.cpp .obj -Qunused-argument -m64 -std=c++23
[ 0%]: <test8> generating.module.deps mod\zmod.std.cppm
clang-scan-deps --format=p1689 -- F:\llvm19\bin\clang -x c++ -c mod\zmod.std.cppm -o build\.objs\test8\mingw\x86_64\release\mod\zmod .std.cppm.obj -Qunused-argument -m64 -std=c++23
[ 7%]: <test1> compiling.module.release zmod.std
clang -c -Qunused-arguments -m64 -std=c++23 -x c++-module -fmodule-output=build\.gens\test1\mingw\x86_64\release\rules\bmi\cache\modules\3bbb4f22\zmod .std.pcm -o build\.objs\test1\mingw\x86_64\release\mod\zmod.std.cppm.obj mod\zmod.std.cppm
[ 9%]: compiling.release test1\mod.cpp
clang -c -Qunused-arguments -m64 -std=c++23 -fmodule-file=zmod.std=build\.gens\test1\mingw\x86_64\release\rules\bmi\cache\modules\3bbb4f22\zmod. std.pcm -o build\.objs\test1\mingw\x86_64\release\test1\mod.cpp.obj test1\mod.cpp
[ 10%]: archiving.release libtest1.a
llvm-ar cr build\mingw\x86_64\release\libtest1.a build\.objs\test1\mingw\x86_64\release\test1\mod.cpp.obj build\.objs\test1\mingw\x86_64\release\mod\ zmod.std.cppm.obj
[ 37%]: <test10> compiling.module.release zmod.std
clang -c -Qunused-arguments -m64 -std=c++23 -x c++-module -fmodule-output=build\.gens\test1\mingw\x86_64\release\rules\bmi\cache\modules\3bbb4f22\zmod .std.pcm -o build\.objs\test10\mingw\x86_64\release\mod\zmod.std.cppm.obj mod\zmod.std.cppm
[ 39%]: <test11> compiling.module.release zmod.std
clang -c -Qunused-arguments -m64 -std=c++23 -x c++-module -fmodule-output=build\.gens\test1\mingw\x86_64\release\rules\bmi\cache\modules\3bbb4f22\zmod .std.pcm -o build\.objs\test11\mingw\x86_64\release\mod\zmod.std.cppm.obj mod\zmod.std.cppm
[ 40%]: <test12> compiling.module.release zmod.std
clang -c -Qunused-arguments -m64 -std=c++23 -x c++-module -fmodule-output=build\.gens\test1\mingw\x86_64\release\rules\bmi\cache\modules\3bbb4f22\zmod .std.pcm -o build\.objs\test12\mingw\x86_64\release\mod\zmod.std.cppm.obj mod\zmod.std.cppm
[ 41%]: <test13> compiling.module.release zmod.std
clang -c -Qunused-arguments -m64 -std=c++23 -x c++-module -fmodule-output=build\.gens\test1\mingw\x86_64\release\rules\bmi\cache\modules\3bbb4f22\zmod .std.pcm -o build\.objs\test13\mingw\x86_64\release\mod\zmod.std.cppm.obj mod\zmod.std.cppm
[ 42%]: <test14> compiling.module.release zmod.std
clang -c -Qunused-arguments -m64 -std=c++23 -x c++-module -fmodule-output=build\.gens\test1\mingw\x86_64\release\rules\bmi\cache\modules\3bbb4f22\zmod .std.pcm -o build\.objs\test14\mingw\x86_64\release\mod\zmod.std.cppm.obj mod\zmod.std.cppm
[ 43%]: <test15> compiling.module.release zmod.std
clang -c -Qunused-arguments -m64 -std=c++23 -x c++-module -fmodule-output=build\.gens\test1\mingw\x86_64\release\rules\bmi\cache\modules\3bbb4f22\zmod .std.pcm -o build\.objs\test15\mingw\x86_64\release\mod\zmod.std.cppm.obj mod\zmod.std.cppm
[ 45%]: <test16> compiling.module.release zmod.std
clang -c -Qunused-arguments -m64 -std=c++23 -x c++-module -fmodule-output=build\.gens\test1\mingw\x86_64\release\rules\bmi\cache\modules\3bbb4f22\zmod .std.pcm -o build\.objs\test16\mingw\x86_64\release\mod\zmod.std.cppm.obj mod\zmod.std.cppm
[ 46%]: <test17> compiling.module.release zmod.std
clang -c -Qunused-arguments -m64 -std=c++23 -x c++-module -fmodule-output=build\.gens\test1\mingw\x86_64\release\rules\bmi\cache\modules\3bbb4f22\zmod .std.pcm -o build\.objs\test17\mingw\x86_64\release\mod\zmod.std.cppm.obj mod\zmod.std.cppm
[ 47%]: <test7> compiling.module.release zmod.std
clang -c -Qunused-arguments -m64 -std=c++23 -x c++-module -fmodule-output=build\.gens\test1\mingw\x86_64\release\rules\bmi\cache\modules\3bbb4f22\zmod .std.pcm -o build\.objs\test7\mingw\x86_64\release\mod\zmod.std.cppm.obj mod\zmod.std.cppm
[ 48%]: <test8> compiling.module.release zmod.std
clang -c -Qunused-arguments -m64 -std=c++23 -x c++-module -fmodule-output=build\.gens\test1\mingw\x86_64\release\rules\bmi\cache\modules\3bbb4f22\zmod .std.pcm -o build\.objs\test8\mingw\x86_64\release\mod\zmod.std.cppm.obj mod\zmod.std.cppm
[ 51%]: compiling.release test10\mod.cpp
clang -c -Qunused-arguments -m64 -std=c++23 -fmodule-file=zmod.std=build\.gens\test1\mingw\x86_64\release\rules\bmi\cache\modules\3bbb4f22\zmod. std.pcm -o build\.objs\test10\mingw\x86_64\release\test10\mod.cpp.obj test10\mod.cpp
error: error: unable to open output file 'build\.gens\test1\mingw\x86_64\release\rules\bmi\cache\modules\3bbb4f22\zmod.std.pcm': '<C7><EB><C7><F3><B5>IJ<D9><D7><F7><CE><U+07B7><A8><D4><DA>ʹ<D3><C3> <D3>û<A7>ӳ<C9><E4><C7><F8><D3><F2><B4><U+BFAB5><C4><CE>ļ<FE><C9><CF> ִ<D0>С<A3>'
1 error generated.

@waruqi
Copy link
Member

waruqi commented Nov 28, 2024

mingw + clang 哈,我这边没这个环境,只能 msvc 测试。

clang 的你可以调下这里。https://github.com/xmake-io/xmake/tree/dev/xmake/rules/c%2B%2B/modules/modules_support/clang

@vrecluse
Copy link
Author

mingw + clang 哈,我这边没这个环境,只能 msvc 测试。

clang 的你可以调下这里。https://github.com/xmake-io/xmake/tree/dev/xmake/rules/c%2B%2B/modules/modules_support/clang

嗯,试了下 cmd + clang 也有这个问题,应该跟 mingw 没关系

@waruqi
Copy link
Member

waruqi commented Nov 28, 2024

那就是 clang 的 modules 实现问题,你可以调下。。msvc 我这边试了 没遇到问题

@Issues-translate-bot
Copy link

Bot detected the issue body's language is not English, translate it automatically.


That's a problem with clang's modules implementation, you can adjust it. . I tried msvc here and had no problems.

@vrecluse
Copy link
Author

那就是 clang 的 modules 实现问题,你可以调下。。msvc 我这边试了 没遇到问题

调试了以下,似乎是并行编译时,把原来已经编译好的 bmi 做了复用,但是传给类 -fmodule-output 参数,造成重复编译覆盖
这么改了一下,我的 case 可以编过了, make_module_buildcmds 不确定是否也有类似问题 @waruqi

image

@Issues-translate-bot
Copy link

Bot detected the issue body's language is not English, translate it automatically.


That’s a problem with clang’s modules implementation, you can adjust it. . I tried msvc here and had no problems.

After debugging the following, it seems that during parallel compilation, the originally compiled bmi was reused, but passed to the -fmodule-output parameter of the class, causing repeated compilation coverage.
After changing it like this, my case can be compiled. Make_module_buildcmds I am not sure if there is a similar problem @waruqi

image

@waruqi
Copy link
Member

waruqi commented Nov 28, 2024

你可以提个 pr 过来 我看下

make_module_buildcmds 不确定是否也有类似问题

按理应该也会有,你可以注释掉下面这个 function ,就能退化到 buildcmds 模式去执行,来确认

before_build_files(function(target, batchjobs, sourcebatch, opt)

@vrecluse
Copy link
Author

你可以提个 pr 过来 我看下

make_module_buildcmds 不确定是否也有类似问题

按理应该也会有,你可以注释掉下面这个 function ,就能退化到 buildcmds 模式去执行,来确认

before_build_files(function(target, batchjobs, sourcebatch, opt)

#5897

能正常使用但应该不是最优化的,缓存bmi复用就没了

@vrecluse
Copy link
Author

vrecluse commented Nov 28, 2024

有mapped bmi 的情况下 应该用 -fmodule-file

@waruqi
Copy link
Member

waruqi commented Nov 28, 2024

能正常使用但应该不是最优化的,缓存bmi复用就没了

那不行,得兼容

@Issues-translate-bot
Copy link

Bot detected the issue body's language is not English, translate it automatically.


It can be used normally but it should not be optimized. The cached bmi reuse will be gone.

That won't work, it has to be compatible

@vrecluse
Copy link
Author

能正常使用但应该不是最优化的,缓存bmi复用就没了

那不行,得兼容

我看dev分支已经修改过了,我用的2.9.6还没改,命令可以update到dev分支吗,还是需要自己编译
image
image

@Issues-translate-bot
Copy link

Bot detected the issue body's language is not English, translate it automatically.


It can be used normally but it should not be optimized. The cached bmi reuse will be gone.

That’s not possible, it must be compatible

I see that the dev branch has been modified. The 2.9.6 version I am using has not been modified yet. Can I update the command to the dev branch? Or do I need to compile it myself?
image
image

@waruqi
Copy link
Member

waruqi commented Nov 28, 2024

就是说 dev 原本就没这个问题咯?xmake update -s dev

@Issues-translate-bot
Copy link

Bot detected the issue body's language is not English, translate it automatically.


Does that mean dev doesn’t have this problem in the first place? xmake update -s dev

@vrecluse
Copy link
Author

就是说 dev 原本就没这个问题咯?xmake update -s dev

试了下,也有这个问题,而且还出现找不到各种 std 头文件的问题
看了下命令,
dev 的是

clang-scan-deps --format=p1689 -- F:\llvm19\bin\clang -x c++ -c test10\mod.cpp -o build\.objs\test10\mingw\x86_64\release\test10\mod.cpp.obj -Qunused-arguments -m64 --target=x86_64-windows-gnu -std=c++23   

2.9.6是

clang-scan-deps --format=p1689 -- F:\llvm19\bin\clang -x c++ -c test10\mod.cpp -o build\.objs\test10\mingw\x86_64\release\test10\mod.cpp.obj -Qunused-arguments -m64 -std=c++23

不知为何多了 --target=x86_64-windows-gnu

@waruqi
Copy link
Member

waruqi commented Nov 28, 2024

target 有影响?这个 patch 加的 #5823

@vrecluse
Copy link
Author

target 有影响?这个 patch 加的 #5823

可能有,我应该是默认需要编译为msvc的target,没在mingw下安装gnu cxx环境

@vrecluse
Copy link
Author

试用了下 -fmodule-file 选项,提示

error: warning: the form '-fmodule-file=<BMI-path>' is deprecated for standard C++ named modules;consider to use '-fmodule-file=<module-name>=<BMI-path>' instead [-Weager-load-cxx-named-modules]

这个方法内部能否通过 target 获取 module name?

function get_modulefileflag(target)
    local modulefileflag = _g.modulefileflag
    if modulefileflag == nil then
        local compinst = target:compiler("cxx")
        if compinst:has_flags("-fmodule-file=" .. os.tmpfile() .. get_bmi_extension(), "cxxflags", {flagskey = "clang_module_file"}) then
            modulefileflag = "-fmodule-file="
        end
        assert(modulefileflag, "compiler(clang): does not support c++ module!")
        _g.modulefileflag = modulefileflag or false
    end
    return modulefileflag or nil
end

@Issues-translate-bot
Copy link

Bot detected the issue body's language is not English, translate it automatically.


Does this mean that dev doesn’t have this problem in the first place? xmake update -s dev

I tried it, but I also had this problem, and there was also the problem that various std header files could not be found.
After reading the order,
dev is

clang-scan-deps --format=p1689 -- F:\llvm19\bin\clang -x c++ -c test10\mod.cpp -o build\.objs\test10\mingw\x86_64\release\test10\mod.cpp .obj -Qunused-arguments -m64 --target=x86_64-windows-gnu -std=c++23   

2.9.6 is

clang-scan-deps --format=p1689 -- F:\llvm19\bin\clang -x c++ -c test10\mod.cpp -o build\.objs\test10\mingw\x86_64\release\test10\mod.cpp .obj -Qunused-arguments -m64 -std=c++23

I don’t know why there are more --target=x86_64-windows-gnu

@waruqi
Copy link
Member

waruqi commented Nov 28, 2024

target 有影响?这个 patch 加的 #5823

可能有,我应该是默认需要编译为msvc的target,没在mingw下安装gnu cxx环境

你切到了 mingw,用的 mingw gnu target 本身没问题,要用 msvc ,只能切到 windows 平台。。xmake f -p windows

@Issues-translate-bot
Copy link

Bot detected the issue body's language is not English, translate it automatically.


Target has an impact? This patch adds #5823

Maybe, I should compile it into msvc target by default, and I didn’t install the gnu cxx environment under mingw.

@Issues-translate-bot
Copy link

Bot detected the issue body's language is not English, translate it automatically.


Target has an impact? This patch adds #5823

Maybe, I should compile it into msvc target by default, and I didn’t install the gnu cxx environment under mingw.

If you switch to mingw, the mingw gnu target itself is fine. If you want to use msvc, you can only switch to the windows platform. . xmake f -p windows

@vrecluse
Copy link
Author

#5899
重新修改了下,要复用 pcm 缓存的话,需要针对初次编译和缓存分别处理,缓存的情况需要把 pcm 当成源码编译
可能存在的问题:-fmodule-file 选项用的新版参数格式,不知道旧版是否兼容
@waruqi

@Issues-translate-bot
Copy link

Bot detected the issue body's language is not English, translate it automatically.


#5899
Modified it again. If you want to reuse the pcm cache, you need to handle the initial compilation and cache separately. In the case of caching, you need to compile pcm as source code.
Possible problems: The new parameter format used by the -fmodule-file option, I don’t know if the old version is compatible
@waruqi

@waruqi
Copy link
Member

waruqi commented Nov 29, 2024

等晚点我看下,最近比较忙

@Issues-translate-bot
Copy link

Bot detected the issue body's language is not English, translate it automatically.


I'll check it out later, I've been quite busy lately

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants