Commit Graph
39284 Commits
Author SHA1 Message Date
Brad King 7bc4ff7c8a Merge topic 'cpack-deb-dbgsym-md5sums'
1ef92d645d CPack/DEB: fix `md5sums` paths in dbgsym packages

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Sergey Tsatsulin <tsatsulin@gmail.com>
Merge-request: !11923
2026-04-14 09:52:13 -04:00
Brad King ebb680c87f Merge topic 'cmake-P-script-case'
1707e4e0ed Merge branch 'backport-4.2-cmake-P-script-case'
a2f1866d86 Merge branch 'backport-4.0-cmake-P-script-case'
a3358bb66a cmake: Restore normalization of `-P` script to on-disk path

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !11930
2026-04-14 09:24:40 -04:00
Brad King b412f9b654 Merge topic 'STRING-REGEX-MATCH-regression'
b24c60325a string(REGEX MATCH): Restore reporting of matches with semicolons

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !11921
2026-04-14 09:19:31 -04:00
Kitware Robot 5e4d01366e CMake Nightly Date Stamp 2026-04-14 00:05:23 -04:00
Brad King 1707e4e0ed Merge branch 'backport-4.2-cmake-P-script-case' 2026-04-13 14:27:21 -04:00
Brad King a2f1866d86 Merge branch 'backport-4.0-cmake-P-script-case' 2026-04-13 14:23:26 -04:00
Brad King a3358bb66a cmake: Restore normalization of -P script to on-disk path
This was missed in commit ee83165923 (cmake: Explicitly normalize
input paths as they exist on disk, 2024-10-17, v4.0.0-rc1~597^2),
causing `CMAKE_CURRENT_LIST_FILE` in `cmake -P` scripts to be
regressed by the KWSys behavior change merged by commit e9bd437a43
(Merge branch 'upstream-KWSys' into normalize-input-paths,
2024-10-24, v4.0.0-rc1~589^2~1).

Issue: #27750
2026-04-13 12:25:20 -04:00
Marc Chevrier b24c60325a string(REGEX MATCH): Restore reporting of matches with semicolons
This was broken by refactoring in commit dab5e6ebb1 (introduce
cm::CMakeString class as helper for string() command, 2025-10-06,
v4.3.0-rc1~510^2~2).

Fixes: #27749
2026-04-13 11:32:18 -04:00
Brad King e012f62599 Merge topic 'FILE_SET-INDEPENDENT_FILES'
bc7d8bd26f FILE_SET: Add INDEPENDENT_FILES property for Ninja order dependency control

Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: buildbot <buildbot@kitware.com>
Merge-request: !11904
2026-04-13 11:03:06 -04:00
Brad King 8cd4e1576c Merge topic 'instrumentation-index-lock'
0c2fcaec5d instrumentation: Avoid duplicate entries on concurrent indexing

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !11912
2026-04-13 10:55:40 -04:00
Kitware Robot 0ea36ddcf6 CMake Nightly Date Stamp 2026-04-13 00:07:22 -04:00
Marc Chevrier bc7d8bd26f FILE_SET: Add INDEPENDENT_FILES property for Ninja order dependency control
Fixes: #25370
2026-04-12 15:00:03 +02:00
Kitware Robot 28e765250f CMake Nightly Date Stamp 2026-04-12 00:04:48 -04:00
Alex Turbov 1ef92d645d CPack/DEB: fix md5sums paths in dbgsym packages
The Debian `lintian` tool reported the dbgsym package issue as
`md5sums-lists-nonexistent-file`.

The DEB generator writes `md5sums` entries by stripping a top-level prefix
from each packaged file path. That used `CPACK_TEMPORARY_DIRECTORY`, which
works for regular debs but not for dbgsym packages.

Dbgsym package files are collected from `GEN_DBGSYMDIR` and passed to
`DebGenerator` with `WorkDir` rooted there. Because the `md5sums` writer
stripped `TemporaryDir` instead, the prefix did not match and absolute
staging paths leaked into `md5sums`.

Strip `WorkDir` instead. That is the actual root of `PackageFiles` for both
regular deb and dbgsym package generation, so `md5sums` entries stay
relative in both cases.
2026-04-12 07:37:49 +04:00
Kitware Robot 87dd963851 CMake Nightly Date Stamp 2026-04-11 00:05:22 -04:00
Martin Duffy 0c2fcaec5d instrumentation: Avoid duplicate entries on concurrent indexing
When indexing occurs twice at exactly the same time, there was a possibility
for snippets to show up in more than one index file, and therefore to be
removed by one indexing process while another indexing process ran a user
callback which needed to read the file.

Add a file locking mechanism around indexing to prevent it from happening
concurrently within a project build tree.

Fixes: #27741
2026-04-10 14:06:38 -04:00
Brad King 62f28f88da Merge topic 'fix-debugger-pipe-bug'
194232e2bc debugger: handle read errors on POSIX pipe and test abrupt disconnect
3490eff6f5 debugger: fix infinite loop when debugger pipe is closed

Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: buildbot <buildbot@kitware.com>
Merge-request: !11910
2026-04-10 11:49:11 -04:00
Kitware Robot 0998705cda CMake Nightly Date Stamp 2026-04-10 00:05:42 -04:00
Christopher Wellons 194232e2bc debugger: handle read errors on POSIX pipe and test abrupt disconnect
The POSIX pipe read wrappers stored the return of ::read() into an
unsigned result, so a negative count (e.g. EBADF from a concurrent
close on another thread) became SIZE_MAX. ContentReader::buffer()
would then try to grow its deque by ~18 exabytes and crash with
either std::length_error (glibc) or a stack smash (libc++). Treat
any non-positive ::read() return as EOF/error, close the pipe, and
return 0 so the peer's SessionThread observes a clean empty payload.

cmDebuggerPipeClient is test-only infrastructure; production cmake
is always the pipe server. Production close() assumes sequential
access, which holds in normal use (the adapter destructor joins
SessionThread before closing the connection). The new abrupt-
disconnect test however needs to wake a sibling thread blocked in
read() on the same fd, which Linux ::close() does not do.

Add a ShutdownForTesting() method that calls shutdown(SHUT_RDWR)
without freeing the fd, so any concurrent blocking read wakes
with a clean zero-length return. On Windows, CloseHandle already
cancels pending overlapped I/O, so the helper just forwards to
close(). Use it from testProtocolWithPipesAbruptDisconnect in
place of close().
2026-04-09 13:20:45 -04:00
Christopher Wellons 3490eff6f5 debugger: fix infinite loop when debugger pipe is closed
When a DAP client closes the pipe (or crashes), getPayload() returns an
empty functor without triggering the onError handler, so SessionActive
is never set to false and the session thread spins in a tight loop at
100% CPU. Handle the empty-payload case with the same cleanup performed
by the onError and DisconnectRequest handlers.

testProtocolWithPipesAbruptDisconnect drives the DAP handshake and then
closes the client side of the pipe without sending a DisconnectRequest.
The test deliberately avoids ReportExitCode so that no concurrent write
triggers the dap::Session error handler and masks the busy-loop
condition; if the SessionThread spins on EOF, the adapter destructor
blocks in SessionThread.join() and the test fails on a 10-second
timeout.

Fixes: #27743
2026-04-09 10:56:14 -04:00
Kitware Robot 3b5342b305 CMake Nightly Date Stamp 2026-04-09 00:04:53 -04:00
Kitware Robot 45f4742cbf CMake Nightly Date Stamp 2026-04-08 00:04:59 -04:00
Brad King 3e3db36520 Merge topic 'cxxmodules-PRIVATE-scope-no-synthetic-target'
3e2765b354 c++modules: create synthetic targets only when needed

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !11900
2026-04-07 09:56:55 -04:00
Kitware Robot c24bdabbc1 CMake Nightly Date Stamp 2026-04-07 00:06:26 -04:00
Marc Chevrier 3e2765b354 c++modules: create synthetic targets only when needed
When the target has only private c++ modules, do not create a synthetic
target.
2026-04-06 16:52:18 -04:00
Kitware Robot 0f3163d6f0 CMake Nightly Date Stamp 2026-04-06 00:04:59 -04:00
Kitware Robot 9add46e2fb CMake Nightly Date Stamp 2026-04-05 00:04:53 -04:00
Brad King b73e1508ec Merge topic 'FILE_SET-CXX_SCAN_FOR_MODULES'
df0a2aca6d FILE_SET: Add CXX_SCAN_FOR_MODULES property for per-file-set scanning control

Acked-by: Kitware Robot <kwrobot@kitware.com>
Reviewed-by: Ben Boeckel <ben.boeckel@kitware.com>
Merge-request: !11890
2026-04-04 15:36:19 -04:00
Brad King 2aaf41f09b Merge topic 'ispc-target-suffix'
b53f020b47 ISPC: Fix object suffix for dotted target names

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !11894
2026-04-04 15:31:02 -04:00
Kitware Robot 3c7e587680 CMake Nightly Date Stamp 2026-04-04 00:04:42 -04:00
Philipp Kolberg b53f020b47 ISPC: Fix object suffix for dotted target names
ISPC target names containing dots, such as `avx10.2dmr-x16`, produce
output files with underscores in the ISA suffix (e.g. `_avx10_2dmr`).
The `ComputeISPCObjectSuffixes` function did not account for this,
causing a mismatch between the predicted and actual object file names.

Replace dots with underscores in the extracted target suffix to match
ISPC's `ISAToString()` behavior.  Also add mappings for `sse4.1`
and `sse4.2` target name variants, which ISPC both maps to `sse4`.
2026-04-03 09:37:58 -04:00
Brad King e58a23bd28 Merge topic 'cxxmodules-synthetic-file-set-unique'
b001bc735a c++modules: Avoid adding file to multiple file sets in synthetic targets

Acked-by: Kitware Robot <kwrobot@kitware.com>
Reviewed-by: Ben Boeckel <ben.boeckel@kitware.com>
Merge-request: !11888
2026-04-03 09:33:07 -04:00
Marc Chevrier df0a2aca6d FILE_SET: Add CXX_SCAN_FOR_MODULES property for per-file-set scanning control
This is more specific than both the target property and the
directory-wide source file property of the same name.
2026-04-03 09:29:29 -04:00
Kitware Robot 0ae58dfa7a CMake Nightly Date Stamp 2026-04-03 00:04:48 -04:00
Brad King e1c28e5011 Merge topic 'find_package-stack'
1b946dfbfe Merge branch 'backport-4.2-find_package-stack' into find_package-stack
e8ae3645db Merge branch 'backport-4.2-find_package-stack' into find_package-stack
aae02ee60a find_package: Share package information among copies of package stack
a789c21100 Merge branch 'backport-4.2-find_package-stack' into find_package-stack
9387988626 find_package: Save package information only after successfully loading it
561ece2407 cmFindPackageStack: Restore pure value semantics
e935ed22fb find_package: Share package information among copies of package stack
5aa649d5f6 find_package: Save package information only after successfully loading it
...

Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: buildbot <buildbot@kitware.com>
Merge-request: !11887
2026-04-02 13:23:54 -04:00
Marc Chevrier b001bc735a c++modules: Avoid adding file to multiple file sets in synthetic targets
The introduction of file set type `SOURCES` can raise error on a
duplicate file due to erroneous synthetic targets definition.
2026-04-02 11:32:52 -04:00
Kitware Robot f5fc584bff CMake Nightly Date Stamp 2026-04-02 00:05:10 -04:00
Brad King 1b946dfbfe Merge branch 'backport-4.2-find_package-stack' into find_package-stack 2026-04-01 13:54:11 -04:00
Brad King aae02ee60a find_package: Share package information among copies of package stack
Since commit ae373e93fb (install(PACKAGE_INFO): Add version and location
to package dependencies, 2025-07-31, v4.2.0-rc1~340^2) we add package
information to the current package's stack entry as it is discovered.
However, a nested package can cause the current package's stack entry to
be replaced by a copy with a new ordering index due to commit c6e6861e63
(install(EXPORT): Export find_dependency() calls, 2023-11-07,
v3.29.0-rc1~439^2~1).  Depending on whether imported targets were
created by the current package before finding the nested package, the
`CurrentPackageInfo` pointer is either invalidated, or left pointing at
only one of multiple copies.

Fix this by sharing a single instance of package information with all
copies of the current package's stack entry.  Keep a mutable pointer
to the current package's information only while it is still pending.
This also avoids the need to expose mutation from the package stack.

Add a test that exposes the previously-invalidated pointer to dynamic
analysis tools.

Fixes: #27730
2026-04-01 13:53:07 -04:00
Brad King a789c21100 Merge branch 'backport-4.2-find_package-stack' into find_package-stack 2026-04-01 13:52:04 -04:00
Brad King 9387988626 find_package: Save package information only after successfully loading it
If a package configuration file sets `<PackageName>_FOUND` to false,
the package is considered not found.  Do not save its package info.

Note that this exposes an existing pointer invalidation on nested
`find_package` calls, which will be fixed in following commits.

Issue: #27730
2026-04-01 13:51:11 -04:00
Brad King 561ece2407 cmFindPackageStack: Restore pure value semantics
A stack entry's storage may be shared by other copies, so mutation is
incompatible with value semantics.  We've migrated the motivating use
case to another approach.

Revert commit b3873b8272 (cmFindPackageStack: Allow controlled mutation,
2025-07-29, v4.2.0-rc1~438^2) and commit f2bdc2176f (cmStack: New,
mutable stack class, 2025-07-29, v4.2.0-rc1~438^2~1).  Record their
parent as a second parent of this commit so `git blame` can see the
original history of the restored content.
2026-04-01 13:47:24 -04:00
Brad King 5aa649d5f6 find_package: Save package information only after successfully loading it
If a package configuration file sets `<PackageName>_FOUND` to false,
the package is considered not found.  Do not save its package info.

Note that this exposes an existing pointer invalidation on nested
`find_package` calls, which will be fixed in following commits.

Issue: #27730
2026-04-01 13:47:01 -04:00
Brad King e935ed22fb find_package: Share package information among copies of package stack
Since commit ae373e93fb (install(PACKAGE_INFO): Add version and location
to package dependencies, 2025-07-31, v4.2.0-rc1~340^2) we add package
information to the current package's stack entry as it is discovered.
However, a nested package can cause the current package's stack entry to
be replaced by a copy with a new ordering index due to commit c6e6861e63
(install(EXPORT): Export find_dependency() calls, 2023-11-07,
v3.29.0-rc1~439^2~1).  Depending on whether imported targets were
created by the current package before finding the nested package, the
`CurrentPackageInfo` pointer is either invalidated, or left pointing at
only one of multiple copies.

Fix this by sharing a single instance of package information with all
copies of the current package's stack entry.  Keep a mutable pointer
to the current package's information only while it is still pending.
This also avoids the need to expose mutation from the package stack.

Add a test that exposes the previously-invalidated pointer to dynamic
analysis tools.

Fixes: #27730
2026-04-01 13:47:01 -04:00
Brad King 2b22c2a45f find_package: Clarify dependency ordering logic in package stack
Clarify package stack manipulation from commit c6e6861e63
(install(EXPORT): Export find_dependency() calls, 2023-11-07,
v3.29.0-rc1~439^2~1).

Issue: #27730
2026-04-01 13:47:01 -04:00
Brad King 5e57306864 Merge topic 'FILE_SET-SOURCES'
c386aaebf8 FILE_SET: install and export SOURCES file set type
5c5b68f44e FILE_SET: Add support for the SOURCES type
5697bcced0 BT<> and cmLocalGenerator: Add helpers functions
42ca2a2062 cmEvaluatedTargetProperty: put declarations in namespace cm

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !11863
2026-04-01 13:39:12 -04:00
Kitware Robot bad6831d5a CMake Nightly Date Stamp 2026-04-01 00:05:03 -04:00
Brad King ed6b21f478 Merge topic 'cm-ct-preset-args'
2b924b885c cmCTest: Use consistent command-line parsing for presets
f4d4700d6b cmake: Move preset argument parsing to dedicated method

Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: buildbot <buildbot@kitware.com>
Merge-request: !11877
2026-03-31 09:19:34 -04:00
Brad King 74b3c133e9 Merge topic 'cpack-productbuild-nicer-code'
c33955688c cmCPackProductBuildGenerator: Modernize some code

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !11878
2026-03-31 09:14:22 -04:00
Marc Chevrier c386aaebf8 FILE_SET: install and export SOURCES file set type 2026-03-31 09:50:09 +02:00