`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.
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()`.
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
Run the `clang-format.bash` script to update all our C and C++ code to a
new style defined by `.clang-format`, now with "east const" enforcement.
Use `clang-format` version 18.
* If you reached this commit for a line in `git blame`, re-run the blame
operation starting at the parent of this commit to see older history
for the content.
* See the parent commit for instructions to rebase a change across this
style transition commit.
Issue: #26123
This changes the way lines in CTestCostData.txt are parsed to allow for
spaces in the test name.
It does so by looking for space characters from the end; and once two
have been found, assumes everything from the beginning up to that
second-to-last-space is the test name.
Additionally, parsing the file should be much more efficient since there
is no string or vector heap allocation per line. The std::string used by
the parse function to convert the int and float should be within most
standard libraries' small string optimization.
Fixes: #26594
When profiling Qt builds on macos, about 2.2% of a `cmake` invocation
was spent reading from `/dev/urandom`. Use a (thread)local rng to
mitigate this cost, particularly in `cmGeneratedFileStreamBase::Open`.
Refactoring in commit 5ff0b4ed57 (cmCTestMultiProcessHandler:
Consolidate test readiness checks, 2023-10-20, v3.29.0-rc1~378^2~4)
accidentally broke `RESOURCE_LOCK`. Fix it and replace the previous
test with one that would have caught this.
Fixes: #25843
Under job server integration, added by commit 80fe56c481 (ctest: Add
support for running under a make job server on POSIX systems,
2023-11-15, v3.29.0-rc1~324^2), use a very high default so that
parallelism is effectively limited only by available job server tokens.
Otherwise, choose a default limit based on the number of processors.
Also allow passing `0` to specify unbounded parallelism.
Fixes: #25739
Once a test is ready to run, count it against the number of tests to
start in the current batch whether or not the test process actually
starts successfully. If a test process does fail to start, simply
schedule a new startup batch on the next loop iteration.
When a test finishes, defer starting new tests until the next loop
iteration. That way, if multiple tests finish in a single loop
iteration, we can free all of their resources first, and then start
a new batch of tests.
The `TestRunningMap` and `TestFinishMap` members have not been used
since commit 44017a4767 (CTest: handle dependent and non dependent test
requirements equally, 2013-10-17, v3.0.0-rc1~451^2~7).