Skip to content

Commit

Permalink
ci: Use the embedded debug information for MSVC
Browse files Browse the repository at this point in the history
We currently run into this error message in our windows CI:
```
FAILED: 3rdparty/fmt/CMakeFiles/fmt.dir/src/os.cc.obj
sccache C:\PROGRA~1\MICROS~2\2022\ENTERP~1\VC\Tools\MSVC\1440~1.338\bin\Hostx64\x64\cl.exe  /nologo /TP -DKNUT_BUILDDATE=\"2024-06-07\" -DKNUT_VERSION=\"1.0\" -DKNUT_VERSION_STRING="\"1.0 (revision: c91adac)\"" -DTEST_DATA_PATH=\"D:/a/knut/knut/test_data\" -ID:\a\knut\knut\build-ci\3rdparty\fmt -ID:\a\knut\knut\3rdparty\fmt -ID:\a\knut\knut\build-ci\3rdparty\fmt\fmt_autogen\include -ID:\a\knut\knut\3rdparty\fmt\include /DWIN32 /D_WINDOWS /GR /EHsc /Zi /O2 /Ob1 /DNDEBUG -std:c++latest -MD /showIncludes /Fo3rdparty\fmt\CMakeFiles\fmt.dir\src\os.cc.obj /Fdfmt.pdb /FS -c D:\a\knut\knut\3rdparty\fmt\src\os.cc
D:\a\knut\knut\3rdparty\fmt\src\os.cc: fatal error C1041: cannot open program database 'D:\a\knut\knut\build-ci\fmt.pdb'; if multiple CL.EXE write to the same .PDB file, please use /FS
```
Obviously /FS won't help, as that's already added.

However, in this issue: https://gitlab.kitware.com/cmake/cmake/-/issues/20222,
@mwestphal suggests that /Zi may be the issue. This makes sense, as
that's what's forcing the use of a separate pdb file for debug info.

If we use the Embedded format, this should fall back to /Z7, which
includes the debug information within the object files themselves.
So there should be no pdb file that can have lock contention.
  • Loading branch information
LeonMatthesKDAB committed Jun 7, 2024
1 parent 9b0d3be commit 9aff1e0
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions CMakePresets.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@
"generator": "Ninja",
"cacheVariables": {
"CMAKE_BUILD_TYPE": "RelWithDebInfo",
"CMAKE_MSVC_DEBUG_INFORMATION_FORMAT": "Embedded",
"KNUT_ERROR_ON_WARN": "ON",
"KNUT_USE_STD_FORMAT": "OFF"
}
Expand Down

0 comments on commit 9aff1e0

Please sign in to comment.