From 722270ff502522ed88b14a48263f335939b0acac Mon Sep 17 00:00:00 2001 From: Ben Boeckel Date: Sat, 1 May 2021 14:03:41 -0400 Subject: ci: update to 3.21.0-rc2 for CI usage This version includes JUnit support in CTest. --- .gitlab/ci/cmake.ps1 | 6 +++--- .gitlab/ci/cmake.sh | 12 ++++++------ 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/.gitlab/ci/cmake.ps1 b/.gitlab/ci/cmake.ps1 index 3d6fb81..a16fe45 100755 --- a/.gitlab/ci/cmake.ps1 +++ b/.gitlab/ci/cmake.ps1 @@ -1,8 +1,8 @@ $erroractionpreference = "stop" -$version = "3.19.7" -$sha256sum = "E6788D6E23B3026C37FCFA7658075D6B5F9113F26FAE17FE372AD4A7EE62D5FD" -$filename = "cmake-$version-win64-x64" +$version = "3.21.0-rc2" +$sha256sum = "AF88454243BCBAF9F537458562D669DAF0DBEDA8C0FD82C1D93BC2B4285AE4C7" +$filename = "cmake-$version-windows-x86_64" $tarball = "$filename.zip" $outdir = $pwd.Path diff --git a/.gitlab/ci/cmake.sh b/.gitlab/ci/cmake.sh index e02eb8a..ff59d28 100755 --- a/.gitlab/ci/cmake.sh +++ b/.gitlab/ci/cmake.sh @@ -2,22 +2,22 @@ set -e -readonly version="3.19.3" +readonly version="3.21.0-rc2" case "$(uname -s)-$(uname -m)" in Linux-x86_64) shatool="sha256sum" - sha256sum="c18b65697e9679e5c88dccede08c323cd3d3730648e59048047bba82097e0ffc" - platform="Linux-x86_64" + sha256sum="31d4f5f4bb8793127eb441c8311fd4baad4d2a86c26fd37b43d4ef23887c332e" + platform="linux-x86_64" ;; Linux-aarch64) shatool="sha256sum" - sha256sum="66e507c97ffb586d7ca6567890808b792c8eb004b645706df6fbf27826a395a2" - platform="Linux-aarch64" + sha256sum="437565f32e3f28fd8322f96a5472b196825eaf5ef6139e1c383afe624decc476" + platform="linux-aarch64" ;; Darwin-*) shatool="shasum -a 256" - sha256sum="a6b79ad05f89241a05797510e650354d74ff72cc988981cdd1eb2b3b2bda66ac" + sha256sum="5ab0ee4edb45de33080f571cf69300b2abd92dc02a9c624b3c289a4a14cab160" platform="macos-universal" ;; *) -- cgit v0.12 From cb5c03ed04488d9976f0afaee59e901050c82c82 Mon Sep 17 00:00:00 2001 From: Ben Boeckel Date: Sat, 1 May 2021 14:05:18 -0400 Subject: gitlab-ci: upload JUnit reports for builds GitLab can render test results which come from JUnit files and inform which tests have started failing on an MR. --- .gitlab-ci.yml | 8 ++++++++ .gitlab/artifacts.yml | 11 +++++++++++ .gitlab/ci/ctest_test.cmake | 1 + .gitlab/ci/ctest_test_external.cmake | 1 + 4 files changed, 21 insertions(+) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index bbed2e2..2ead13b 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -163,6 +163,7 @@ test:debian10-ninja: - .debian10_ninja - .cmake_test_linux_release - .linux_builder_tags_qt + - .cmake_junit_artifacts - .run_dependent - .needs_centos6_x86_64 @@ -171,6 +172,7 @@ test:debian10-aarch64-ninja: - .debian10_aarch64_ninja - .cmake_test_linux_release - .linux_builder_tags_aarch64_qt + - .cmake_junit_artifacts - .run_dependent - .needs_centos7_aarch64 variables: @@ -209,6 +211,7 @@ test:fedora34-makefiles-nospace: - .fedora34_makefiles - .cmake_test_linux_release - .linux_builder_tags_qt + - .cmake_junit_artifacts - .run_dependent - .needs_centos6_x86_64 variables: @@ -221,6 +224,7 @@ test:cuda10.2-nvidia: - .cuda10.2_nvidia - .cmake_test_linux_release - .linux_builder_tags_cuda + - .cmake_junit_artifacts - .run_dependent - .needs_centos6_x86_64 @@ -259,6 +263,7 @@ test:fedora34-ninja-multi: - .fedora34_ninja_multi - .cmake_test_linux_external - .linux_builder_tags_qt + - .cmake_junit_artifacts - .run_dependent dependencies: - test:fedora34-ninja @@ -625,6 +630,7 @@ test:macos-x86_64-xcode: - .macos_x86_64_xcode - .cmake_test_macos_external - .macos_x86_64_builder_ext_tags + - .cmake_junit_artifacts - .run_dependent dependencies: - test:macos-x86_64-ninja @@ -636,6 +642,7 @@ test:macos-arm64-xcode: - .macos_arm64_xcode - .cmake_test_macos_external - .macos_arm64_builder_ext_tags + - .cmake_junit_artifacts - .run_dependent dependencies: - test:macos-arm64-ninja @@ -717,6 +724,7 @@ test:windows-vs2019-x64: - .windows_vs2019_x64 - .cmake_test_windows_external - .windows_builder_ext_tags + - .cmake_junit_artifacts - .run_dependent dependencies: - test:windows-vs2019-x64-ninja diff --git a/.gitlab/artifacts.yml b/.gitlab/artifacts.yml index edd313f..45e4c5b 100644 --- a/.gitlab/artifacts.yml +++ b/.gitlab/artifacts.yml @@ -82,11 +82,22 @@ - build/cmake-*.tar.gz - build/cmake-*.zip +.cmake_junit_artifacts: + artifacts: + expire_in: 1d + when: always + reports: + junit: + - build/junit.xml + .cmake_test_artifacts: artifacts: expire_in: 1d # External testing can be useful even if test jobs fail. when: always + reports: + junit: + - build/junit.xml paths: # Take the install tree. - build/install/ diff --git a/.gitlab/ci/ctest_test.cmake b/.gitlab/ci/ctest_test.cmake index facf9ba..b02d032 100644 --- a/.gitlab/ci/ctest_test.cmake +++ b/.gitlab/ci/ctest_test.cmake @@ -20,6 +20,7 @@ include("${CMAKE_CURRENT_LIST_DIR}/ctest_exclusions.cmake") ctest_test( PARALLEL_LEVEL "${nproc}" TEST_LOAD "${nproc}" + OUTPUT_JUNIT "${CTEST_BINARY_DIRECTORY}/junit.xml" RETURN_VALUE test_result EXCLUDE "${test_exclusions}") ctest_submit(PARTS Test) diff --git a/.gitlab/ci/ctest_test_external.cmake b/.gitlab/ci/ctest_test_external.cmake index 6576c26..48e910b 100644 --- a/.gitlab/ci/ctest_test_external.cmake +++ b/.gitlab/ci/ctest_test_external.cmake @@ -74,6 +74,7 @@ include("${CMAKE_CURRENT_LIST_DIR}/ctest_exclusions.cmake") ctest_test( PARALLEL_LEVEL "${nproc}" TEST_LOAD "${nproc}" + OUTPUT_JUNIT "${CTEST_BINARY_DIRECTORY}/junit.xml" RETURN_VALUE test_result ${ctest_label_args} EXCLUDE "${test_exclusions}") -- cgit v0.12 From 9c310ff0752913c438660a5f0ffed9f4d905a2b7 Mon Sep 17 00:00:00 2001 From: Michael Hirsch Date: Wed, 30 Jun 2021 20:02:55 -0400 Subject: Help: Note C_STANDARD values added in CMake 3.21 Issue: #22366 --- Help/prop_tgt/C_STANDARD.rst | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/Help/prop_tgt/C_STANDARD.rst b/Help/prop_tgt/C_STANDARD.rst index e22b775..ecba2a8 100644 --- a/Help/prop_tgt/C_STANDARD.rst +++ b/Help/prop_tgt/C_STANDARD.rst @@ -11,7 +11,26 @@ flag such as ``-std=gnu11`` to the compile line. For compilers that have no notion of a C standard level, such as Microsoft Visual C++ before VS 16.7, this property has no effect. -Supported values are ``90``, ``99``, ``11``, ``17``, ``23``. +Supported values are: + +``90`` + C89/C90 + +``99`` + C99 + +``11`` + C11 + +``17`` + .. versionadded:: 3.21 + + C17 + +``23`` + .. versionadded:: 3.21 + + C23 If the value requested does not result in a compile flag being added for the compiler in use, a previous standard flag will be added instead. This -- cgit v0.12 From e93245ec64bec6e5f63388e4b4714c7a9d3cbf51 Mon Sep 17 00:00:00 2001 From: Brad King Date: Thu, 1 Jul 2021 12:56:17 -0400 Subject: DetermineCompiler: Restore identification of MSVC with no INCLUDE or LIB Update the change from commit c6aaaf066a (DetermineCompiler: Restore identification of MSVC with no INCLUDE dirs, 2021-06-29, v3.21.0-rc2~6^2) to also work with no `LIB` dirs. Add the `-c` flag to compile an object file without linking. --- Modules/CMakeDetermineCCompiler.cmake | 3 ++- Modules/CMakeDetermineCXXCompiler.cmake | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/Modules/CMakeDetermineCCompiler.cmake b/Modules/CMakeDetermineCCompiler.cmake index ca497f1..0f80f9c 100644 --- a/Modules/CMakeDetermineCCompiler.cmake +++ b/Modules/CMakeDetermineCCompiler.cmake @@ -88,7 +88,8 @@ else() # MSVC needs at least one include directory for __has_include to function, # but custom toolchains may run MSVC with no INCLUDE env var and no -I flags. - "-I__does_not_exist__" + # Also avoid linking so this works with no LIB env var. + "-c -I__does_not_exist__" ) endif() if(CMAKE_C_COMPILER_TARGET) diff --git a/Modules/CMakeDetermineCXXCompiler.cmake b/Modules/CMakeDetermineCXXCompiler.cmake index e297f90..556518f 100644 --- a/Modules/CMakeDetermineCXXCompiler.cmake +++ b/Modules/CMakeDetermineCXXCompiler.cmake @@ -83,7 +83,8 @@ else() # MSVC needs at least one include directory for __has_include to function, # but custom toolchains may run MSVC with no INCLUDE env var and no -I flags. - "-I__does_not_exist__" + # Also avoid linking so this works with no LIB env var. + "-c -I__does_not_exist__" ) endif() -- cgit v0.12 From 6a6efdcaedc6f87fbafd40af5305cabdced450c4 Mon Sep 17 00:00:00 2001 From: Marc Chevrier Date: Thu, 1 Jul 2021 11:47:52 +0200 Subject: Makefiles: Normalize compiler-generated depfile paths Even though Makefile generators pass source files and include directories by absolute path to the compiler, the compiler may generate depfile paths relative to the current working directory. For example, `ccache` with `CCACHE_BASEDIR` may transform paths this way. When reading a depfile, convert relative dependencies to absolute paths before placing them in `compiler_depend.make`, which is later evaluated in the top-level build directory. Fixes: #22364 --- Source/cmDependsCompiler.cxx | 4 +++- Source/cmGccDepfileReader.cxx | 8 +++++--- Source/cmGccDepfileReader.h | 11 +++++++++-- 3 files changed, 17 insertions(+), 6 deletions(-) diff --git a/Source/cmDependsCompiler.cxx b/Source/cmDependsCompiler.cxx index 2b48df9..09f5599 100644 --- a/Source/cmDependsCompiler.cxx +++ b/Source/cmDependsCompiler.cxx @@ -131,7 +131,9 @@ bool cmDependsCompiler::CheckDependencies( depends.emplace_back(std::move(line)); } } else if (format == "gcc"_s) { - auto deps = cmReadGccDepfile(depFile.c_str()); + auto deps = cmReadGccDepfile( + depFile.c_str(), this->LocalGenerator->GetCurrentBinaryDirectory(), + GccDepfilePrependPaths::Deps); if (!deps) { continue; } diff --git a/Source/cmGccDepfileReader.cxx b/Source/cmGccDepfileReader.cxx index 6436baa..d30dbc3 100644 --- a/Source/cmGccDepfileReader.cxx +++ b/Source/cmGccDepfileReader.cxx @@ -12,8 +12,9 @@ #include "cmStringAlgorithms.h" #include "cmSystemTools.h" -cm::optional cmReadGccDepfile(const char* filePath, - const std::string& prefix) +cm::optional cmReadGccDepfile( + const char* filePath, const std::string& prefix, + GccDepfilePrependPaths prependPaths) { cmGccDepfileLexerHelper helper; if (!helper.readFile(filePath)) { @@ -23,7 +24,8 @@ cm::optional cmReadGccDepfile(const char* filePath, for (auto& dep : *deps) { for (auto& rule : dep.rules) { - if (!prefix.empty() && !cmSystemTools::FileIsFullPath(rule)) { + if (prependPaths == GccDepfilePrependPaths::All && !prefix.empty() && + !cmSystemTools::FileIsFullPath(rule)) { rule = cmStrCat(prefix, '/', rule); } if (cmSystemTools::FileIsFullPath(rule)) { diff --git a/Source/cmGccDepfileReader.h b/Source/cmGccDepfileReader.h index c8a3748..2433492 100644 --- a/Source/cmGccDepfileReader.h +++ b/Source/cmGccDepfileReader.h @@ -8,8 +8,15 @@ #include "cmGccDepfileReaderTypes.h" +enum class GccDepfilePrependPaths +{ + All, + Deps, +}; + /* - * Read dependencies file and append prefix to all relative paths + * Read dependencies file and prepend prefix to all relative paths */ cm::optional cmReadGccDepfile( - const char* filePath, const std::string& prefix = {}); + const char* filePath, const std::string& prefix = {}, + GccDepfilePrependPaths prependPaths = GccDepfilePrependPaths::All); -- cgit v0.12