Commit Graph

2036 Commits

Author SHA1 Message Date
Brad King
8832f78dd6 IWYU: Update for Debian 13 CI job
`include-what-you-use` diagnostics, in practice, are specific to
the environment's compiler and standard library.  Update includes
to satisfy IWYU for our CI job under Debian 13.  Some patterns:

* Types named in virtual `override` signatures no longer require
  includes since the overridden signature already names them.

* A function argument's type needs to be included even if its constructor
  is called only by implicit conversion.  For example, constructing a
  `std::function` from a lambda now requires `<functional>`.

* Some prior mysterious `<type_traits>` inclusions are no longer required.
2025-11-12 14:54:35 -05:00
Brad King
3529a96ba5 Merge topic 'process-timeout-terminate'
3dc641d99c Merge branch 'backport-3.31-process-timeout-terminate'
22e84c7e7f execute_process: Restore termination of processes on timeout
e2cfc61e5e execute_process: Restore termination of processes on timeout

Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: buildbot <buildbot@kitware.com>
Merge-request: !11408
2025-11-12 10:53:50 -05:00
Brad King
22e84c7e7f execute_process: Restore termination of processes on timeout
Since commit 5420639a8d (cmExecuteProcessCommand: Replace cmsysProcess
with cmUVProcessChain, 2023-06-01, v3.28.0-rc1~138^2~8) we have not
actually terminated child processes on an `execute_process` timeout.
Similarly for other migrations from cmsysProcess to cmUVProcessChain.

Teach cmUVProcessChain clients that implement timeouts to actually
terminate remaining child processes when the timeout is reached.

Fixes: #27378
2025-11-11 09:10:29 -05:00
Brad King
deb70f536e Merge topic 'cmake-init'
40b093649b cmake: Avoid calling GetCMakeListFile with empty directory
f6b3ba5f55 CMP0198: Maintain CMAKE_PARENT_LIST_FILE only when configuring projects
3593aa59ef cmake: Replace working mode with role
accfa7fa81 cmake: Infer command failure action from role
e290d4f2a3 cmake: Infer command set from role
bfaaec6179 cmake --workflow: Convert implementation to internal role
ea5d04975e cmake --build: Convert implementation to internal role
0b83750e14 cmake: Clarify name of role of internal instances
...

Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: buildbot <buildbot@kitware.com>
Merge-request: !11395
2025-11-10 09:13:42 -05:00
Brad King
06b3095df7 Merge topic 'process-timeout-short'
6ec2c51f0c execute_process: Restore support for short timeouts

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !11399
2025-11-10 09:08:41 -05:00
Brad King
1ec4e64227 Merge topic 'process-timeout-short' into release-4.0
6ec2c51f0c execute_process: Restore support for short timeouts

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !11399
2025-11-10 09:06:55 -05:00
Brad King
6ec2c51f0c execute_process: Restore support for short timeouts
Since commit 5420639a8d (cmExecuteProcessCommand: Replace cmsysProcess
with cmUVProcessChain, 2023-06-01, v3.28.0-rc1~138^2~8) we've
occasionally observed immediate timeouts on processes that take longer
than the timeout to start, even though we only start the timer after the
child processes start.  The problem is that:

* `uv_loop_init` initializes `uv_loop_t`'s cached "now" time.
* Starting processes takes time but does not update the "now" time.
* `uv_timer_start` computes expiry relative the cached "now" time,
  so short timers may be expired as soon as they are started.
* `uv_run` invokes expired timer callbacks before polling for I/O
  or process completion, so we "timeout" immediately.

Fix this by updating the cached "now" time via `uv_update_time` just
before starting timers.  This is needed only for timers that start
before the `uv_run` event loop.  Update our `uv_timer_ptr` wrapper
to make all callers consider the choice when calling `start()`.
2025-11-09 09:13:43 -05:00
Brad King
3593aa59ef cmake: Replace working mode with role 2025-11-07 09:35:55 -05:00
Brad King
accfa7fa81 cmake: Infer command failure action from role 2025-11-07 09:35:55 -05:00
Brad King
e290d4f2a3 cmake: Infer command set from role 2025-11-07 09:35:54 -05:00
Brad King
0b83750e14 cmake: Clarify name of role of internal instances
These instances do not run arbitrary cmake language code.
2025-11-07 09:35:54 -05:00
Brad King
0aab75bf0e cmake: Clarify name of enum backing CMAKE_ROLE property 2025-11-07 09:35:53 -05:00
Brad King
9e36f22684 cmake: Clarify name of enum identifying set of commands added 2025-11-07 09:35:53 -05:00
Brad King
4a2d32e7c4 cmake: Remove unnecessary initialization of empty source and build paths
The explicit initialization with empty paths from commit 57bdc1a2f7
(cmState: Compute and store directory components., 2015-05-04,
v3.3.0-rc1~61^2~4) has not been needed since commit 6afd35b98a (cmState:
remove unused code, 2016-06-16, v3.7.0-rc1~90^2).
2025-11-07 09:35:52 -05:00
Brad King
e12ce158bc clang-tidy: fix bugprone-unintended-char-ostream-output lint 2025-10-30 17:43:17 -04:00
Tyler Yankee
236207b81a instrumentation: Fix snippet result field
Give the actual exit code of the command from the snippet as intended;
currently, this always gives 0 for sub-commands like compile and link,
as well as `ctest`.

For now, the result in build snippets will be `null`.
2025-10-27 15:42:58 -04:00
Martin Duffy
97adbc91fa instrumentation: Move target data into content files
Create a single place to store target data to prevent duplication.
This moves `targetType` and `targetLabels` out of the snippet files
and into a target map in the `cmakeContent` file referenced by each
snippet.

Fixes: #27244
2025-10-02 09:28:20 -04:00
Brad King
c92268f91b Merge topic 'curl-opt-proxytype'
c8143074cf cmCTestCurl: Avoid using undocumented type for CURLOPT_PROXYTYPE values

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !11134
2025-09-03 10:13:32 -04:00
Brad King
2bc0c335ce Merge topic 'curl-opt-proxytype' into release-4.0
c8143074cf cmCTestCurl: Avoid using undocumented type for CURLOPT_PROXYTYPE values

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !11134
2025-09-03 10:12:21 -04:00
Brad King
c8143074cf cmCTestCurl: Avoid using undocumented type for CURLOPT_PROXYTYPE values
Since upstream curl commit `1a12663d06` (CURLOPT: bump `CURLPROXY_*`
enums to `long`, drop casts, 2025-07-28), the `CURLPROXY_*` constants
are integer literals instead of `enum curl_proxytype`.  It turns out
that `curl_easy_setopt` has always expected a `long` anyway, and that
`curl_proxytype` is not documented for public use.

Fixes: #27178
2025-09-02 11:41:10 -04:00
Eduard Voronkin
01147454e7 FASTBuild: Add generator
Fixes: #15294
2025-08-26 14:29:01 -07:00
Brad King
9c6e53e46f ctest: Remove stray newline in process result string
The plain "Exit code" string had a newline that we do not have in the
other result strings.  This typo was inherited from KWSys Process,
which has been fixed by its upstream.

Fixes: #27119
2025-08-08 08:19:38 -04:00
Daniel Pfeifer
b1fdab3cc1 source: Pass small and trivially copyable types by value 2025-08-01 09:56:00 -04:00
Daniel Pfeifer
964e992ec5 source: Pass cmCTestResourceAllocator::Resource by value 2025-07-30 11:55:34 -04:00
John Parent
c6763bb021 ctest: support a new --objects-dir argument
When shorter object directories are used, CTest needs to know where to
look for artifacts.
2025-07-28 12:01:28 -04:00
Brad King
0a385b880a Merge topic 'ctest-safe-build-id'
2aa2c9af97 ctest: Don't modify build and site names

Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: buildbot <buildbot@kitware.com>
Merge-request: !10911
2025-07-02 08:03:33 -04:00
Brad King
363cb28cfe Merge topic 'ctest-fix-relative-paths'
f98732bea8 ctest_configure: Restore handling of relative CTEST_BINARY_DIRECTORY
5a1d5fd9be ctest_start: Restore log file location for relative CTEST_BINARY_DIRECTORY

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !10912
2025-07-01 11:04:04 -04:00
Daniel Pfeifer
f98732bea8 ctest_configure: Restore handling of relative CTEST_BINARY_DIRECTORY
In commit e52eada2c2 (cmCTestConfigureCommand: Refactor command line
construction, 2025-01-28, v4.0.0-rc1~60^2~2) we switched from the
`BuildDirectory` setting, which was always an absolute path, to
`CTEST_BINARY_DIRECTORY`.  Convert it to an absolute path too.

Fixes: #27026
2025-06-30 11:06:14 -04:00
Daniel Pfeifer
5a1d5fd9be ctest_start: Restore log file location for relative CTEST_BINARY_DIRECTORY
Extend commit 3c321b6571 (cmCTestStartCommand: Inline
InitializeFromCommand function, 2024-10-17, v4.0.0-rc1~605^2~6) to
initialize BinaryDir as an absolute path.

Issue: #27026
2025-06-30 11:03:53 -04:00
Daniel Pfeifer
2aa2c9af97 ctest: Don't modify build and site names
CTest currently removes non-filename characters from CTEST_SITE and
CTEST_BUILDNAME in an inconsistent way, which leads to unconnected
information on CDash.  Non-filename characters actually don't cause
any issue in CDash at all, nor are they invalid XML.  The only place
where removing them may be needed is when an actual filename is
constructed.

Remove the filtering from the SafeBuildIdField function and place
it where a filename is constructed.
2025-06-28 11:39:42 +02:00
Brad King
afd6c2966e cmCTestSubmitHandler: Move internal helpers to anonymous namespace 2025-05-22 14:30:38 -04:00
Brad King
78f0b2aeed cmCTestSubmitHandler: Make internal method private 2025-05-22 14:30:38 -04:00
Brad King
2a9cfc2da3 cmCTestSubmitHandler: Remove unnecessary type alias 2025-05-22 14:30:37 -04:00
Brad King
8f698e1708 cmCTestSubmitHandler: Open log file earlier 2025-05-22 14:30:37 -04:00
Brad King
7475921ff8 cmCTestSubmitHandler: Inline and remove method called only once 2025-05-22 14:30:37 -04:00
Ben Boeckel
557c44b93e cmStrCat: use character literals where possible
Found and replaced using the `cmstrcat-to-char-literal` rule for
`ast-grep`.
2025-05-15 19:12:04 +02:00
Brad King
f70aed86f1 Merge topic 'macos-curl-backend' into release-4.0
1e1129c6fe macOS: Reliably apply workaround for system curl 8.{3,4,5} LibreSSL backend

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !10724
2025-04-30 09:39:48 -04:00
Brad King
fefb49bc80 Merge topic 'macos-curl-backend' into release-3.31
1e1129c6fe macOS: Reliably apply workaround for system curl 8.{3,4,5} LibreSSL backend

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !10724
2025-04-30 09:39:16 -04:00
Brad King
5d3f931956 Merge branch 'backport-macos-curl-backend' into macos-curl-backend 2025-04-29 11:50:17 -04:00
Gregor Jasny
1e1129c6fe macOS: Reliably apply workaround for system curl 8.{3,4,5} LibreSSL backend
In commit f2596dfa0e (macOS: Work around bug in system curl 8.{3,4,5}
LibreSSL backend, 2024-07-16, v3.30.1~2^2) we tried to prefer
`secure-transport` on problematic versions of curl.  However, the
`curl_global_sslset` setting must be applied before every
`curl_global_init` call, not just the first one.  Otherwise a
second (or subsequent) download won't apply the work-around.
2025-04-29 11:49:49 -04:00
Brad King
16455374cf Source: Suppress gcc 15 -Wmaybe-uninitialized in std::function
The warning is in the `std::function` implementation.
2025-04-24 07:56:39 -04:00
Brad King
b1c22bdc38 Source: Fix -Wformat warnings 2025-04-24 07:56:39 -04:00
Brad King
8a3860379d Merge topic 'normalize-input-paths'
5805461074 cmSystemTools: Simplify call to FindProgram for our own executable
db0e2574cb cmSystemTools: Restore FindProgram look-up of on-disk case on Windows
5d700abda4 Source: Simplify FindProgram calls

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !10620
2025-04-08 10:45:46 -04:00
Brad King
5d700abda4 Source: Simplify FindProgram calls
Remove defaulted arguments.  Remove unnecessary `.c_str()`.
2025-04-07 19:55:30 -04:00
Daniel Pfeifer
46a0c04284 CTest: Allow setting exit code in ctest scripts 2025-03-20 16:31:49 +01:00
Daniel Goldberg
d3455f38de ctest: Add option to specify the --schedule-random seed
When `--schedule-random` is used in automated CI jobs, failures may
occur due to test order.  We now log the seed.  Provide a way for
developers to re-run the same order by specifying the seed.

Fixes: #26760
Co-authored-by: Brad King <brad.king@kitware.com>
2025-03-18 14:17:59 -04:00
Daniel Goldberg
3dc8e59bdc ctest: Record --schedule-random seed in test log
Issue: #26760
Signed-off-by: Daniel Goldberg <daniel.goldberg@nextsilicon.com>
2025-03-18 13:45:41 -04:00
Brad King
2604f5d8b3 Merge topic 'json-errors-filename'
f134468a98 JSON: Improve JSON error message formatting

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !10463
2025-03-14 12:17:02 -04:00
Martin Duffy
f134468a98 JSON: Improve JSON error message formatting
This improves the output of JSON-related error messages. It adds the filename to
the output and excludes the column number.

This is particularly useful when there are multiple JSON files being read that
could be responsible for an error, ie CMakePresets.json and
CMakeUserPresets.json, or multiple instrumentation queries.

Issue: #26717
2025-03-13 10:44:31 -04:00
Daniel Pfeifer
e47dc29967 cmCTestStartCommand: Remove unnecessary code
We called `UpdateCTestConfiguration` but set an internal option
that made it a no-op.  Instead, just do not call it.
2025-03-06 09:43:22 -05:00