Skip to content

Repo doesn't build with latest CMake #121788

Closed

Description

@krwq

Description

As of today, current version of CMake is: Release Candidate (4.2.0-rc4) which causes build errors.

3.31.9 - works fine.

Reproduction Steps

  • fresh VM
  • install git, latest cmake, VS etc.
  • build -rc Release -s clr+libs

Expected behavior

builds fine

Actual behavior

Error

...
CMake Error at nativeaot/Bootstrap/base/cmake_install.cmake:45 (file):
  file INSTALL cannot find
  "C:/src/runtime/artifacts/obj/coreclr/windows.x64.Release/nativeaot/Bootstrap/base/bootstrapper.pdb":
  File exists.
Call Stack (most recent call first):
  nativeaot/Bootstrap/cmake_install.cmake:42 (include)
  nativeaot/cmake_install.cmake:42 (include)
  cmake_install.cmake:97 (include)


FAILED: CMakeFiles/install.util
C:\Windows\system32\cmd.exe /C "cd /D C:\src\runtime\artifacts\obj\coreclr\windows.x64.Release && "C:\Program Files\CMake\bin\cmake.exe" -P cmake_install.cmake"
ninja: build stopped: subcommand failed.
BUILD: Error: native component build failed. Refer to the build log files for details.
    "C:\src\runtime\artifacts\log\Release\CoreCLR_windows__x64__Release__x64.log"
    "C:\src\runtime\artifacts\log\Release\CoreCLR_windows__x64__Release__x64.wrn"
    "C:\src\runtime\artifacts\log\Release\CoreCLR_windows__x64__Release__x64.err"
C:\src\runtime\src\coreclr\runtime.proj(115,5): error MSB3073: The command ""C:\src\runtime\src\coreclr\build-runtime.cmd" -x64 -release -os windows -pgodatapath "C:\Users\kwicher\.nuget\packages\optimization.windows_nt-x64.pgo.coreclr\1.0.0-prerelease.25502.1" -targetrid win-x64 -cmakeargs "-DCLR_DOTNET_RID=win-x64" -cmakeargs "-DCLR_DOTNET_HOST_PATH=C:\src\runtime\.dotnet\dotnet.exe" -cmakeargs "-DCDAC_BUILD_TOOL_BINARY_PATH=C:\src\runtime\artifacts\bin\coreclr\windows.x64.Release\cdac-build-tool\cdac-build-tool.dll" -cmakeargs "-DCLR_CMAKE_RUNTIME_CORECLR=1" -cmakeargs "-DCMAKE_PRODUCT_VERSION=10.0.0" -cmakeargs "-DCMAKE_CONTINUOUS_INTEGRATION_BUILD=False" -cmakeargs "-DCMAKE_NET_CORE_APP_CURRENT_VERSION=10.0" -cmakeargs "-DCMAKE_BUILD_LIBRARIES_CONFIGURATION=Debug" -cmakeargs "-DCMAKE_BUILD_RUNTIME_CONFIGURATION=Release"" exited with code 1.

Build FAILED.

C:\src\runtime\src\coreclr\runtime.proj(115,5): error MSB3073: The command ""C:\src\runtime\src\coreclr\build-runtime.cmd" -x64 -release -os windows -pgodatapath "C:\Users\kwicher\.nuget\packages\optimization.windows_nt-x64.pgo.coreclr\1.0.0-prerelease.25502.1" -targetrid win-x64 -cmakeargs "-DCLR_DOTNET_RID=win-x64" -cmakeargs "-DCLR_DOTNET_HOST_PATH=C:\src\runtime\.dotnet\dotnet.exe" -cmakeargs "-DCDAC_BUILD_TOOL_BINARY_PATH=C:\src\runtime\artifacts\bin\coreclr\windows.x64.Release\cdac-build-tool\cdac-build-tool.dll" -cmakeargs "-DCLR_CMAKE_RUNTIME_CORECLR=1" -cmakeargs "-DCMAKE_PRODUCT_VERSION=10.0.0" -cmakeargs "-DCMAKE_CONTINUOUS_INTEGRATION_BUILD=False" -cmakeargs "-DCMAKE_NET_CORE_APP_CURRENT_VERSION=10.0" -cmakeargs "-DCMAKE_BUILD_LIBRARIES_CONFIGURATION=Debug" -cmakeargs "-DCMAKE_BUILD_RUNTIME_CONFIGURATION=Release"" exited with code 1.
    0 Warning(s)
    1 Error(s)

