From d4d35cb8f045edc78584f07bd97a25fa6651ba52 Mon Sep 17 00:00:00 2001 From: Ivan Diaz Date: Fri, 19 May 2023 14:29:19 -0700 Subject: [PATCH 01/14] Let's see what happens :) --- src/coreclr/CMakeLists.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/coreclr/CMakeLists.txt b/src/coreclr/CMakeLists.txt index 1495cb736f8cb..ae90e79bbde98 100644 --- a/src/coreclr/CMakeLists.txt +++ b/src/coreclr/CMakeLists.txt @@ -1,4 +1,5 @@ -cmake_minimum_required(VERSION 3.6.2) +cmake_minimum_required(VERSION 3.20) +cmake_policy(VERSION 3.6.2) cmake_policy(SET CMP0042 NEW) # MACOSX_RPATH is enabled by default. From 340a919e772d4775f681c44b2b71f70ce0bc249e Mon Sep 17 00:00:00 2001 From: Ivan Diaz Date: Fri, 19 May 2023 15:09:20 -0700 Subject: [PATCH 02/14] CMake 3.20 works on my machine??? --- src/coreclr/CMakeLists.txt | 1 - 1 file changed, 1 deletion(-) diff --git a/src/coreclr/CMakeLists.txt b/src/coreclr/CMakeLists.txt index ae90e79bbde98..0c3f3a194f58a 100644 --- a/src/coreclr/CMakeLists.txt +++ b/src/coreclr/CMakeLists.txt @@ -1,5 +1,4 @@ cmake_minimum_required(VERSION 3.20) -cmake_policy(VERSION 3.6.2) cmake_policy(SET CMP0042 NEW) # MACOSX_RPATH is enabled by default. From 42c8ddf84565b43d55866f7c85173ac49232d18c Mon Sep 17 00:00:00 2001 From: Ivan Diaz Date: Mon, 22 May 2023 16:17:28 -0700 Subject: [PATCH 03/14] Upped the llibraries CMake version to 3.20 --- src/libraries/tests.proj | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/libraries/tests.proj b/src/libraries/tests.proj index fcbe99e9ea4e2..740e0cc11c761 100644 --- a/src/libraries/tests.proj +++ b/src/libraries/tests.proj @@ -722,12 +722,12 @@ - + - + From ce9a4f88ddf8ead6e40d56d54fa020324e903e92 Mon Sep 17 00:00:00 2001 From: Ivan Diaz Date: Tue, 23 May 2023 14:43:21 -0700 Subject: [PATCH 04/14] Upped native libs CMake version to 3.20, and updated the requirements docs. --- docs/workflow/requirements/linux-requirements.md | 10 +++++++++- docs/workflow/requirements/macos-requirements.md | 2 +- docs/workflow/requirements/windows-requirements.md | 2 +- src/coreclr/CMakeLists.txt | 13 +++---------- src/native/libs/CMakeLists.txt | 10 +--------- 5 files changed, 15 insertions(+), 22 deletions(-) diff --git a/docs/workflow/requirements/linux-requirements.md b/docs/workflow/requirements/linux-requirements.md index b36c0627a92fb..7f6c0d7304e06 100644 --- a/docs/workflow/requirements/linux-requirements.md +++ b/docs/workflow/requirements/linux-requirements.md @@ -24,7 +24,7 @@ Minimum RAM required to build is 1GB. The build is known to fail on 512 MB VMs ( Install the following packages for the toolchain: -* CMake 3.14.5 or newer +* CMake 3.20 or newer * llvm * lld * clang @@ -40,12 +40,20 @@ Install the following packages for the toolchain: * zlib1g-dev * ninja-build (optional, enables building native code with ninja instead of make) +**NOTE**: If you have an Ubuntu version older than 22.04 LTS, don't install `cmake` using `apt`. Follow the note written down below. + ```bash sudo apt install -y cmake llvm lld clang build-essential \ python-is-python3 curl git lldb libicu-dev liblttng-ust-dev \ libssl-dev libkrb5-dev zlib1g-dev ninja-build ``` +**NOTE**: As of now, `apt` only has until CMake version 3.16.3 if you're using Ubuntu 20.04 LTS (or less in older Ubuntu versions), which is lower than the required 3.20. For this case, we use the `snap` package manager, which has version 3.26.4 at the time of writing: + +```bash +sudo snap install cmake +``` + You now have all the required components. #### Additional Requirements for Cross-Building diff --git a/docs/workflow/requirements/macos-requirements.md b/docs/workflow/requirements/macos-requirements.md index aa15ab5648999..0eae7f1d621ac 100644 --- a/docs/workflow/requirements/macos-requirements.md +++ b/docs/workflow/requirements/macos-requirements.md @@ -23,7 +23,7 @@ Building _dotnet/runtime_ depends on several tools to be installed. You can down Install the following packages: -* CMake 3.15.5 or newer +* CMake 3.20 or newer * icu4c * openssl@1.1 or openssl@3 * pkg-config diff --git a/docs/workflow/requirements/windows-requirements.md b/docs/workflow/requirements/windows-requirements.md index 06675bdb8c39e..71d5e2caa70ec 100644 --- a/docs/workflow/requirements/windows-requirements.md +++ b/docs/workflow/requirements/windows-requirements.md @@ -51,7 +51,7 @@ These steps are required only in case the tools have not been installed as Visua * Install [CMake](https://cmake.org/download) for Windows. * Add its location (e.g. C:\Program Files (x86)\CMake\bin) to the PATH environment variable. The installation script has a check box to do this, but you can do it yourself after the fact following the instructions at [Adding to the Default PATH variable](#adding-to-the-default-path-variable). -The _dotnet/runtime_ repository recommends using CMake 3.16.4 or newer, but it may work with CMake 3.15.5. +The _dotnet/runtime_ repository requires using CMake 3.20 or newer. #### Ninja diff --git a/src/coreclr/CMakeLists.txt b/src/coreclr/CMakeLists.txt index 0c3f3a194f58a..69612e940e20f 100644 --- a/src/coreclr/CMakeLists.txt +++ b/src/coreclr/CMakeLists.txt @@ -1,16 +1,9 @@ cmake_minimum_required(VERSION 3.20) cmake_policy(SET CMP0042 NEW) # MACOSX_RPATH is enabled by default. - -if (CMAKE_VERSION VERSION_GREATER 3.7 OR CMAKE_VERSION VERSION_EQUAL 3.7) - cmake_policy(SET CMP0066 NEW) # Honor per-config flags in try_compile() source-file signature. -endif() -if (CMAKE_VERSION VERSION_GREATER 3.8 OR CMAKE_VERSION VERSION_EQUAL 3.8) - cmake_policy(SET CMP0067 NEW) # Honor language standard in try_compile() source-file signature -endif() -if (CMAKE_VERSION VERSION_GREATER 3.15 OR CMAKE_VERSION VERSION_EQUAL 3.15) - cmake_policy(SET CMP0091 NEW) # MSVC runtime library flags are selected by an abstraction. -endif() +cmake_policy(SET CMP0066 NEW) # Honor per-config flags in try_compile() source-file signature. +cmake_policy(SET CMP0067 NEW) # Honor language standard in try_compile() source-file signature +cmake_policy(SET CMP0091 NEW) # MSVC runtime library flags are selected by an abstraction. # Set the project name project(CoreCLR) diff --git a/src/native/libs/CMakeLists.txt b/src/native/libs/CMakeLists.txt index 8a81b64349147..70b8bb9535050 100644 --- a/src/native/libs/CMakeLists.txt +++ b/src/native/libs/CMakeLists.txt @@ -1,14 +1,6 @@ -cmake_minimum_required(VERSION 3.6.2) +cmake_minimum_required(VERSION 3.20) include(CheckCCompilerFlag) -if (CLR_CMAKE_TARGET_IOS OR CLR_CMAKE_TARGET_TVOS) - # CMake 3.14.5 contains bug fixes for iOS - cmake_minimum_required(VERSION 3.14.5) -elseif (CLR_CMAKE_TARGET_MACCATALYST) - # CMake 3.18.1 properly generates MacCatalyst C compiler - cmake_minimum_required(VERSION 3.18.1) -endif () - if (WIN32) cmake_policy(SET CMP0091 NEW) else () From b138c9e9585ddea66b542be3a1913c92e034d665 Mon Sep 17 00:00:00 2001 From: Ivan Diaz Date: Tue, 23 May 2023 15:30:23 -0700 Subject: [PATCH 05/14] Add CMake Policy to 3.17.0 for native libs because of wasm. --- src/native/libs/CMakeLists.txt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/native/libs/CMakeLists.txt b/src/native/libs/CMakeLists.txt index 70b8bb9535050..9be7bd4bdc00e 100644 --- a/src/native/libs/CMakeLists.txt +++ b/src/native/libs/CMakeLists.txt @@ -1,4 +1,6 @@ cmake_minimum_required(VERSION 3.20) +cmake_policy(VERSION 3.17.0) + include(CheckCCompilerFlag) if (WIN32) From 1567280395e858460bfe63ded268cdca3c9263a2 Mon Sep 17 00:00:00 2001 From: Ivan Diaz Date: Tue, 23 May 2023 15:43:32 -0700 Subject: [PATCH 06/14] Downgraded native libs CMake to 3.17.0 temporarily, while we figure out the funny troublemaker wasm. --- src/native/libs/CMakeLists.txt | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/native/libs/CMakeLists.txt b/src/native/libs/CMakeLists.txt index 9be7bd4bdc00e..b06e9e0fd79d6 100644 --- a/src/native/libs/CMakeLists.txt +++ b/src/native/libs/CMakeLists.txt @@ -1,5 +1,4 @@ -cmake_minimum_required(VERSION 3.20) -cmake_policy(VERSION 3.17.0) +cmake_minimum_required(VERSION 3.17.0) include(CheckCCompilerFlag) From 0e007dff41687ab3ae2223071faa1cf3ed44ffd5 Mon Sep 17 00:00:00 2001 From: Ivan Diaz Date: Wed, 24 May 2023 12:05:08 -0700 Subject: [PATCH 07/14] Added a couple notes regarding CMake on Linux and Windows, and upped the corehost and libunwind CMake versions to 3.20 --- docs/workflow/requirements/linux-requirements.md | 8 ++++++-- docs/workflow/requirements/windows-requirements.md | 2 ++ src/native/corehost/CMakeLists.txt | 7 ++----- src/native/external/libunwind/CMakeLists.txt | 2 +- src/native/external/llvm-libunwind/CMakeLists.txt | 2 +- src/native/external/zlib/CMakeLists.txt | 2 +- 6 files changed, 13 insertions(+), 10 deletions(-) diff --git a/docs/workflow/requirements/linux-requirements.md b/docs/workflow/requirements/linux-requirements.md index 7f6c0d7304e06..27cd94b9f455e 100644 --- a/docs/workflow/requirements/linux-requirements.md +++ b/docs/workflow/requirements/linux-requirements.md @@ -40,7 +40,7 @@ Install the following packages for the toolchain: * zlib1g-dev * ninja-build (optional, enables building native code with ninja instead of make) -**NOTE**: If you have an Ubuntu version older than 22.04 LTS, don't install `cmake` using `apt`. Follow the note written down below. +**NOTE**: If you have an Ubuntu version older than 22.04 LTS, don't install `cmake` using `apt` directly. Follow the note written down below. ```bash sudo apt install -y cmake llvm lld clang build-essential \ @@ -48,12 +48,16 @@ python-is-python3 curl git lldb libicu-dev liblttng-ust-dev \ libssl-dev libkrb5-dev zlib1g-dev ninja-build ``` -**NOTE**: As of now, `apt` only has until CMake version 3.16.3 if you're using Ubuntu 20.04 LTS (or less in older Ubuntu versions), which is lower than the required 3.20. For this case, we use the `snap` package manager, which has version 3.26.4 at the time of writing: +**NOTE**: As of now, Ubuntu's `apt` only has until CMake version 3.16.3 if you're using Ubuntu 20.04 LTS (or less in older Ubuntu versions), which is lower than the required 3.20. For this case, we can use the `snap` package manager or the _Kitware APT feed_ to get a new enough version of CMake. + +For snap: ```bash sudo snap install cmake ``` +For the _Kitware APT feed_, follow its [instructions here](https://apt.kitware.com/). + You now have all the required components. #### Additional Requirements for Cross-Building diff --git a/docs/workflow/requirements/windows-requirements.md b/docs/workflow/requirements/windows-requirements.md index 71d5e2caa70ec..05da45bc24877 100644 --- a/docs/workflow/requirements/windows-requirements.md +++ b/docs/workflow/requirements/windows-requirements.md @@ -53,6 +53,8 @@ These steps are required only in case the tools have not been installed as Visua The _dotnet/runtime_ repository requires using CMake 3.20 or newer. +**NOTE**: If you plan on using the `-msbuild` flag for building the repo, you will need version 3.21 at least. This is because the VS2022 generator doesn't exist in CMake until said version. + #### Ninja * Install Ninja in one of the three following ways diff --git a/src/native/corehost/CMakeLists.txt b/src/native/corehost/CMakeLists.txt index cc4fb6a40c2f7..b9674fdeb26e6 100644 --- a/src/native/corehost/CMakeLists.txt +++ b/src/native/corehost/CMakeLists.txt @@ -1,8 +1,5 @@ -cmake_minimum_required(VERSION 3.6.2) - -if (CMAKE_VERSION VERSION_GREATER 3.15 OR CMAKE_VERSION VERSION_EQUAL 3.15) - cmake_policy(SET CMP0091 NEW) -endif() +cmake_minimum_required(VERSION 3.20) +cmake_policy(SET CMP0091 NEW) project(corehost) diff --git a/src/native/external/libunwind/CMakeLists.txt b/src/native/external/libunwind/CMakeLists.txt index 245a41bfbb35d..9651da3caf551 100644 --- a/src/native/external/libunwind/CMakeLists.txt +++ b/src/native/external/libunwind/CMakeLists.txt @@ -1,6 +1,6 @@ project(libunwind) -cmake_minimum_required(VERSION 3.16.1) +cmake_minimum_required(VERSION 3.20) set(CMAKE_C_STANDARD 11) diff --git a/src/native/external/llvm-libunwind/CMakeLists.txt b/src/native/external/llvm-libunwind/CMakeLists.txt index 5c547883f9927..d2afb1ceaf1db 100644 --- a/src/native/external/llvm-libunwind/CMakeLists.txt +++ b/src/native/external/llvm-libunwind/CMakeLists.txt @@ -2,7 +2,7 @@ # Setup Project #=============================================================================== -cmake_minimum_required(VERSION 3.13.4) +cmake_minimum_required(VERSION 3.20) set(LLVM_COMMON_CMAKE_UTILS "${CMAKE_CURRENT_SOURCE_DIR}/../cmake") diff --git a/src/native/external/zlib/CMakeLists.txt b/src/native/external/zlib/CMakeLists.txt index b412dc7feb732..c576e4d65a125 100644 --- a/src/native/external/zlib/CMakeLists.txt +++ b/src/native/external/zlib/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 2.4.4) +cmake_minimum_required(VERSION 3.20) set(CMAKE_ALLOW_LOOSE_LOOP_CONSTRUCTS ON) project(zlib C) From d519a084535caced9c35d77a4294d6ae6c9187cf Mon Sep 17 00:00:00 2001 From: Ivan Diaz Date: Wed, 24 May 2023 16:16:23 -0700 Subject: [PATCH 08/14] Reverted external native components CMake versions, and upped tests to 3.20. Only Mono remains now. --- src/native/external/libunwind/CMakeLists.txt | 2 +- src/native/external/llvm-libunwind/CMakeLists.txt | 2 +- src/native/external/zlib/CMakeLists.txt | 2 +- src/native/libs/CMakeLists.txt | 7 ++++++- src/tests/CMakeLists.txt | 2 +- .../MonoAPI/Native/mono-embedding-api-test/CMakeLists.txt | 2 +- .../Interop/ObjectiveC/AutoReleaseTest/CMakeLists.txt | 2 +- .../Interop/ObjectiveC/ObjectiveCMarshalAPI/CMakeLists.txt | 2 +- src/tests/profiler/native/CMakeLists.txt | 2 +- 9 files changed, 14 insertions(+), 9 deletions(-) diff --git a/src/native/external/libunwind/CMakeLists.txt b/src/native/external/libunwind/CMakeLists.txt index 9651da3caf551..245a41bfbb35d 100644 --- a/src/native/external/libunwind/CMakeLists.txt +++ b/src/native/external/libunwind/CMakeLists.txt @@ -1,6 +1,6 @@ project(libunwind) -cmake_minimum_required(VERSION 3.20) +cmake_minimum_required(VERSION 3.16.1) set(CMAKE_C_STANDARD 11) diff --git a/src/native/external/llvm-libunwind/CMakeLists.txt b/src/native/external/llvm-libunwind/CMakeLists.txt index d2afb1ceaf1db..5c547883f9927 100644 --- a/src/native/external/llvm-libunwind/CMakeLists.txt +++ b/src/native/external/llvm-libunwind/CMakeLists.txt @@ -2,7 +2,7 @@ # Setup Project #=============================================================================== -cmake_minimum_required(VERSION 3.20) +cmake_minimum_required(VERSION 3.13.4) set(LLVM_COMMON_CMAKE_UTILS "${CMAKE_CURRENT_SOURCE_DIR}/../cmake") diff --git a/src/native/external/zlib/CMakeLists.txt b/src/native/external/zlib/CMakeLists.txt index c576e4d65a125..b412dc7feb732 100644 --- a/src/native/external/zlib/CMakeLists.txt +++ b/src/native/external/zlib/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.20) +cmake_minimum_required(VERSION 2.4.4) set(CMAKE_ALLOW_LOOSE_LOOP_CONSTRUCTS ON) project(zlib C) diff --git a/src/native/libs/CMakeLists.txt b/src/native/libs/CMakeLists.txt index b06e9e0fd79d6..d71dd22733a3b 100644 --- a/src/native/libs/CMakeLists.txt +++ b/src/native/libs/CMakeLists.txt @@ -1,4 +1,9 @@ -cmake_minimum_required(VERSION 3.17.0) +if (CLR_CMAKE_TARGET_BROWSER OR CLR_CMAKE_TARGET_WASI) + # Temporary workaround for CI wasm machines that still have CMake 3.17.0. + cmake_minimum_required(VERSION 3.17.0) +else () + cmake_minimum_required(VERSION 3.20) +endif () include(CheckCCompilerFlag) diff --git a/src/tests/CMakeLists.txt b/src/tests/CMakeLists.txt index fc50dc31451ca..6167f236a25ba 100644 --- a/src/tests/CMakeLists.txt +++ b/src/tests/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.6.2) +cmake_minimum_required(VERSION 3.20) cmake_policy(SET CMP0042 NEW) if (CMAKE_VERSION VERSION_GREATER 3.15 OR CMAKE_VERSION VERSION_EQUAL 3.15) diff --git a/src/tests/Interop/MonoAPI/Native/mono-embedding-api-test/CMakeLists.txt b/src/tests/Interop/MonoAPI/Native/mono-embedding-api-test/CMakeLists.txt index d8eca7104e630..8c7b718beae86 100644 --- a/src/tests/Interop/MonoAPI/Native/mono-embedding-api-test/CMakeLists.txt +++ b/src/tests/Interop/MonoAPI/Native/mono-embedding-api-test/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.13.0) +cmake_minimum_required(VERSION 3.20) project (MonoEmbeddingApiTest) include_directories(${INC_PLATFORM_DIR}) diff --git a/src/tests/Interop/ObjectiveC/AutoReleaseTest/CMakeLists.txt b/src/tests/Interop/ObjectiveC/AutoReleaseTest/CMakeLists.txt index 734002e46bf1f..2e5e11993ef62 100644 --- a/src/tests/Interop/ObjectiveC/AutoReleaseTest/CMakeLists.txt +++ b/src/tests/Interop/ObjectiveC/AutoReleaseTest/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.16) +cmake_minimum_required(VERSION 3.20) include ("${CLR_INTEROP_TEST_ROOT}/Interop.cmake") set(CMAKE_OBJC_STANDARD 99) set(CMAKE_OBJC_STANDARD_REQUIRED TRUE) diff --git a/src/tests/Interop/ObjectiveC/ObjectiveCMarshalAPI/CMakeLists.txt b/src/tests/Interop/ObjectiveC/ObjectiveCMarshalAPI/CMakeLists.txt index 85baca869c9d4..bed745f3c1621 100644 --- a/src/tests/Interop/ObjectiveC/ObjectiveCMarshalAPI/CMakeLists.txt +++ b/src/tests/Interop/ObjectiveC/ObjectiveCMarshalAPI/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.16) +cmake_minimum_required(VERSION 3.20) set(CMAKE_OBJC_STANDARD 11) set(CMAKE_OBJC_STANDARD_REQUIRED TRUE) diff --git a/src/tests/profiler/native/CMakeLists.txt b/src/tests/profiler/native/CMakeLists.txt index feb446e8846df..7ff5152f95539 100644 --- a/src/tests/profiler/native/CMakeLists.txt +++ b/src/tests/profiler/native/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.14.5) +cmake_minimum_required(VERSION 3.20) project(Profiler) From 4cd38553d37cd07d557b3b4f7df318e079e3864e Mon Sep 17 00:00:00 2001 From: Ivan Diaz Date: Thu, 25 May 2023 15:17:47 -0700 Subject: [PATCH 09/14] Added mono to the 3.20 gang. Also, changed the condition for wasm. --- src/mono/CMakeLists.txt | 7 ++----- src/mono/wasi/runtime/CMakeLists.txt | 7 ++++++- src/mono/wasm/runtime/CMakeLists.txt | 7 ++++++- src/native/libs/CMakeLists.txt | 2 +- 4 files changed, 15 insertions(+), 8 deletions(-) diff --git a/src/mono/CMakeLists.txt b/src/mono/CMakeLists.txt index bc65886aea2f3..555329f5e65b8 100644 --- a/src/mono/CMakeLists.txt +++ b/src/mono/CMakeLists.txt @@ -1,8 +1,5 @@ -cmake_minimum_required(VERSION 3.14.5) - -if (CMAKE_VERSION VERSION_GREATER 3.15 OR CMAKE_VERSION VERSION_EQUAL 3.15) - cmake_policy(SET CMP0091 NEW) -endif() +cmake_minimum_required(VERSION 3.20) +cmake_policy(SET CMP0091 NEW) project(mono) diff --git a/src/mono/wasi/runtime/CMakeLists.txt b/src/mono/wasi/runtime/CMakeLists.txt index 08bb59b06684a..ca2da52b80a16 100644 --- a/src/mono/wasi/runtime/CMakeLists.txt +++ b/src/mono/wasi/runtime/CMakeLists.txt @@ -1,4 +1,9 @@ -cmake_minimum_required(VERSION 3.14.5) +if (TARGET_ARCH MATCHES "wasm") + # Temporary workaround for CI wasm machines that still have CMake 3.17.0. + cmake_minimum_required(VERSION 3.17.0) +else () + cmake_minimum_required(VERSION 3.20) +endif () project(mono-wasi-runtime C) diff --git a/src/mono/wasm/runtime/CMakeLists.txt b/src/mono/wasm/runtime/CMakeLists.txt index bb311e32b6e27..ecfdc426e5286 100644 --- a/src/mono/wasm/runtime/CMakeLists.txt +++ b/src/mono/wasm/runtime/CMakeLists.txt @@ -1,4 +1,9 @@ -cmake_minimum_required(VERSION 3.14.5) +if (TARGET_ARCH MATCHES "wasm") + # Temporary workaround for CI wasm machines that still have CMake 3.17.0. + cmake_minimum_required(VERSION 3.17.0) +else () + cmake_minimum_required(VERSION 3.20) +endif () project(mono-wasm-runtime C) diff --git a/src/native/libs/CMakeLists.txt b/src/native/libs/CMakeLists.txt index d71dd22733a3b..890bda72c50c4 100644 --- a/src/native/libs/CMakeLists.txt +++ b/src/native/libs/CMakeLists.txt @@ -1,4 +1,4 @@ -if (CLR_CMAKE_TARGET_BROWSER OR CLR_CMAKE_TARGET_WASI) +if (TARGET_ARCH MATCHES "wasm") # Temporary workaround for CI wasm machines that still have CMake 3.17.0. cmake_minimum_required(VERSION 3.17.0) else () From b6dc71deca7fc16074f5d225161675d6c160d09f Mon Sep 17 00:00:00 2001 From: Ivan Diaz Date: Thu, 25 May 2023 15:38:56 -0700 Subject: [PATCH 10/14] Had to condition mono's CMake version as well because of wasm. --- src/mono/CMakeLists.txt | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/mono/CMakeLists.txt b/src/mono/CMakeLists.txt index 555329f5e65b8..a9ce184a9a8ce 100644 --- a/src/mono/CMakeLists.txt +++ b/src/mono/CMakeLists.txt @@ -1,5 +1,9 @@ -cmake_minimum_required(VERSION 3.20) -cmake_policy(SET CMP0091 NEW) +if (TARGET_ARCH MATCHES "wasm") + # Temporary workaround for CI wasm machines that still have CMake 3.17.0. + cmake_minimum_required(VERSION 3.17.0) +else () + cmake_minimum_required(VERSION 3.20) +endif () project(mono) From ad08a84d334005a0452d8d108bf29170f3f38846 Mon Sep 17 00:00:00 2001 From: Ivan Diaz Date: Fri, 26 May 2023 13:13:00 -0700 Subject: [PATCH 11/14] DEBUG-ONLY COMMIT: Added some CMake logging to help me figure out what is set for wasm to think of the appropriate conditional. --- eng/native/init-os-and-arch.sh | 6 ++++++ src/mono/CMakeLists.txt | 8 +++++++- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/eng/native/init-os-and-arch.sh b/eng/native/init-os-and-arch.sh index e693617a6c2b6..831f571288bc9 100644 --- a/eng/native/init-os-and-arch.sh +++ b/eng/native/init-os-and-arch.sh @@ -17,6 +17,9 @@ darwin) exit 1 ;; esac +echo "OSName = $OSName" +echo "os = $os" + # On Solaris, `uname -m` is discouraged, see https://docs.oracle.com/cd/E36784_01/html/E36870/uname-1.html # and `uname -p` returns processor type (e.g. i386 on amd64). # The appropriate tool to determine CPU is isainfo(1) https://docs.oracle.com/cd/E36784_01/html/E36870/isainfo-1.html. @@ -78,3 +81,6 @@ case "$CPUName" in exit 1 ;; esac + +echo "CPUName = $CPUName" +echo "arch = $arch" diff --git a/src/mono/CMakeLists.txt b/src/mono/CMakeLists.txt index a9ce184a9a8ce..f7f0df01c1c1a 100644 --- a/src/mono/CMakeLists.txt +++ b/src/mono/CMakeLists.txt @@ -1,4 +1,10 @@ -if (TARGET_ARCH MATCHES "wasm") +get_cmake_property(_variableNames VARIABLES) +list(SORT _variableNames) +foreach (_varName ${_variableNames}) + message("VAR STATUS: ${_varName}=${${_varName}}") +endforeach() + +if (MONO_COMPONENTS_RID MATCHES "wasm") # Temporary workaround for CI wasm machines that still have CMake 3.17.0. cmake_minimum_required(VERSION 3.17.0) else () From 47586b931e63e303b302536ca22bfe4ebb9a7d87 Mon Sep 17 00:00:00 2001 From: Ivan Diaz Date: Fri, 26 May 2023 13:33:48 -0700 Subject: [PATCH 12/14] DEBUG-ONLY COMMIT: I think I have the answer for wasm now/ --- src/mono/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mono/CMakeLists.txt b/src/mono/CMakeLists.txt index f7f0df01c1c1a..c03debc77f554 100644 --- a/src/mono/CMakeLists.txt +++ b/src/mono/CMakeLists.txt @@ -4,7 +4,7 @@ foreach (_varName ${_variableNames}) message("VAR STATUS: ${_varName}=${${_varName}}") endforeach() -if (MONO_COMPONENTS_RID MATCHES "wasm") +if (MONO_COMPONENTS_RID MATCHES "wasm" OR AOT_TARGET_TRIPLE MATCHES "wasm32") # Temporary workaround for CI wasm machines that still have CMake 3.17.0. cmake_minimum_required(VERSION 3.17.0) else () From 72795e777ab5040a543d4ba48038cda05a1427ac Mon Sep 17 00:00:00 2001 From: Ivan Diaz Date: Tue, 20 Jun 2023 13:41:15 -0700 Subject: [PATCH 13/14] Restored the DEBUG-ONLY changes and set 3.20 as the universal CMake, as the missing machines have now been updated. --- eng/native/init-os-and-arch.sh | 6 ------ src/mono/CMakeLists.txt | 13 +------------ src/mono/wasi/runtime/CMakeLists.txt | 7 +------ src/mono/wasm/runtime/CMakeLists.txt | 7 +------ src/native/libs/CMakeLists.txt | 7 +------ 5 files changed, 4 insertions(+), 36 deletions(-) diff --git a/eng/native/init-os-and-arch.sh b/eng/native/init-os-and-arch.sh index 831f571288bc9..e693617a6c2b6 100644 --- a/eng/native/init-os-and-arch.sh +++ b/eng/native/init-os-and-arch.sh @@ -17,9 +17,6 @@ darwin) exit 1 ;; esac -echo "OSName = $OSName" -echo "os = $os" - # On Solaris, `uname -m` is discouraged, see https://docs.oracle.com/cd/E36784_01/html/E36870/uname-1.html # and `uname -p` returns processor type (e.g. i386 on amd64). # The appropriate tool to determine CPU is isainfo(1) https://docs.oracle.com/cd/E36784_01/html/E36870/isainfo-1.html. @@ -81,6 +78,3 @@ case "$CPUName" in exit 1 ;; esac - -echo "CPUName = $CPUName" -echo "arch = $arch" diff --git a/src/mono/CMakeLists.txt b/src/mono/CMakeLists.txt index c03debc77f554..1c44b9efeab45 100644 --- a/src/mono/CMakeLists.txt +++ b/src/mono/CMakeLists.txt @@ -1,15 +1,4 @@ -get_cmake_property(_variableNames VARIABLES) -list(SORT _variableNames) -foreach (_varName ${_variableNames}) - message("VAR STATUS: ${_varName}=${${_varName}}") -endforeach() - -if (MONO_COMPONENTS_RID MATCHES "wasm" OR AOT_TARGET_TRIPLE MATCHES "wasm32") - # Temporary workaround for CI wasm machines that still have CMake 3.17.0. - cmake_minimum_required(VERSION 3.17.0) -else () - cmake_minimum_required(VERSION 3.20) -endif () +cmake_minimum_required(VERSION 3.20) project(mono) diff --git a/src/mono/wasi/runtime/CMakeLists.txt b/src/mono/wasi/runtime/CMakeLists.txt index 9b43e949d0606..ede21d72193f6 100644 --- a/src/mono/wasi/runtime/CMakeLists.txt +++ b/src/mono/wasi/runtime/CMakeLists.txt @@ -1,9 +1,4 @@ -if (TARGET_ARCH MATCHES "wasm") - # Temporary workaround for CI wasm machines that still have CMake 3.17.0. - cmake_minimum_required(VERSION 3.17.0) -else () - cmake_minimum_required(VERSION 3.20) -endif () +cmake_minimum_required(VERSION 3.20) project(mono-wasi-runtime C) diff --git a/src/mono/wasm/runtime/CMakeLists.txt b/src/mono/wasm/runtime/CMakeLists.txt index 6ff3e1f6fc155..6d76868952e0c 100644 --- a/src/mono/wasm/runtime/CMakeLists.txt +++ b/src/mono/wasm/runtime/CMakeLists.txt @@ -1,9 +1,4 @@ -if (TARGET_ARCH MATCHES "wasm") - # Temporary workaround for CI wasm machines that still have CMake 3.17.0. - cmake_minimum_required(VERSION 3.17.0) -else () - cmake_minimum_required(VERSION 3.20) -endif () +cmake_minimum_required(VERSION 3.20) project(mono-wasm-runtime C) diff --git a/src/native/libs/CMakeLists.txt b/src/native/libs/CMakeLists.txt index 890bda72c50c4..3657fbeccffba 100644 --- a/src/native/libs/CMakeLists.txt +++ b/src/native/libs/CMakeLists.txt @@ -1,9 +1,4 @@ -if (TARGET_ARCH MATCHES "wasm") - # Temporary workaround for CI wasm machines that still have CMake 3.17.0. - cmake_minimum_required(VERSION 3.17.0) -else () - cmake_minimum_required(VERSION 3.20) -endif () +cmake_minimum_required(VERSION 3.20) include(CheckCCompilerFlag) From f3ebb3609962ff4a5d901028de7a2679c1ef8d91 Mon Sep 17 00:00:00 2001 From: Ivan Diaz Date: Thu, 22 Jun 2023 11:19:44 -0700 Subject: [PATCH 14/14] Updated requirements doc with notes for Debian 11 and lower. --- docs/workflow/requirements/linux-requirements.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/workflow/requirements/linux-requirements.md b/docs/workflow/requirements/linux-requirements.md index 27cd94b9f455e..334e5e2ae354c 100644 --- a/docs/workflow/requirements/linux-requirements.md +++ b/docs/workflow/requirements/linux-requirements.md @@ -40,7 +40,7 @@ Install the following packages for the toolchain: * zlib1g-dev * ninja-build (optional, enables building native code with ninja instead of make) -**NOTE**: If you have an Ubuntu version older than 22.04 LTS, don't install `cmake` using `apt` directly. Follow the note written down below. +**NOTE**: If you have an Ubuntu version older than 22.04 LTS, or Debian version older than 12, don't install `cmake` using `apt` directly. Follow the note written down below. ```bash sudo apt install -y cmake llvm lld clang build-essential \ @@ -48,7 +48,7 @@ python-is-python3 curl git lldb libicu-dev liblttng-ust-dev \ libssl-dev libkrb5-dev zlib1g-dev ninja-build ``` -**NOTE**: As of now, Ubuntu's `apt` only has until CMake version 3.16.3 if you're using Ubuntu 20.04 LTS (or less in older Ubuntu versions), which is lower than the required 3.20. For this case, we can use the `snap` package manager or the _Kitware APT feed_ to get a new enough version of CMake. +**NOTE**: As of now, Ubuntu's `apt` only has until CMake version 3.16.3 if you're using Ubuntu 20.04 LTS (less in older Ubuntu versions), and version 3.18.4 in Debian 11 (less in older Debian versions). This is lower than the required 3.20, which in turn makes it incompatible with the repo. For this case, we can use the `snap` package manager or the _Kitware APT feed_ to get a new enough version of CMake. For snap: