Commit Graph

37125 Commits

Author SHA1 Message Date
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
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
Robert Maynard
ab0a44a0a0 find_package: Fix regression on <PackageName>_ROOT relative to CWD
In commit 9d44a77454 (find_*: Explicitly normalize found paths as they
exist on disk, 2024-10-17, v4.0.0-rc1~597^2~1), we removed path
normalization from the internal `cmSearchPath::AddPathInternal` helper.
Most call sites were updated to normalize input paths first, but search
paths derived from `<PackageName>_ROOT` CMake variables are no longer
normalized.  Instead we normalize the path to the file found after
searching.

When `find_package` "config" mode considers a candidate CMake package
configuration file, normalize its path before loading the adjacent
package version file so that the latter is loaded by absolute path.
Otherwise `cmMakefile::ReadDependentFile` interprets a relative path
with respect to the current source directory rather than the current
working directory.

Fixes: #27279
2025-10-02 15:24:47 -04:00
Brad King
d029b828b2 find_package: Avoid repeating search for lower-case .cps file 2025-10-02 15:24:47 -04:00
Brad King
21bc83344c Merge topic 'bootstrap-devirtualization' into release-4.0
ea04e19daf bootstrap: Fix compilation with gcc 16 devirtualization

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !11243
2025-09-25 08:58:51 -04:00
Brad King
ea04e19daf bootstrap: Fix compilation with gcc 16 devirtualization
Avoid including a header for a subclass whose implementation is not
compiled during bootstrap.

Fixes: #27256
2025-09-24 17:20:35 -04:00
Brad King
622044ce33 CMake 3.31.9 2025-09-24 13:24:34 -04:00
Brad King
edd51d646c CMake 4.0.4 2025-09-08 14:51:44 -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
Brad King
6de40e7a4d Ninja: Fix regression with .bat wrapper around ninja
Revise the change from commit 5a36d0c9e7 (Ninja: Fix regression with a
large number of subdirectories, 2025-03-04, v4.0.0-rc3~2^2) to use a
command-line length limit small enough for `.bat` files.

Fixes: #27153
2025-08-25 11:31:23 -04:00
Brad King
9dc3edbba8 ctest: Restore default test timeout for command-line -T Test step
In commit 774fcbe49c (CTest: Base command line mode on top of scripting
commands, 2024-10-05, v4.0.0-rc1~653^2) the implementation of this step
was converted to use `ctest_test` internally.  That command has its own
default test timeout of 600s if the ctest "TimeOut" configuration value
is not set.  If "TimeOut" is not set then default it to our previous
command-line mode default test timeout.

Fixes: #27139
2025-08-18 14:30:56 -04:00
Brad King
8745e6308e ctest: Restore default of no time limit for command-line -T Test step
Refactoring in commit 83845184db (cmCTest: Move timing functions from
cmCTestScriptHandler to cmCTest, 2024-10-23, v4.0.0-rc1~576^2) enabled a
time limit even if the undocumented `CTEST_TIME_LIMIT` script variable
is not set.
2025-08-18 14:10:15 -04:00
Brad King
2f2ccd53c6 Merge topic 'curl-8.15-deprecated-sectransp' into release-4.0
00c34a7d25 cmCurl: Suppress curl 8.15 deprecation warning for curl 8.[3-5] workaround

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !10971
2025-07-28 09:24:57 -04:00
Brad King
00c34a7d25 cmCurl: Suppress curl 8.15 deprecation warning for curl 8.[3-5] workaround
Curl 8.15 removed support for Secure Transport and deprecated the
corresponding `CURLSSLBACKEND_SECURETRANSPORT` constant.  We still need
the constant in a workaround for a runtime-checked range of older curl
versions.  Suppress the deprecation warning at compile time.

Fixes: #27086
2025-07-24 11:33:01 -04:00
Brad King
84cdf061e5 Merge topic 'ctest-fix-relative-paths' into release-4.0
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 10:57:56 -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
Brad King
bd31652e1b VS: Drop outdated usage text about appending platform to generator name
This was missed by commit 381c446ff7 (VS: Remove support for appending a
platform to the generator name, 2024-12-13, v4.0.0-rc1~156^2).

Issue: #26481
2025-06-24 14:23:58 -04:00
Brad King
79e82f371c CMake 4.0.3 2025-06-12 10:31:35 -04:00
Brad King
dbe9d4593f CMake 3.31.8 2025-06-12 09:51:05 -04:00
Martin Duffy
e01d12c14f instrumentation: Prevent unnecessary query loading
Don't load queries from instrumentation directories when GetIsInTryCompile
or before ClearGeneratedQueries from previous configures has run.
2025-06-09 11:33:24 -04:00
Martin Duffy
f26f127183 instrumentation: Reuse single cmsys::SystemInformation 2025-06-09 11:33:18 -04:00
Brad King
0883fac39a Merge topic 'clang-libstdcpp-3.31' into release-3.31
802f261d62 experimental/CXXModules: recycle the UUID
c88f3ea1e4 Clang/CXXImportStd: support `-stdlib=libstdc++`
ba5c9703b1 Experimental: recycle the `import std` UUID
9cad48c6cb gcc: support `import std`
acbada3df6 Tests/RunCMake: handle C++26 support where needed

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !10778
2025-05-14 15:31:47 -04:00
Ben Boeckel
342f4e195f Merge branch 'clang-libstdcpp-3.31' into clang-libstdcpp-3.31-4.0
* clang-libstdcpp-3.31-bp:
  experimental/CXXModules: recycle the UUID
  Clang/CXXImportStd: support `-stdlib=libstdc++`
2025-05-14 20:18:56 +02:00
Ben Boeckel
802f261d62 experimental/CXXModules: recycle the UUID
Now that `clang -stdlib=libstdc++` is supported.

(cherry picked from commit 52e2785018 (experimental/CXXModules: recycle
the UUID, 2025-04-30))
2025-05-14 20:15:57 +02:00
Ben Boeckel
ba5c9703b1 Experimental: recycle the import std UUID
Now that GCC is supported, update the feature UUID.

(cherry picked from commit 469175c2e6 (Experimental: recycle the `import
std` UUID, 2024-11-21))
2025-05-14 20:15:10 +02:00
Tom Stellard
b64548eedc KWSys: Backport "Fix GetNumberOfLogicalCPU on s390x" to CMake 3.31
The format of `/proc/cpuinfo` is different on `s390x` than other
architectures.

Issue: #26619
2025-05-09 09:14:14 -04:00
Brad King
a12ed97b5c CMake 4.0.2 2025-05-05 10:23:02 -04:00
Craig Scott
149ee3b4bc Xcode: Use DEBUGGER_WORKING_DIRECTORY as a fallback for scheme work dir
This also means when XCODE_SCHEME_WORKING_DIRECTORY is
set and a Xcode generator is used, that property will be used when
writing the debugger field in the file API replies.

Fixes: #26909
2025-05-03 10:16:15 -04:00
Brad King
e49dc061c2 Merge topic 'clang-macos-sdk' into release-4.0
bf1bb62e74 macOS: Restore support for LLVM/Clang without explicit CMAKE_OSX_SYSROOT

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !10734
2025-05-03 10:02:16 -04:00
Brad King
bf1bb62e74 macOS: Restore support for LLVM/Clang without explicit CMAKE_OSX_SYSROOT
In commit 7b19531291 (macOS: Do not pass any SDK/-isysroot to compilers
by default, 2024-11-06, v4.0.0-rc1~511^2) we broke support for using
upstream LLVM/Clang to build for macOS because the compiler has no
default sysroot.  Handle empty `CMAKE_OSX_SYSROOT` with LLVM/Clang by
falling back to the macOS SDK reported by `xcrun --show-sdk-path` .

Fixes: #26863
2025-05-02 13:49:40 -04:00
Brad King
edec9fbf57 Merge topic 'fix-find-performane-regression' into release-4.0
bb3a348def find_package: Fix performance regression in 4.0.0 release

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !10731
2025-05-01 15:50:24 -04:00
Matthew Woehlke
bb3a348def find_package: Fix performance regression in 4.0.0 release
In commit e90f60f864 (find_package: Don't glob certain macOS paths,
2024-10-23, v4.0.0-rc1~579^2~1) we changed the name matching logic of
`find_package` to check if a possible match is a directory before
checking whether the name is a match.  In some situations, this results
in unnecessarily calling `stat` for a very large number of files, which
can be extremely slow on some systems (especially Windows).  Fix this by
making the check the last thing we do before accepting a possible match.

Fixes: #26817
2025-05-01 14:48:33 -04:00
Matthew Woehlke
9081e73104 CPS: Fix mangling of relative requirement names
CPS names look like `[package]:component`, which needs to get mangled
into `package::component` to match CMake's convention. This was
implemented correctly for fully qualified component requirements, but
relative names were not being properly mangled. Adjust handling of
relative names to correctly translate from CPS to CMake convention.
2025-04-30 11:56:09 -04: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
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
cd4e72ca08 Normalize PWD environment variable before using it
In commit 5aed3ee49d (cmSystemTools: Add GetLogicalWorkingDirectory,
2024-10-28, v4.0.0-rc1~528^2~6) we incorrectly trusted `PWD` to be a
normalized path so long as its realpath matches the current working
directory.

Fixes: #26870
2025-04-15 09:37:08 -04:00
Marc Chevrier
2e9648e0de Ninja generator: restore correct encoding for policy CMP0181=OLD
Fixes: #26857
2025-04-12 16:37:57 +02:00
Brad King
ee515b2aa8 CMake 4.0.1 2025-04-10 10:58:22 -04:00
Brad King
7b16db932a CMake 3.31.7 2025-04-10 09:13:20 -04:00
Brad King
d736dafa22 Merge branch 'backport-3.31-apple-CoreFoundation-headers' 2025-04-08 11:39:10 -04:00
Sergey Fedorov
42390e7aa2 Source: Include specific CoreFoundation headers instead of umbrella header
Some CoreFoundation headers included by the umbrella header, which we do
not need, use syntax that GCC does not support.  Avoid including them.

GCC-Issue: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115880
2025-04-08 11:38:24 -04:00
Brad King
14ffd1cc4e cmXCodeObject: Drop unused CoreFoundation header
It has not been needed since commit d250b67722 (cmGlobalXCodeGenerator:
Adopt pbxproj object id generation, 2021-01-06, v3.19.3~4^2~2).
2025-04-08 11:38:23 -04:00
Brad King
f21682cf1a Merge topic 'normalize-input-paths' into release-4.0
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:45 -04:00
Brad King
5805461074 cmSystemTools: Simplify call to FindProgram for our own executable
Remove the unnecessary `FindProgramPath` wrapper.  Call the KWSys
`FindProgram` directly, without our CMake-specific wrapper, since
we follow-up with a `ToNormalizedPathOnDisk` anyway.
2025-04-07 19:57:07 -04:00
Brad King
db0e2574cb cmSystemTools: Restore FindProgram look-up of on-disk case on Windows
KWSys's `FindProgram` no longer looks up the actual case on disk.  This
behavior change was inherited from the change to `CollapseFullPath`.
Extend commit 773b75e4ed (cmake: Explicitly look up on-disk case of
input paths on Windows, 2024-10-23, v4.0.0-rc1~589^2) to cover this by
wrapping `FindProgram` in a CMake-specific layer.

Issue: #20214
2025-04-07 19:57:07 -04:00
Brad King
5d700abda4 Source: Simplify FindProgram calls
Remove defaulted arguments.  Remove unnecessary `.c_str()`.
2025-04-07 19:55:30 -04:00