Time Elapsed 00:07:08.28
Build failed with exit code 1. Check errors above.
Some builds failed:
        Configuration: Debug, Architecture: x64(this is just end of the log)

Regression?

not on .NET side

Known Workarounds

install old cmake

Configuration

No response

Other information

No response

Activity

  1. added
    untriaged
    on Nov 19, 2025
  2. ericstj commented on Dec 3, 2025

    @ericstj
    Member

    I'm hitting the same @agocke any idea how to fix this? I don't see any earlier failure, just that the build didn't produce a PDB in the location that it's trying to install.

      CMake Error at nativeaot/Bootstrap/base/cmake_install.cmake:45 (file):
        file INSTALL cannot find
        "C:/src/dotnet/runtime/artifacts/obj/coreclr/windows.x64.Release/nativeaot/Bootstrap/base/bootstrapper.pdb":
        File exists.
      Call Stack (most recent call first):
        nativeaot/Bootstrap/cmake_install.cmake:42 (include)
        nativeaot/cmake_install.cmake:42 (include)
        cmake_install.cmake:97 (include)
    

    I do see it in a sub-directory:

    C:\src\dotnet\runtime\artifacts>dir /s /b bootstrapper.pdb
    C:\src\dotnet\runtime\artifacts\obj\coreclr\windows.x64.Release\nativeaot\Bootstrap\base\CMakeFiles\bootstrapper.dir\bootstrapper.pdb
    
  3. agocke commented on Dec 3, 2025

    @agocke
    Member

    I'm not a cmake expert, but we can try copilot.

  4. ericstj commented on Dec 3, 2025

    @ericstj
    Member

    I'm not a cmake expert

    I tagged you because I think you might own

    install (FILES $<TARGET_OBJECTS:${targetName}> DESTINATION ${destination} COMPONENT nativeaot RENAME ${targetName}.obj)
    if (CMAKE_GENERATOR MATCHES "Visual Studio")
    install (FILES ${CMAKE_CURRENT_BINARY_DIR}/$<CONFIG>/${targetName}.pdb DESTINATION ${destination} COMPONENT nativeaot)
    else()
    install (FILES ${CMAKE_CURRENT_BINARY_DIR}/${targetName}.pdb DESTINATION ${destination} COMPONENT nativeaot)
    endif()

    but I could be wrong.

  5. am11 commented on Dec 3, 2025

    @am11
    Member

    This is a regression in cmake 4.2 rc and being fixed upstream https://gitlab.kitware.com/cmake/cmake/-/issues/27401. I think we shouldn't workaround it here but instead wait for the fix and stable release.

    cc @jkoritzinsky

  6. jkoritzinsky commented on Dec 3, 2025

    @jkoritzinsky
    Member

    If we have the ability to control where the compile PDB gets dropped, we should just use that. I think the fix in #122152 is worthwhile and is worth taking if it fixes the bug.

  7. agocke commented on Dec 3, 2025

    @agocke
    Member

    @ericstj @krwq How did you all get a CMake RC? Were you deliberately trying to scout new versions?

  8. added this to the Future milestone on Dec 3, 2025
  9. removed
    untriaged
    on Dec 3, 2025
  10. ericstj commented on Dec 3, 2025

    @ericstj
    Member

    Trying to make my devbox work that only had Dev18

  11. ZingBallyhoo commented on Dec 3, 2025

    @ZingBallyhoo
    Contributor

    How did you all get a CMake RC?

    4.2 was fully released as of Nov 20th (1 day after this issue was opened with rc4). I installed via WinGet without caring what version so I ended up here too.

  12. locked and limited conversation to collaborators on Jan 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

area-Infrastructure-coreclr

Type

No type

Projects

Relationships

None yet

Development

No branches or pull requests

Issue actions