diff options
10 files changed, 20 insertions, 312 deletions
diff --git a/meta/lib/oeqa/sdkext/files/myapp_cmake/CMakeLists.txt b/meta/lib/oeqa/sdkext/files/myapp_cmake/CMakeLists.txt index 19d773dd63..b31f1622e2 100644 --- a/meta/lib/oeqa/sdkext/files/myapp_cmake/CMakeLists.txt +++ b/meta/lib/oeqa/sdkext/files/myapp_cmake/CMakeLists.txt | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | cmake_minimum_required (VERSION 2.6) | 1 | cmake_minimum_required (VERSION 3.10) |
| 2 | project (myapp) | 2 | project (myapp) |
| 3 | # The version number. | 3 | # The version number. |
| 4 | set (myapp_VERSION_MAJOR 1) | 4 | set (myapp_VERSION_MAJOR 1) |
diff --git a/meta/lib/oeqa/selftest/cases/devtool.py b/meta/lib/oeqa/selftest/cases/devtool.py index d5715b328b..580c567be3 100644 --- a/meta/lib/oeqa/selftest/cases/devtool.py +++ b/meta/lib/oeqa/selftest/cases/devtool.py | |||
| @@ -406,7 +406,7 @@ class DevtoolAddTests(DevtoolBase): | |||
| 406 | test_file_dir_full = os.path.join(test_file_package_root, test_file_dir) | 406 | test_file_dir_full = os.path.join(test_file_package_root, test_file_dir) |
| 407 | bb.utils.mkdirhier(test_file_dir_full) | 407 | bb.utils.mkdirhier(test_file_dir_full) |
| 408 | with open(os.path.join(test_file_dir_full, test_file_name), "w") as f: | 408 | with open(os.path.join(test_file_dir_full, test_file_name), "w") as f: |
| 409 | f.write(test_file_content) | 409 | f.write(test_file_content) |
| 410 | bin_package_path = os.path.join(tempdir, "%s.tar.gz" % pn) | 410 | bin_package_path = os.path.join(tempdir, "%s.tar.gz" % pn) |
| 411 | runCmd("tar czf %s -C %s ." % (bin_package_path, test_file_package_root)) | 411 | runCmd("tar czf %s -C %s ." % (bin_package_path, test_file_package_root)) |
| 412 | 412 | ||
| @@ -509,7 +509,13 @@ class DevtoolAddTests(DevtoolBase): | |||
| 509 | # normally cover, which triggers the installed-vs-shipped QA test we have | 509 | # normally cover, which triggers the installed-vs-shipped QA test we have |
| 510 | # within do_package | 510 | # within do_package |
| 511 | recipefile = '%s/recipes/libftdi/libftdi_%s.bb' % (self.workspacedir, version) | 511 | recipefile = '%s/recipes/libftdi/libftdi_%s.bb' % (self.workspacedir, version) |
| 512 | result = runCmd('recipetool setvar %s EXTRA_OECMAKE -- \'-DPYTHON_BINDINGS=OFF -DLIBFTDI_CMAKE_CONFIG_DIR=${datadir}/cmake/Modules\'' % recipefile) | 512 | # There is no upstream release that supports building with CMake 4+ yet, so we explicitly |
| 513 | # set the policy minimum version via EXTRA_OECMAKE. That's easier than applying backported | ||
| 514 | # patches. | ||
| 515 | result = runCmd( | ||
| 516 | "recipetool setvar %s EXTRA_OECMAKE -- '-DCMAKE_POLICY_VERSION_MINIMUM=3.5 -DPYTHON_BINDINGS=OFF -DLIBFTDI_CMAKE_CONFIG_DIR=${datadir}/cmake/Modules'" | ||
| 517 | % recipefile | ||
| 518 | ) | ||
| 513 | with open(recipefile, 'a') as f: | 519 | with open(recipefile, 'a') as f: |
| 514 | f.write('\nFILES:${PN}-dev += "${datadir}/cmake/Modules"\n') | 520 | f.write('\nFILES:${PN}-dev += "${datadir}/cmake/Modules"\n') |
| 515 | # We don't have the ability to pick up this dependency automatically yet... | 521 | # We don't have the ability to pick up this dependency automatically yet... |
diff --git a/meta/recipes-devtools/cmake/cmake-native_3.31.6.bb b/meta/recipes-devtools/cmake/cmake-native_4.0.3.bb index b940abb3fd..7b90bff52f 100644 --- a/meta/recipes-devtools/cmake/cmake-native_3.31.6.bb +++ b/meta/recipes-devtools/cmake/cmake-native_4.0.3.bb | |||
| @@ -5,8 +5,8 @@ DEPENDS += "bzip2-replacement-native xz-native zlib-native ncurses-native zstd-n | |||
| 5 | 5 | ||
| 6 | SRC_URI += "file://OEToolchainConfig.cmake \ | 6 | SRC_URI += "file://OEToolchainConfig.cmake \ |
| 7 | file://environment.d-cmake.sh \ | 7 | file://environment.d-cmake.sh \ |
| 8 | file://0005-Disable-use-of-ext2fs-ext2_fs.h-by-cmake-s-internal-.patch \ | 8 | file://0001-Disable-use-of-ext2fs-ext2_fs.h-by-cmake-s-internal.patch \ |
| 9 | file://0001-CMakeLists.txt-disable-USE_NGHTTP2.patch \ | 9 | file://0002-CMakeLists.txt-disable-USE_NGHTTP2.patch \ |
| 10 | " | 10 | " |
| 11 | 11 | ||
| 12 | LICENSE:append = " & BSD-1-Clause & MIT & BSD-2-Clause & curl" | 12 | LICENSE:append = " & BSD-1-Clause & MIT & BSD-2-Clause & curl" |
| @@ -16,7 +16,7 @@ LIC_FILES_CHKSUM:append = " \ | |||
| 16 | file://Utilities/cmexpat/COPYING;md5=7b3b078238d0901d3b339289117cb7fb \ | 16 | file://Utilities/cmexpat/COPYING;md5=7b3b078238d0901d3b339289117cb7fb \ |
| 17 | file://Utilities/cmlibrhash/COPYING;md5=a8c2a557a5c53b1c12cddbee98c099af \ | 17 | file://Utilities/cmlibrhash/COPYING;md5=a8c2a557a5c53b1c12cddbee98c099af \ |
| 18 | file://Utilities/cmlibuv/LICENSE;md5=ad93ca1fffe931537fcf64f6fcce084d \ | 18 | file://Utilities/cmlibuv/LICENSE;md5=ad93ca1fffe931537fcf64f6fcce084d \ |
| 19 | file://Utilities/cmcurl/COPYING;md5=eed2e5088e1ac619c9a1c747da291d75 \ | 19 | file://Utilities/cmcurl/COPYING;md5=72f4e9890e99e68d77b7e40703d789b8 \ |
| 20 | " | 20 | " |
| 21 | 21 | ||
| 22 | B = "${WORKDIR}/build" | 22 | B = "${WORKDIR}/build" |
diff --git a/meta/recipes-devtools/cmake/cmake.inc b/meta/recipes-devtools/cmake/cmake.inc index 9b1898f22f..a15dfd3bb4 100644 --- a/meta/recipes-devtools/cmake/cmake.inc +++ b/meta/recipes-devtools/cmake/cmake.inc | |||
| @@ -10,18 +10,16 @@ HOMEPAGE = "http://www.cmake.org/" | |||
| 10 | BUGTRACKER = "http://public.kitware.com/Bug/my_view_page.php" | 10 | BUGTRACKER = "http://public.kitware.com/Bug/my_view_page.php" |
| 11 | SECTION = "console/utils" | 11 | SECTION = "console/utils" |
| 12 | LICENSE = "BSD-3-Clause" | 12 | LICENSE = "BSD-3-Clause" |
| 13 | LIC_FILES_CHKSUM = "file://Copyright.txt;md5=718f05155941b33862726348d3cd46ce \ | 13 | LIC_FILES_CHKSUM = "file://LICENSE.rst;md5=0cafc0f3b6b28f3d5ecb5d1a68c36471 \ |
| 14 | file://Source/cmake.h;beginline=1;endline=2;md5=a5f70e1fef8614734eae0d62b4f5891b \ | 14 | file://Source/cmake.h;beginline=1;endline=2;md5=4ba59ac0e953e1a713eea8c55b1d531b \ |
| 15 | " | 15 | " |
| 16 | 16 | ||
| 17 | CMAKE_MAJOR_VERSION = "${@'.'.join(d.getVar('PV').split('.')[0:2])}" | 17 | CMAKE_MAJOR_VERSION = "${@'.'.join(d.getVar('PV').split('.')[0:2])}" |
| 18 | 18 | ||
| 19 | SRC_URI = "https://cmake.org/files/v${CMAKE_MAJOR_VERSION}/cmake-${PV}.tar.gz \ | 19 | SRC_URI = "https://cmake.org/files/v${CMAKE_MAJOR_VERSION}/cmake-${PV}.tar.gz \ |
| 20 | file://0001-CMakeDetermineCompilerABI-Strip-pipe-from-compile-fl.patch \ | ||
| 21 | file://0001-cmCurl-Avoid-using-undocumented-type-for-CURLOPT_NET.patch \ | ||
| 22 | " | 20 | " |
| 23 | 21 | ||
| 24 | SRC_URI[sha256sum] = "653427f0f5014750aafff22727fb2aa60c6c732ca91808cfb78ce22ddd9e55f0" | 22 | SRC_URI[sha256sum] = "8d3537b7b7732660ea247398f166be892fe6131d63cc291944b45b91279f3ffb" |
| 25 | 23 | ||
| 26 | UPSTREAM_CHECK_REGEX = "cmake-(?P<pver>\d+(\.\d+)+)\.tar" | 24 | UPSTREAM_CHECK_REGEX = "cmake-(?P<pver>\d+(\.\d+)+)\.tar" |
| 27 | 25 | ||
diff --git a/meta/recipes-devtools/cmake/cmake/0001-CMakeDetermineCompilerABI-Strip-pipe-from-compile-fl.patch b/meta/recipes-devtools/cmake/cmake/0001-CMakeDetermineCompilerABI-Strip-pipe-from-compile-fl.patch deleted file mode 100644 index 3895c7e03b..0000000000 --- a/meta/recipes-devtools/cmake/cmake/0001-CMakeDetermineCompilerABI-Strip-pipe-from-compile-fl.patch +++ /dev/null | |||
| @@ -1,63 +0,0 @@ | |||
| 1 | From e4061151ac13bc727512d961a80faca3ceb22b5a Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Philip Lorenz <philip.lorenz@bmw.de> | ||
| 3 | Date: Mon, 3 Jun 2024 13:19:24 +0200 | ||
| 4 | Subject: [PATCH] CMakeDetermineCompilerABI: Strip -pipe from compile flags | ||
| 5 | |||
| 6 | When `-pipe` is enabled, GCC passes data between its different | ||
| 7 | executables using pipes instead of temporary files. This leads to issues | ||
| 8 | when cmake attempts to infer compiler internals via the `-v` parameter | ||
| 9 | as each executable will print to `stderr` in parallel. | ||
| 10 | |||
| 11 | For example we have observed the following outputs in our builds which | ||
| 12 | sporadically lead to build failures as system include directories were | ||
| 13 | not detected reliably: | ||
| 14 | |||
| 15 | Parsed CXX implicit include dir info from above output: rv=done | ||
| 16 | found start of include info | ||
| 17 | found start of implicit include info | ||
| 18 | add: [.../usr/bin/x86_64-poky-linux/../../lib/x86_64-poky-linux/gcc/x86_64-poky-linux/11.4.0/include] | ||
| 19 | add: [.../usr/bin/x86_64-poky-linux/../../lib/x86_64-poky-linux/gcc/x86_64-poky-linux/11.4.0/include-fixed] | ||
| 20 | add: [.../usr/include/c++/11.4.0] | ||
| 21 | add: [.../usr/include/c++/11.4.0/x86_64-poky-linux] | ||
| 22 | add: [.../usr/include/c++/11.4.0/backward] | ||
| 23 | add: [.../usr/lib/x86_64-poky-linux/11.4.0/include] | ||
| 24 | add: [...GNU assembler version 2.38 (x86_64-poky-linux) using BFD version (GNU Binutils) 2.38.20220708] | ||
| 25 | add: [/usr/include] | ||
| 26 | end of search list found | ||
| 27 | |||
| 28 | Fix this issue by stripping the `-pipe` parameter from the compilation | ||
| 29 | flag when determining the toolchain configuration. | ||
| 30 | |||
| 31 | Upstream-Status: Backport [3.32.0, 71be059f3f32b6791427893a48ba4815a19e2e78] | ||
| 32 | Signed-off-by: Philip Lorenz <philip.lorenz@bmw.de> | ||
| 33 | --- | ||
| 34 | Modules/CMakeDetermineCompilerABI.cmake | 9 ++++++++- | ||
| 35 | 1 file changed, 8 insertions(+), 1 deletion(-) | ||
| 36 | |||
| 37 | diff --git a/Modules/CMakeDetermineCompilerABI.cmake b/Modules/CMakeDetermineCompilerABI.cmake | ||
| 38 | index 4a75e25a..806f0b71 100644 | ||
| 39 | --- a/Modules/CMakeDetermineCompilerABI.cmake | ||
| 40 | +++ b/Modules/CMakeDetermineCompilerABI.cmake | ||
| 41 | @@ -52,14 +52,21 @@ function(CMAKE_DETERMINE_COMPILER_ABI lang src) | ||
| 42 | |||
| 43 | __TestCompiler_setTryCompileTargetType() | ||
| 44 | |||
| 45 | - # Avoid failing ABI detection on warnings. | ||
| 46 | + # Avoid failing ABI detection caused by non-functionally relevant | ||
| 47 | + # compiler arguments | ||
| 48 | if(CMAKE_TRY_COMPILE_CONFIGURATION) | ||
| 49 | string(TOUPPER "${CMAKE_TRY_COMPILE_CONFIGURATION}" _tc_config) | ||
| 50 | else() | ||
| 51 | set(_tc_config "DEBUG") | ||
| 52 | endif() | ||
| 53 | foreach(v CMAKE_${lang}_FLAGS CMAKE_${lang}_FLAGS_${_tc_config}) | ||
| 54 | + # Avoid failing ABI detection on warnings. | ||
| 55 | string(REGEX REPLACE "(^| )-Werror([= ][^-][^ ]*)?( |$)" " " ${v} "${${v}}") | ||
| 56 | + # Avoid passing of "-pipe" when determining the compiler internals. With | ||
| 57 | + # "-pipe" GCC will use pipes to pass data between the involved | ||
| 58 | + # executables. This may lead to issues when their stderr output (which | ||
| 59 | + # contains the relevant compiler internals) becomes interweaved. | ||
| 60 | + string(REGEX REPLACE "(^| )-pipe( |$)" " " ${v} "${${v}}") | ||
| 61 | endforeach() | ||
| 62 | |||
| 63 | # Save the current LC_ALL, LC_MESSAGES, and LANG environment variables | ||
diff --git a/meta/recipes-devtools/cmake/cmake/0005-Disable-use-of-ext2fs-ext2_fs.h-by-cmake-s-internal-.patch b/meta/recipes-devtools/cmake/cmake/0001-Disable-use-of-ext2fs-ext2_fs.h-by-cmake-s-internal.patch index 7559c52932..f31dce5644 100644 --- a/meta/recipes-devtools/cmake/cmake/0005-Disable-use-of-ext2fs-ext2_fs.h-by-cmake-s-internal-.patch +++ b/meta/recipes-devtools/cmake/cmake/0001-Disable-use-of-ext2fs-ext2_fs.h-by-cmake-s-internal.patch | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | From 8effa783e47e2b574be90733c38b27701e06e929 Mon Sep 17 00:00:00 2001 | 1 | From cf8210696ebbaff14612d845bc98fac447c0e6f5 Mon Sep 17 00:00:00 2001 |
| 2 | From: Otavio Salvador <otavio@ossystems.com.br> | 2 | From: Otavio Salvador <otavio@ossystems.com.br> |
| 3 | Date: Thu, 5 Jul 2018 10:28:04 -0300 | 3 | Date: Thu, 5 Jul 2018 10:28:04 -0300 |
| 4 | Subject: [PATCH] Disable use of ext2fs/ext2_fs.h by cmake's internal | 4 | Subject: [PATCH] Disable use of ext2fs/ext2_fs.h by cmake's internal |
| @@ -18,7 +18,7 @@ Signed-off-by: Otavio Salvador <otavio@ossystems.com.br> | |||
| 18 | 1 file changed, 2 insertions(+), 6 deletions(-) | 18 | 1 file changed, 2 insertions(+), 6 deletions(-) |
| 19 | 19 | ||
| 20 | diff --git a/Utilities/cmlibarchive/CMakeLists.txt b/Utilities/cmlibarchive/CMakeLists.txt | 20 | diff --git a/Utilities/cmlibarchive/CMakeLists.txt b/Utilities/cmlibarchive/CMakeLists.txt |
| 21 | index 4e4b49c1..50e9a733 100644 | 21 | index 04d986b6ea7d8dc0bd7e909d4e7b4e73c9e35437..014fe78063f7d30c9a4970b7cf3aeeaeb36bcdbc 100644 |
| 22 | --- a/Utilities/cmlibarchive/CMakeLists.txt | 22 | --- a/Utilities/cmlibarchive/CMakeLists.txt |
| 23 | +++ b/Utilities/cmlibarchive/CMakeLists.txt | 23 | +++ b/Utilities/cmlibarchive/CMakeLists.txt |
| 24 | @@ -745,12 +745,8 @@ LA_CHECK_INCLUDE_FILE("copyfile.h" HAVE_COPYFILE_H) | 24 | @@ -745,12 +745,8 @@ LA_CHECK_INCLUDE_FILE("copyfile.h" HAVE_COPYFILE_H) |
diff --git a/meta/recipes-devtools/cmake/cmake/0001-cmCurl-Avoid-using-undocumented-type-for-CURLOPT_NET.patch b/meta/recipes-devtools/cmake/cmake/0001-cmCurl-Avoid-using-undocumented-type-for-CURLOPT_NET.patch deleted file mode 100644 index c719c1fdfb..0000000000 --- a/meta/recipes-devtools/cmake/cmake/0001-cmCurl-Avoid-using-undocumented-type-for-CURLOPT_NET.patch +++ /dev/null | |||
| @@ -1,30 +0,0 @@ | |||
| 1 | From c608975f4490f67872926f2601e5c37f2e570307 Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Wang Mingyu <wangmy@fujitsu.com> | ||
| 3 | Date: Wed, 9 Apr 2025 01:40:46 +0000 | ||
| 4 | Subject: [PATCH] cmCurl: Avoid using undocumented type for CURLOPT_NETRC | ||
| 5 | values | ||
| 6 | |||
| 7 | Fix: nativesdk-cmake/3.31.6/cmake-3.31.6/Source/cmCurl.cxx:178:26: error: invalid conversion from 'long int' to 'CURL_NETRC_OPTION' [-fpermissive] | ||
| 8 | Upstream-Status: Backport [https://gitlab.kitware.com/cmake/cmake/-/merge_requests/10449/diffs?commit_id=1b0c92a3a1b782ff3e1c4499b6ab8db614d45bcd] | ||
| 9 | |||
| 10 | Signed-off-by: Wang Mingyu <wangmy@fujitsu.com> | ||
| 11 | --- | ||
| 12 | Source/cmCurl.cxx | 2 +- | ||
| 13 | 1 file changed, 1 insertion(+), 1 deletion(-) | ||
| 14 | |||
| 15 | diff --git a/Source/cmCurl.cxx b/Source/cmCurl.cxx | ||
| 16 | index b9133ed7..0cf8a71a 100644 | ||
| 17 | --- a/Source/cmCurl.cxx | ||
| 18 | +++ b/Source/cmCurl.cxx | ||
| 19 | @@ -170,7 +170,7 @@ std::string cmCurlSetNETRCOption(::CURL* curl, const std::string& netrc_level, | ||
| 20 | const std::string& netrc_file) | ||
| 21 | { | ||
| 22 | std::string e; | ||
| 23 | - CURL_NETRC_OPTION curl_netrc_level = CURL_NETRC_LAST; | ||
| 24 | + long curl_netrc_level = CURL_NETRC_LAST; | ||
| 25 | ::CURLcode res; | ||
| 26 | |||
| 27 | if (!netrc_level.empty()) { | ||
| 28 | -- | ||
| 29 | 2.43.0 | ||
| 30 | |||
diff --git a/meta/recipes-devtools/cmake/cmake/0001-ctest-Allow-arbitrary-characters-in-test-names-of-CT.patch b/meta/recipes-devtools/cmake/cmake/0001-ctest-Allow-arbitrary-characters-in-test-names-of-CT.patch deleted file mode 100644 index 31f6148cac..0000000000 --- a/meta/recipes-devtools/cmake/cmake/0001-ctest-Allow-arbitrary-characters-in-test-names-of-CT.patch +++ /dev/null | |||
| @@ -1,202 +0,0 @@ | |||
| 1 | From c7e8b03324883760a2d6fab86ae034beb82af651 Mon Sep 17 00:00:00 2001 | ||
| 2 | From: John Drouhard <john@drouhard.dev> | ||
| 3 | Date: Thu, 9 Jan 2025 20:34:42 -0600 | ||
| 4 | Subject: [PATCH] ctest: Allow arbitrary characters in test names of | ||
| 5 | CTestCostData.txt | ||
| 6 | |||
| 7 | This changes the way lines in CTestCostData.txt are parsed to allow for | ||
| 8 | spaces in the test name. | ||
| 9 | |||
| 10 | It does so by looking for space characters from the end; and once two | ||
| 11 | have been found, assumes everything from the beginning up to that | ||
| 12 | second-to-last-space is the test name. | ||
| 13 | |||
| 14 | Additionally, parsing the file should be much more efficient since there | ||
| 15 | is no string or vector heap allocation per line. The std::string used by | ||
| 16 | the parse function to convert the int and float should be within most | ||
| 17 | standard libraries' small string optimization. | ||
| 18 | |||
| 19 | Fixes: #26594 | ||
| 20 | |||
| 21 | Upstream-Status: Backport [4.0.0, 040da7d83216ace59710407e8ce35d5fd38e1340] | ||
| 22 | Signed-off-by: Moritz Haase <Moritz.Haase@bmw.de> | ||
| 23 | --- | ||
| 24 | Source/CTest/cmCTestMultiProcessHandler.cxx | 77 +++++++++++++++------ | ||
| 25 | Source/CTest/cmCTestMultiProcessHandler.h | 3 +- | ||
| 26 | Tests/CTestTestScheduler/CMakeLists.txt | 4 +- | ||
| 27 | 3 files changed, 61 insertions(+), 23 deletions(-) | ||
| 28 | |||
| 29 | diff --git a/Source/CTest/cmCTestMultiProcessHandler.cxx b/Source/CTest/cmCTestMultiProcessHandler.cxx | ||
| 30 | index 84ea32b84d40025ec333a90d30c42eeaf7adc9ef..231e7b5f39b1d8aa75f4e59a890a099b53fcdaac 100644 | ||
| 31 | --- a/Source/CTest/cmCTestMultiProcessHandler.cxx | ||
| 32 | +++ b/Source/CTest/cmCTestMultiProcessHandler.cxx | ||
| 33 | @@ -20,6 +20,7 @@ | ||
| 34 | |||
| 35 | #include <cm/memory> | ||
| 36 | #include <cm/optional> | ||
| 37 | +#include <cm/string_view> | ||
| 38 | #include <cmext/algorithm> | ||
| 39 | |||
| 40 | #include <cm3p/json/value.h> | ||
| 41 | @@ -52,6 +53,48 @@ constexpr unsigned long kParallelLevelMinimum = 2u; | ||
| 42 | // Under a job server, parallelism is effectively limited | ||
| 43 | // only by available job server tokens. | ||
| 44 | constexpr unsigned long kParallelLevelUnbounded = 0x10000u; | ||
| 45 | + | ||
| 46 | +struct CostEntry | ||
| 47 | +{ | ||
| 48 | + cm::string_view name; | ||
| 49 | + int prevRuns; | ||
| 50 | + float cost; | ||
| 51 | +}; | ||
| 52 | + | ||
| 53 | +cm::optional<CostEntry> splitCostLine(cm::string_view line) | ||
| 54 | +{ | ||
| 55 | + std::string part; | ||
| 56 | + cm::string_view::size_type pos1 = line.size(); | ||
| 57 | + cm::string_view::size_type pos2 = line.find_last_of(' ', pos1); | ||
| 58 | + auto findNext = [line, &part, &pos1, &pos2]() -> bool { | ||
| 59 | + if (pos2 != cm::string_view::npos) { | ||
| 60 | + cm::string_view sub = line.substr(pos2 + 1, pos1 - pos2 - 1); | ||
| 61 | + part.assign(sub.begin(), sub.end()); | ||
| 62 | + pos1 = pos2; | ||
| 63 | + if (pos1 > 0) { | ||
| 64 | + pos2 = line.find_last_of(' ', pos1 - 1); | ||
| 65 | + } | ||
| 66 | + return true; | ||
| 67 | + } | ||
| 68 | + return false; | ||
| 69 | + }; | ||
| 70 | + | ||
| 71 | + // parse the cost | ||
| 72 | + if (!findNext()) { | ||
| 73 | + return cm::nullopt; | ||
| 74 | + } | ||
| 75 | + float cost = static_cast<float>(atof(part.c_str())); | ||
| 76 | + | ||
| 77 | + // parse the previous runs | ||
| 78 | + if (!findNext()) { | ||
| 79 | + return cm::nullopt; | ||
| 80 | + } | ||
| 81 | + int prev = atoi(part.c_str()); | ||
| 82 | + | ||
| 83 | + // from start to the last found space is the name | ||
| 84 | + return CostEntry{ line.substr(0, pos1), prev, cost }; | ||
| 85 | +} | ||
| 86 | + | ||
| 87 | } | ||
| 88 | |||
| 89 | namespace cmsys { | ||
| 90 | @@ -797,24 +840,21 @@ void cmCTestMultiProcessHandler::UpdateCostData() | ||
| 91 | if (line == "---") { | ||
| 92 | break; | ||
| 93 | } | ||
| 94 | - std::vector<std::string> parts = cmSystemTools::SplitString(line, ' '); | ||
| 95 | // Format: <name> <previous_runs> <avg_cost> | ||
| 96 | - if (parts.size() < 3) { | ||
| 97 | + cm::optional<CostEntry> entry = splitCostLine(line); | ||
| 98 | + if (!entry) { | ||
| 99 | break; | ||
| 100 | } | ||
| 101 | |||
| 102 | - std::string name = parts[0]; | ||
| 103 | - int prev = atoi(parts[1].c_str()); | ||
| 104 | - float cost = static_cast<float>(atof(parts[2].c_str())); | ||
| 105 | - | ||
| 106 | - int index = this->SearchByName(name); | ||
| 107 | + int index = this->SearchByName(entry->name); | ||
| 108 | if (index == -1) { | ||
| 109 | // This test is not in memory. We just rewrite the entry | ||
| 110 | - fout << name << " " << prev << " " << cost << "\n"; | ||
| 111 | + fout << entry->name << " " << entry->prevRuns << " " << entry->cost | ||
| 112 | + << "\n"; | ||
| 113 | } else { | ||
| 114 | // Update with our new average cost | ||
| 115 | - fout << name << " " << this->Properties[index]->PreviousRuns << " " | ||
| 116 | - << this->Properties[index]->Cost << "\n"; | ||
| 117 | + fout << entry->name << " " << this->Properties[index]->PreviousRuns | ||
| 118 | + << " " << this->Properties[index]->Cost << "\n"; | ||
| 119 | temp.erase(index); | ||
| 120 | } | ||
| 121 | } | ||
| 122 | @@ -850,28 +890,25 @@ void cmCTestMultiProcessHandler::ReadCostData() | ||
| 123 | break; | ||
| 124 | } | ||
| 125 | |||
| 126 | - std::vector<std::string> parts = cmSystemTools::SplitString(line, ' '); | ||
| 127 | + // Format: <name> <previous_runs> <avg_cost> | ||
| 128 | + cm::optional<CostEntry> entry = splitCostLine(line); | ||
| 129 | |||
| 130 | // Probably an older version of the file, will be fixed next run | ||
| 131 | - if (parts.size() < 3) { | ||
| 132 | + if (!entry) { | ||
| 133 | fin.close(); | ||
| 134 | return; | ||
| 135 | } | ||
| 136 | |||
| 137 | - std::string name = parts[0]; | ||
| 138 | - int prev = atoi(parts[1].c_str()); | ||
| 139 | - float cost = static_cast<float>(atof(parts[2].c_str())); | ||
| 140 | - | ||
| 141 | - int index = this->SearchByName(name); | ||
| 142 | + int index = this->SearchByName(entry->name); | ||
| 143 | if (index == -1) { | ||
| 144 | continue; | ||
| 145 | } | ||
| 146 | |||
| 147 | - this->Properties[index]->PreviousRuns = prev; | ||
| 148 | + this->Properties[index]->PreviousRuns = entry->prevRuns; | ||
| 149 | // When not running in parallel mode, don't use cost data | ||
| 150 | if (this->GetParallelLevel() > 1 && this->Properties[index] && | ||
| 151 | this->Properties[index]->Cost == 0) { | ||
| 152 | - this->Properties[index]->Cost = cost; | ||
| 153 | + this->Properties[index]->Cost = entry->cost; | ||
| 154 | } | ||
| 155 | } | ||
| 156 | // Next part of the file is the failed tests | ||
| 157 | @@ -884,7 +921,7 @@ void cmCTestMultiProcessHandler::ReadCostData() | ||
| 158 | } | ||
| 159 | } | ||
| 160 | |||
| 161 | -int cmCTestMultiProcessHandler::SearchByName(std::string const& name) | ||
| 162 | +int cmCTestMultiProcessHandler::SearchByName(cm::string_view name) | ||
| 163 | { | ||
| 164 | int index = -1; | ||
| 165 | |||
| 166 | diff --git a/Source/CTest/cmCTestMultiProcessHandler.h b/Source/CTest/cmCTestMultiProcessHandler.h | ||
| 167 | index fd6c17f2fac06949c20f3792dd3eae442b15850b..811be613c3387240c0181f8372b24cf09219621f 100644 | ||
| 168 | --- a/Source/CTest/cmCTestMultiProcessHandler.h | ||
| 169 | +++ b/Source/CTest/cmCTestMultiProcessHandler.h | ||
| 170 | @@ -13,6 +13,7 @@ | ||
| 171 | #include <vector> | ||
| 172 | |||
| 173 | #include <cm/optional> | ||
| 174 | +#include <cm/string_view> | ||
| 175 | |||
| 176 | #include "cmCTest.h" | ||
| 177 | #include "cmCTestResourceAllocator.h" | ||
| 178 | @@ -110,7 +111,7 @@ protected: | ||
| 179 | void UpdateCostData(); | ||
| 180 | void ReadCostData(); | ||
| 181 | // Return index of a test based on its name | ||
| 182 | - int SearchByName(std::string const& name); | ||
| 183 | + int SearchByName(cm::string_view name); | ||
| 184 | |||
| 185 | void CreateTestCostList(); | ||
| 186 | |||
| 187 | diff --git a/Tests/CTestTestScheduler/CMakeLists.txt b/Tests/CTestTestScheduler/CMakeLists.txt | ||
| 188 | index 6f8cb4dbc0de35984540e1868788e0a02124e819..daf6ce2b23d8c048334ae1047759130b246dccef 100644 | ||
| 189 | --- a/Tests/CTestTestScheduler/CMakeLists.txt | ||
| 190 | +++ b/Tests/CTestTestScheduler/CMakeLists.txt | ||
| 191 | @@ -1,9 +1,9 @@ | ||
| 192 | -cmake_minimum_required(VERSION 3.10) | ||
| 193 | +cmake_minimum_required(VERSION 3.19) | ||
| 194 | project (CTestTestScheduler) | ||
| 195 | include (CTest) | ||
| 196 | |||
| 197 | add_executable (Sleep sleep.c) | ||
| 198 | |||
| 199 | foreach (time RANGE 1 4) | ||
| 200 | - add_test (TestSleep${time} Sleep ${time}) | ||
| 201 | + add_test ("TestSleep ${time}" Sleep ${time}) | ||
| 202 | endforeach () | ||
diff --git a/meta/recipes-devtools/cmake/cmake/0001-CMakeLists.txt-disable-USE_NGHTTP2.patch b/meta/recipes-devtools/cmake/cmake/0002-CMakeLists.txt-disable-USE_NGHTTP2.patch index ab78fa26ba..158eea2c3e 100644 --- a/meta/recipes-devtools/cmake/cmake/0001-CMakeLists.txt-disable-USE_NGHTTP2.patch +++ b/meta/recipes-devtools/cmake/cmake/0002-CMakeLists.txt-disable-USE_NGHTTP2.patch | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | From 061253f390ada0661b30cf8856fa8d8d40a7355d Mon Sep 17 00:00:00 2001 | 1 | From e0a1996a85dcb43d69d3c7daecab4da74599e5ba Mon Sep 17 00:00:00 2001 |
| 2 | From: Changqing Li <changqing.li@windriver.com> | 2 | From: Changqing Li <changqing.li@windriver.com> |
| 3 | Date: Wed, 28 Dec 2022 17:51:27 +0800 | 3 | Date: Wed, 28 Dec 2022 17:51:27 +0800 |
| 4 | Subject: [PATCH] CMakeLists.txt: disable USE_NGHTTP2 | 4 | Subject: [PATCH] CMakeLists.txt: disable USE_NGHTTP2 |
| @@ -22,10 +22,10 @@ Signed-off-by: Trevor Gamblin <tgamblin@baylibre.com> | |||
| 22 | 1 file changed, 1 insertion(+), 1 deletion(-) | 22 | 1 file changed, 1 insertion(+), 1 deletion(-) |
| 23 | 23 | ||
| 24 | diff --git a/Utilities/cmcurl/CMakeLists.txt b/Utilities/cmcurl/CMakeLists.txt | 24 | diff --git a/Utilities/cmcurl/CMakeLists.txt b/Utilities/cmcurl/CMakeLists.txt |
| 25 | index ef6c269e..ecaac497 100644 | 25 | index 75b510205984894ffa11461e7aa04d3c479709b4..83463042d82d9c7f17932753f47c47b12aeec85b 100644 |
| 26 | --- a/Utilities/cmcurl/CMakeLists.txt | 26 | --- a/Utilities/cmcurl/CMakeLists.txt |
| 27 | +++ b/Utilities/cmcurl/CMakeLists.txt | 27 | +++ b/Utilities/cmcurl/CMakeLists.txt |
| 28 | @@ -99,7 +99,7 @@ set(USE_ECH OFF) | 28 | @@ -105,7 +105,7 @@ set(USE_ECH OFF) |
| 29 | set(USE_HTTPSRR OFF) | 29 | set(USE_HTTPSRR OFF) |
| 30 | set(USE_LIBIDN2 ON) | 30 | set(USE_LIBIDN2 ON) |
| 31 | set(USE_LIBRTMP OFF) | 31 | set(USE_LIBRTMP OFF) |
diff --git a/meta/recipes-devtools/cmake/cmake_3.31.6.bb b/meta/recipes-devtools/cmake/cmake_4.0.3.bb index 2d343d6f52..7d8b8cac65 100644 --- a/meta/recipes-devtools/cmake/cmake_3.31.6.bb +++ b/meta/recipes-devtools/cmake/cmake_4.0.3.bb | |||
| @@ -5,7 +5,6 @@ inherit cmake bash-completion | |||
| 5 | DEPENDS += "curl expat zlib libarchive xz ncurses bzip2" | 5 | DEPENDS += "curl expat zlib libarchive xz ncurses bzip2" |
| 6 | 6 | ||
| 7 | SRC_URI:append:class-nativesdk = " \ | 7 | SRC_URI:append:class-nativesdk = " \ |
| 8 | file://0001-ctest-Allow-arbitrary-characters-in-test-names-of-CT.patch \ | ||
| 9 | file://OEToolchainConfig.cmake \ | 8 | file://OEToolchainConfig.cmake \ |
| 10 | file://SDKToolchainConfig.cmake.template \ | 9 | file://SDKToolchainConfig.cmake.template \ |
| 11 | file://cmake-setup.py \ | 10 | file://cmake-setup.py \ |
