Skip to content

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

@jkoritzinsky

Description

@jkoritzinsky

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

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions