Skip to content
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

Proposal: Update minimum CMake version required to build the dotnet/runtime repo to 3.20 #74027

Closed
jkoritzinsky opened this issue Aug 16, 2022 · 9 comments · Fixed by #86530
Closed
Assignees
Labels
area-Infrastructure source-build Issues relating to dotnet/source-build
Milestone

Comments

@jkoritzinsky
Copy link
Member

jkoritzinsky commented Aug 16, 2022

Now that we're starting a new release, it's worth revisiting our build requirements across our different supported platforms. For many if not all of our releases, we have had different minimum CMake version requirements depending on the platform. This has generally been due to a variety of different circumstances, varying from version availability on platform to fixes in CMake that are required for use with new supported target platforms or newer versions of Visual Studio.

A few years back, we tried to move our minimum CMake version up to 3.14. This provided us many benefits and allowed us to simplify our build significantly. However, this broke our source-build partners at RedHat. As a result, we ended up rolling back our minimum version of CMake on Linux to 3.6.2 to satisfy the source-build requirements.

In the meantime, our minimum required version of CMake has risen on our non-Linux platforms (and on Linux for non-source-build scenarios) due to various issues.

Due to some bugs in the CMake integration on Windows, we had to update our minimum suggested version to 3.16.4. For people that wish to use the MSBuild backend (which is not the default), 3.21 is required.

Due to bugs in the CMake support for iOS, the minimum required version for our Mac builds is 3.15.5 on the product, and 3.16 on the tests. For MacCatalyst support, the minimum required version is 3.18.

On our non-source-build Linux builds where we use the in-tree copy of libunwind, our minimum requirement is 3.16 as libunwind requires that version.

In #69611 (comment), we determined that RedHat only requires 3.18.2 for their new builds of .NET, not 3.6.2, as they have updated their optional build toolsets that are used by llvm and clang to more modern versions.

.NET 8 and newer will only support RHEL 8 and newer, which has CMake 3.20.2.

RedHat is not our only partner in this space. Our new partners at Canonical are also using source-build for Ubuntu and have a similar class of requirements. However, there are currently no plans to support versions of Ubuntu below 22.04, so the minimum version we would have to use to support our partners at Canonical would be 3.22.1.

Looking at some of our other platforms (some community supported), they all provide versions of CMake of at least 3.20 or newer.

  • Alpine Linux 3.14 includes CMake 3.20
  • FreeBSD includes CMake 3.23
  • Fedora 35 includes CMake 3.21
  • Kitware provides an APT feed for newer CMake versions on older Ubuntu platforms that can be used for non-source-build scenarios like the Microsoft build and our dev innerloop experience for community contributors.
  • CBL-Mariner 2.0 (which we are looking to move to for our build images for our Linux builds) provides CMake 3.21

Given all of this information, it seems that we can finally set a minimum version of CMake across all of our platforms at 3.20. This will enable us to have a simpler repository prerequisite matrix, and it will simplify our support matrix in our CMake scripts. Instead of some branches being able to use newer features because they're only used when we are using newer CMake versions, we will have a consistent feature set used across the repository.

cc: @dotnet/runtime-infrastructure for the Microsoft build.
cc: @dotnet/distro-maintainers for the distro source builds.
cc: @omajid @mirespace specifically for feedback from RedHat and Canonical respectively

@jkoritzinsky jkoritzinsky added source-build Issues relating to dotnet/source-build area-Infrastructure labels Aug 16, 2022
@jkoritzinsky jkoritzinsky added this to the 8.0.0 milestone Aug 16, 2022
@ghost
Copy link

ghost commented Aug 16, 2022

Tagging subscribers to this area: @dotnet/runtime-infrastructure
See info in area-owners.md if you want to be subscribed.

Issue Details

Now that we're starting a new release, it's worth revisiting our build requirements across our different supported platforms. For many if not all of our releases, we have had different minimum CMake version requirements depending on the platform. This has generally been due to a variety of different circumstances, varying from version availability on platform to fixes in CMake that are required for use with new supported target platforms or newer versions of Visual Studio.

A few years back, we tried to move our minimum CMake version up to 3.14. This provided us many benefits and allowed us to simplify our build significantly. However, this broke our source-build partners at RedHat. As a result, we ended up rolling back our minimum version of CMake on Linux to 3.6.2 to satisfy the source-build requirements.

In the meantime, our minimum required version of CMake has risen on our non-Linux platforms (and on Linux for non-source-build scenarios) due to various issues.

Due to some bugs in the CMake integration on Windows, we had to update our minimum suggested version to 3.16.4. For people that wish to use the MSBuild backend (which is not the default), 3.21 is required.

Due to bugs in the CMake support for iOS, the minimum required version for our Mac builds is 3.15.5 on the product, and 3.16 on the tests. For MacCatalyst support, the minimum required version is 3.18.

On our non-source-build Linux builds where we use the in-tree copy of libunwind, our minimum requirement is 3.16 as libunwind requires that version.

In #69611 (comment), we determined that RedHat only requires 3.18.2 for their new builds of .NET, not 3.6.2, as they have updated their optional build toolsets that are used by llvm and clang to more modern versions.

RedHat is not our only partner in this space. Our new partners at Canonical are also using source-build for Ubuntu and have a similar class of requirements. However, there are currently no plans to support versions of Ubuntu below 22.04, so the minimum version we would have to use to support our partners at Canonical would be 3.22.1.

Looking at some of our other platforms (some community supported), they all provide versions of CMake of at least 3.18 or newer.

  • Alpine Linux 3.13 includes CMake 3.18
  • FreeBSD includes CMake 3.23
  • Fedora 35 includes CMake 3.21
  • Kitware provides an APT feed for newer CMake versions on older Ubuntu platforms that can be used for non-source-build scenarios like the Microsoft build and our dev innerloop experience for community contributors.
  • CBL-Mariner 2.0 (which we are looking to move to for our build images for our Linux builds) provides CMake 3.21

Given all of this information, it seems that we can finally set a minimum version of CMake across all of our platforms at 3.18. This will enable us to have a simpler repository prerequisite matrix, and it will simplify our support matrix in our CMake scripts. Instead of some branches being able to use newer features because they're only used when we are using newer CMake versions, we will have a consistent feature set used across the repository.

cc: @dotnet/runtime-infrastructure for the Microsoft build.
cc: @dotnet/distro-maintainers for the distro source builds.
cc: @omajid @mirespace specifically for feedback from RedHat and Canonical respectively

Author: jkoritzinsky
Assignees: -
Labels:

source-build, area-Infrastructure

Milestone: 8.0.0

@huoyaoyuan
Copy link
Member

/cc @shushanhf for LA64 port of CMake.
The version provided by apt source of LA64 vm is 3.13.4

@shushanhf
Copy link
Contributor

shushanhf commented Aug 17, 2022

/cc @shushanhf for LA64 port of CMake. The version provided by apt source of LA64 vm is 3.13.4

Yes, you are right.
The default version of the cmake within the LoongArch64's debian is 3.13.4 which is too low.
But for our .NET developers on LA, we had asked to update to 3.20.6 which built by ourself.

I will feedback to our OS to update the LA's cmake version.

Thanks

@MichaelSimons
Copy link
Member

cc @dotnet/source-build-internal

@jkoritzinsky
Copy link
Member Author

Since .NET 8 will only support RHEL 8 (and Alpine Linux 3.15 and older will be out of support), we can update the minimum to 3.20.2.

RHEL8 ships with 3.20.2, Alpine Linux 3.23.1, and everything else we source-build for ships with newer versions (and it sounds like LA will use 3.20.6).

This moves us out of range for the currently released Debian versions based on the previously-linked table, but there are no current plans for .NET to be source-built into a currently-released Debian version to my knowledge and Debian Sid has a CMake version newer than 3.20.2.

@huoyaoyuan
Copy link
Member

https://devblogs.microsoft.com/cppblog/cmake-presets-integration-in-visual-studio-and-visual-studio-code/

CMake 3.20 provides native support for CMakePresets.json. We may simplify our build configurations and provide better IDE integration then.

@MichaelSimons
Copy link
Member

cc @dotnet/distro-maintainers - FYI, please speak up if this is a concern for your distro.

@jkoritzinsky jkoritzinsky added the blocked Issue/PR is blocked on something - see comments label Apr 7, 2023
@jkoritzinsky
Copy link
Member Author

Once #84148 is in. We can start on this work. Marking as blocked until then.

@jkoritzinsky jkoritzinsky changed the title Proposal: Update minimum CMake version required to build the dotnet/runtime repo to 3.18.1 Proposal: Update minimum CMake version required to build the dotnet/runtime repo to 3.20 Apr 25, 2023
@jkoritzinsky
Copy link
Member Author

This work is now unblocked. I've updated the original post to have the correct target version.

@jkoritzinsky jkoritzinsky removed the blocked Issue/PR is blocked on something - see comments label Apr 25, 2023
@ivdiazsa ivdiazsa linked a pull request May 19, 2023 that will close this issue
@ivdiazsa ivdiazsa self-assigned this May 19, 2023
@ghost ghost locked as resolved and limited conversation to collaborators Aug 3, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-Infrastructure source-build Issues relating to dotnet/source-build
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants