xmake-io / xmake

🔥 A cross-platform build utility based on Lua
https://xmake.io
Apache License 2.0
9.62k stars 764 forks source link

release 模式编译报错 C1001: 内部编译器错误,但是debug没问题 #2670

Closed KaivnD closed 1 year ago

KaivnD commented 1 year ago

Xmake 版本

xmake v2.6.9+master.77c7f6204

操作系统版本和架构

Windows 10 21H2 19044.1826

描述问题

很奇怪,最近突然出这个问题,以前没有过,最近换了电脑,电脑原来有visual studio 2019,我新装了2022,我能想到可能的原因就是这个

期待的结果

release模式可以用

工程配置

No response

附加信息和错误日志

[ 82%]: ccache compiling.release 3rdparty\Offset-Polygen\HouseProcess\House.cpp "D:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.33.31629\bin\HostX64\x64\cl.exe" -c /EHsc -nologo -Ox -fp:fast -std:c++17 -Iincludes -I3rdparty\opennurbs -I3rdparty\bvh\include -I3rdparty\polypartition\src -I3rdparty\Offset-Polygen\HouseProcess -D_GNU_SOURCE -DON_COMPILING_OPENNURBS -DOPENNURBS_FREETYPEINC -DOPENNURBS_INPUT_LIBS_DIR -DOPENNURBS_ZLIB_LIB_DIR -DUNICODE -Ddeflate_copyright=z_deflate_copyright -DdeflateTune=z_deflateTune -DdeflateSetHeader=z_deflateSetHeader -Dadler32_combine=z_adler32_combine -Dcrc32_combine=z_crc32_combine -DNOMINMAX -DWIN64 -DNDEBUG -Fobuild.objs\tulo\windows\x64\release\3rdparty\Offset-Polygen\HouseProcess\House.cpp.obj 3rdparty\Offset-Polygen\HouseProcess\House.cpp checking for cl.exe ... D:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.33.31629\bin\HostX64\x64\cl.exe checking for the c compiler (cc) ... cl.exe checking for flags (-Ox -fp:fast) ... ok

cl.exe "-Ox" "-fp:fast" checking for flags (-DNDEBUG) ... ok cl.exe "-DNDEBUG" "-nologo" checking for the c compiler (cc) ... cl.exe checking for the c compiler (cc) ... cl.exe checking for the c compiler (cc) ... cl.exe checking for the c compiler (cc) ... cl.exe checking for the c compiler (cc) ... cl.exe checking for the c compiler (cc) ... cl.exe checking for the c compiler (cc) ... cl.exe checking for the c compiler (cc) ... cl.exe checking for the c compiler (cc) ... cl.exe checking for the c compiler (cc) ... cl.exe checking for flags (cl_external_includedir) ... ok cl.exe "-external:W0" "-external:IC:\Users\KaivnD\AppData\Local.xmake\packages\g\gtest\1.12.1\188944e346694ce89eb8bc3d2f0b7138\include" "/EHsc" checking for flags (cl_external_includedir) ... ok cl.exe "-external:W0" "-external:IC:\Users\KaivnD\AppData\Local.xmake\packages\g\gtest\1.12.1\188944e346694ce89eb8bc3d2f0b7138\include" "/EHsc" error: @programdir\modules\private\async\runjobs.lua:256: @programdir\modules\private\action\build\object.lua:90: @programdir\modules\core\tools\cl.lua:620: opennurbs_lookup.cpp E:\dev\tulo\3rdparty\opennurbs\opennurbs_lookup.cpp(713) : fatal error C1001: 内部编译器错误。 (编译器文件“D:\a_work\1\s\src\vctools\Compiler\Utc\src\p2\main.c”,第 224 行) 要解决此问题,请尝试简化或更改上面所列位置附近的程序。 如果可以,请在此处提供重现步骤: https://developercommunity.visualstudio.com 请选择 Visual C++ “帮助”菜单上的“技术支持”命令,或打开技术支持帮助文件来获得详细信息。 †汣刡楡敳硅散瑰潩⡮⬩砰㤶਍†汣刡楡敳硅散瑰潩⡮⬩砰㤶਍†汣䐡汬敇佴橢慈摮敬⡲⬩砰扤㐹൦ 挠Ⅼ汄䝬瑥扏䡪湡汤牥⤨〫ㅸ〰慡ൣഊ stack traceback: [C]: in function 'error' [@programdir\core\base\os.lua:872]: [@programdir\modules\core\tools\cl.lua:620]: in function 'catch' [@programdir\core\sandbox\modules\try.lua:127]: in function 'try' [@programdir\modules\core\tools\cl.lua:559]: [C]: in function 'xpcall' [@programdir\core\base\utils.lua:280]: [@programdir\modules\private\action\build\object.lua:90]: in function 'script' [@programdir\modules\private\action\build\object.lua:103]: in function 'build_object' [@programdir\modules\private\action\build\object.lua:128]: in function 'jobfunc' [@programdir\modules\private\async\runjobs.lua:232]: [C]: in function 'xpcall' [@programdir\core\base\utils.lua:280]: in function 'trycall' [@programdir\core\sandbox\modules\try.lua:121]: in function 'try' [@programdir\modules\private\async\runjobs.lua:218]: in function 'cotask' [@programdir\core\base\scheduler.lua:388]:

stack traceback: [C]: in function 'error' @programdir\core\base\os.lua:872: in function 'os.raiselevel' (...tail calls...) @programdir\modules\private\async\runjobs.lua:256: in field 'catch' @programdir\core\sandbox\modules\try.lua:127: in global 'try' @programdir\modules\private\async\runjobs.lua:218: in upvalue 'cotask' @programdir\core\base\scheduler.lua:388: in function <@programdir\core\base\scheduler.lua:385>

waruqi commented 1 year ago

这种跟 xmake 有啥关系呢?代码和flags 把编译器搞跪了,你应该找微软那边反馈吧。。

或者你可以复制里面的命令行,手动执行编译 挨个排除flags和代码行。

KaivnD commented 1 year ago

好的,谢谢,我再试试