Closed star-hengxing closed 4 months ago
Bot detected the issue body's language is not English, translate it automatically.
What about patch /FS?
cmake + debug + ninja 会设置 /FS,但依然报错。 而且我发现只是 jobs 为 1,也是一样的报错
Bot detected the issue body's language is not English, translate it automatically.
cmake + debug + ninja will set /FS, but still report an error. And I found that only if jobs is 1, the same error is reported.
cmake + debug + ninja 会设置 /FS,但依然报错。 而且我发现只是 jobs 为 1,也是一样的报错
你说的是 backward-cpp 包么,/Fdpdb\ /FS
这个包的 flags 不对,/Fd
后面应该跟一个可写的 pdb file,例如 /Fdxxx.pdb
而不是 pdb/
目录。。如果 /Fd
后面不是跟的不是可写的 pdb 文件,写入失败,就会报这个错,即使设置了 /FS
所以,其实这个还是 这个包的 cmake 配置,或者 cmake 本身有问题
cl.exe /nologo /TP -DBACKWARD_HAS_BACKTRACE=0 -DBACKWARD_HAS_BACKTRACE_SYMBOL=0 -DBACKWARD_HAS_BFD=0 -DBACKWARD_HAS_DW=0 -DBACKWARD_HAS_DWARF=0 -DBACKWARD_HAS_LIBUNWIND=0 -DBACKWARD_HAS_UNWIND=0 -IC:\Users\wangrunqing\AppData\Local.xmake\cache\packages\2407\b\backward-cpp\v1.6\source /DWIN32 /D_WINDOWS /W3 /GR /EHsc /DWIN32 /D_WINDOWS /W3 /GR /EHsc /Zi /Ob0 /Od /RTC1 /showIncludes /FoCMakeFiles\backward_object.dir\backward.cpp.obj /Fdpdb\ /FS -c C:\Users\wangrunqing\AppData\Local.xmake\cache\packages\2407\b\backward-cpp\v1.6\source\backward.cpp
Bot detected the issue body's language is not English, translate it automatically.
cmake + debug + ninja will set /FS, but still report an error. And I found that only if jobs is 1, the same error is reported.
Are you talking about the backward-cpp package? The flags of /Fdpdb\ /FS
are wrong. /Fd
should be followed by a writable pdb file, such as /Fdxxx.pdb
instead of the pdb/
directory. . If /Fd
is not followed by a pdb file that is not writable and the writing fails, this error will be reported, even if /FS
is set.
So, in fact, this is still the cmake configuration of this package, or there is a problem with cmake itself.
cl.exe /nologo /TP -DBACKWARD_HAS_BACKTRACE=0 -DBACKWARD_HAS_BACKTRACE_SYMBOL=0 -DBACKWARD_HAS_BFD=0 -DBACKWARD_HAS_DW=0 -DBACKWARD_HAS_LIBUNWIND=0 -DBACKWARD_HAS_UNWIND=0 -IC:\Users \wangrunqing\AppData\Local.xmake \cache\packages\2407\b\backward-cpp\v1.6\source /DWIN32 /D_WINDOWS /W3 /GR /EHsc /DWIN32 /D_WINDOWS /W3 /GR /EHsc /Zi /Ob0 /Od /RTC1 /showIncludes /FoCMakeFiles \backward_object.dir\backward.cpp.obj /Fdpdb\ /FS -c C:\Users\wangrunqing\AppData\Local.xmake\cache\packages\2407\b\backward-cpp\v1.6\source\backward .cpp
嗯,不过目前仓库里有 11 个包需要这样 workaround,那感觉 xmake 这边优化下拷贝 pdb 的逻辑可能更好
Bot detected the issue body's language is not English, translate it automatically.
Well, there are currently 11 packages in the warehouse that require this kind of workaround. I feel that it might be better for xmake to optimize the logic of copying pdb here.
嗯,不过目前仓库里有 11 个包需要这样 workaround,那感觉 xmake 这边优化下拷贝 pdb 的逻辑可能更好
主要还是 cmake 生成的 build.ninja 不会自动创建 build/pdb
目录,导致 /Fdpdb/
会让 cl.exe 生成 pdb/v140.pdb
写入失败。。
另外一种办法就是提前帮它创建好 build/pdb 目录,就行了
Bot detected the issue body's language is not English, translate it automatically.
Hmm, but there are currently 11 packages in the warehouse that require this kind of workaround. I feel that it might be better for xmake to optimize the logic of copying pdb here.
The main reason is that the build.ninja generated by cmake does not automatically create the build/pdb
directory, causing /Fdpdb/
to cause cl.exe to generate pdb/v140.pdb
and fail to write. .
Another way is to create the build/pdb directory for it in advance.
可以试下 这个 patch https://github.com/xmake-io/xmake/pull/5365
if multiple CL.EXE write to the same .PDB file, please use /FS
if multiple CL.EXE write to the same .PDB file, please use /FS
/FS has been set.
Xmake Version
dev
Operating System Version and Architecture
N/A
Describe Bug
使用 ninja 构建一些 debug 包的时候会遇到
workaround 方法
这样解决后,xmake 不会把 pdb 拷贝出来。
Expected Behavior
可能的解决方法:
Project Configuration
N/A
Additional Information and Error Logs
N/A