-
-
Notifications
You must be signed in to change notification settings - Fork 814
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
Comments
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 Describe possible solutionsIs 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 alternativesNo response Other informationNo response |
另外如果修改 c++ module include 的其它头文件,似乎不会触发 module 重新编译 |
In addition, if you modify other header files of c++ module include, it does not seem to trigger module recompilation. |
这边可以的么。没法复现。 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 自带的准。 |
试了下简单小工程没有找到复现的办法。
此外,还出现过 cxxmodules 里的信息,应该是 module 的 cppm 文件,识别为 cpp,不去分析 module 依赖的情况。 |
I tried a simple small project but couldn't find a way to reproduce it.
|
除非有可复现的步骤,不然这边没法调。或者你这自己跟下源码 调下。 |
Unless there are reproducible steps, there is no way to adjust it here. Or you can download the source code yourself. |
测试了下,似乎是并行编译 module 的时候有 bug,改了 cppm 并使用 -j1 编译,试了几次没出问题: @waruqi 有什么解决方案么? |
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: But if parallel compilation is turned on, various weird problems are prone to occur: @waruqi Is there any solution? |
没,除非能复现,才能调试,我刚说了。目前我这复现不出来 |
No, you can't debug it unless it can be reproduced, as I just said. I can't reproduce it now |
这个问题找到一个稳定复现的办法,不过可能跟并行编译的 bug 无关 也就是已经编译过的工程,再添加依赖module的项目,会找不到module的obj |
Find a stable way to reproduce this problem, but it may not be related to the bug of parallel compilation. |
这个问题也复现了,但不是 100%,重复以下步骤我机器上平均三四次会出现一次,怀疑是并行编译读写文件竞争
重复几次就会出现 |
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.
It will appear after repeating it several times |
现在这个工程在我机器上并行编译基本可以必现 |
test.zip |
试了几次,还是正常的么。 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++ |
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++ |
我机器上倒是很好复现,怎么调试有切入点么,比较有嫌疑的lua模块是哪个?
|
我最好上倒是好好复月,是正解有切入点么,公司有嫌疑的lua module是which one?
|
mingw + clang 哈,我这边没这个环境,只能 msvc 测试。 clang 的你可以调下这里。https://github.com/xmake-io/xmake/tree/dev/xmake/rules/c%2B%2B/modules/modules_support/clang |
嗯,试了下 cmd + clang 也有这个问题,应该跟 mingw 没关系 |
那就是 clang 的 modules 实现问题,你可以调下。。msvc 我这边试了 没遇到问题 |
That's a problem with clang's modules implementation, you can adjust it. . I tried msvc here and had no problems. |
调试了以下,似乎是并行编译时,把原来已经编译好的 bmi 做了复用,但是传给类 -fmodule-output 参数,造成重复编译覆盖 |
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. |
你可以提个 pr 过来 我看下
按理应该也会有,你可以注释掉下面这个 function ,就能退化到 buildcmds 模式去执行,来确认 xmake/xmake/rules/c++/modules/xmake.lua Line 74 in 2c973f5
|
能正常使用但应该不是最优化的,缓存bmi复用就没了 |
有mapped bmi 的情况下 应该用 -fmodule-file |
那不行,得兼容 |
That won't work, it has to be compatible |
就是说 dev 原本就没这个问题咯?xmake update -s dev |
Does that mean dev doesn’t have this problem in the first place? xmake update -s dev |
试了下,也有这个问题,而且还出现找不到各种 std 头文件的问题
2.9.6是
不知为何多了 --target=x86_64-windows-gnu |
target 有影响?这个 patch 加的 #5823 |
可能有,我应该是默认需要编译为msvc的target,没在mingw下安装gnu cxx环境 |
试用了下 -fmodule-file 选项,提示
这个方法内部能否通过 target 获取 module name?
|
I tried it, but I also had this problem, and there was also the problem that various std header files could not be found.
2.9.6 is
I don’t know why there are more --target=x86_64-windows-gnu |
你切到了 mingw,用的 mingw gnu target 本身没问题,要用 msvc ,只能切到 windows 平台。。 |
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. . |
#5899 |
等晚点我看下,最近比较忙 |
I'll check it out later, I've been quite busy lately |
你在什么场景下需要该功能?
modules 的依赖文件缓存似乎不够聪明,比如
import wrong_module; // wrong_module 不存在
编译生成 module 依赖后,编译到该文件时报错
把它改为正确的如 import right_module;
仍然会报错没有 wrong_module
描述可能的解决方案
有没有单独的命令可以清理module依赖重新生成?现在似乎只能删build目录重新编译
描述你认为的候选方案
No response
其他信息
No response
The text was updated successfully, but these errors were encountered: