1
0
mirror of https://github.com/Kitware/CMake.git synced 2025-10-14 02:08:27 +08:00
Commit Graph

69290 Commits

Author SHA1 Message Date
Brad King
f7f8fd59da CMake 4.0.0-rc4 v4.0.0-rc4 2025-03-11 13:12:16 -04:00
Brad King
9a81fcb8b8 Merge topic 'realpath-windows' into release-4.0
0a5efe8489 cmSystemTools: Fix GetRealPath implementation on Windows
5910bf0b40 cmSystemTools: Restore GetRealPathResolvingWindowsSubst

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !10452
2025-03-11 09:42:29 -04:00
Brad King
dfbcaa9ee1 Merge topic 'link-information-with-decorated-diagnostics' into release-4.0
ee066d2271 LinkerId: Suppress decorated diagnostics during linker inspection

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Acked-by: Nils Gladitz <nilsgladitz@gmail.com>
Merge-request: !10442
2025-03-11 09:40:24 -04:00
Brad King
6e3a4139aa Merge topic 'ci-test-apple-silicon' into release-4.0
a44a2d2579 ci: Explicitly enable or disable RunCMake.AppleSilicon test in macos jobs

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !10454
2025-03-11 09:27:21 -04:00
Brad King
d10a875b21 Merge branch 'release-3.31' into release-4.0 2025-03-11 09:23:41 -04:00
Brad King
1150091f61 Merge topic 'curl-opt-netrc' into release-4.0
1b0c92a3a1 cmCurl: Avoid using undocumented type for CURLOPT_NETRC values

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !10449
2025-03-11 09:22:43 -04:00
Brad King
a682a95b31 Merge topic 'curl-opt-netrc' into release-3.31
1b0c92a3a1 cmCurl: Avoid using undocumented type for CURLOPT_NETRC values

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !10449
2025-03-11 09:21:36 -04:00
Brad King
a44a2d2579 ci: Explicitly enable or disable RunCMake.AppleSilicon test in macos jobs
Enable it on `macos-arm64` jobs and disable it on `macos-x86_64` jobs.
Since the default detection pierces Rosetta, it cannot be used in CI
where we might build and test on different hosts.
2025-03-10 17:02:33 -04:00
Brad King
0a5efe8489 cmSystemTools: Fix GetRealPath implementation on Windows
In commit 823e1df54c (cmSystemTools: Implement GetRealPath on Windows,
2024-11-04, v4.0.0-rc1~521^2~1) we implemented the POSIX behavior that
resolves symlinks followed by '..' components.  However, Windows just
removes them lexically.  Also, we were not handling all junction types.

Instead, use `GetFinalPathNameByHandleW` via `uv_fs_realpath`.

Note that we previously attempted this in commit 640709e7db
(cmSystemTools: Implement GetRealPath on Windows, 2017-10-02,
v3.11.0-rc1~445^2~1) but reverted it in commit 83630d4918
(cmSystemTools: Revert GetRealPath implementation on Windows,
2018-05-29, v3.11.3~3^2) due to resolving `subst` drives.  This time,
add code to re-`subst`itute the drive in the resolved path.

Fixes: #26750
Issue: #17206
2025-03-10 14:50:09 -04:00
Brad King
5910bf0b40 cmSystemTools: Restore GetRealPathResolvingWindowsSubst
We need it to restore behavior on Windows.  Revert commit 16af27fd42
(cmSystemTools: Drop GetRealPathResolvingWindowsSubst, 2024-11-04,
v4.0.0-rc1~521^2), but with a cleaned up implementation.

Issue: #26750
Issue: #18033
2025-03-10 11:25:23 -04:00
Brad King
1b0c92a3a1 cmCurl: Avoid using undocumented type for CURLOPT_NETRC values
Since upstream curl commit `2ec00372a1` (curl.h: change some enums to
defines with L suffix, 2025-02-25), the `CURL_NETRC_*` constants are
integer literals instead of `enum CURL_NETRC_OPTION`.  It turns out
that `curl_easy_setopt` has always expected a `long` anyway, and
that `CURL_NETRC_OPTION` is not documented for public use.

Fixes: #26754
2025-03-10 11:17:19 -04:00
Marc Chevrier
ee066d2271 LinkerId: Suppress decorated diagnostics during linker inspection
Fixes: #26747
2025-03-10 10:36:27 -04:00
Brad King
de7334e4a8 Merge topic 'normalize-input-paths' into release-4.0
fc5584f9bb cmSystemTools: Fix regression in input path normalization on Windows

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !10440
2025-03-10 10:21:04 -04:00
Brad King
941dab2f64 Merge topic 'document-cps-components-resolution' into release-4.0
dd8bf95271 Help: Document handling of CPS transitive components

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !10434
2025-03-10 10:19:02 -04:00
Brad King
a4a4596c24 Merge topic 'path-resolver' into release-4.0
8dfc725cdb PathResolver: Add mode to collapse paths naively and look up on-disk case
75913fe430 PathResolver: Document in comments the on-disk case lookup on macOS

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !10438
2025-03-09 10:48:44 -04:00
Brad King
fc5584f9bb cmSystemTools: Fix regression in input path normalization on Windows
Since commit 622596c6b2 (cmSystemTools: Re-implement
ToNormalizedPathOnDisk without translation map, 2024-10-30,
v4.0.0-rc1~528^2~5) we normalize input paths, while resolving symlinks
only if followed by `..` components, by using `cm::PathResolver`'s
`LogicalPath` mode.  However, that approach assumes POSIX semantics for
resolving paths with symlinks and is incorrect on Windows.

On Windows, file system operations naively remove any component
preceding `..` regardless of whether it is a symlink.  Prior to the
above commit, `ToNormalizedPathOnDisk` matched that behavior using
`CollapseFullPath` followed by `GetActualCaseForPath`.  Restore it using
`cm::PathResolver`'s `CasePath` mode.

Issue: #26750
2025-03-07 18:26:14 -05:00
Brad King
8dfc725cdb PathResolver: Add mode to collapse paths naively and look up on-disk case
In CMake 3.31 and below, `CollapseFullPath` did this on Windows.  KWSys
has since stopped looking up the on-disk case in `CollapseFullPath` to
avoid disk access when most callers only need an in-memory operation.
We currently call `GetActualCaseForPath` explicitly when needed.

Add a mode to `cm::PathResolver` to combine these operations and cache
disk access behind the `System::ReadName` callback.  We will use this to
restore the way CMake 3.31 and below normalized input paths on Windows.

Issue: #26750
Issue: #20214
2025-03-07 18:22:46 -05:00
Brad King
75913fe430 PathResolver: Document in comments the on-disk case lookup on macOS
This was added by commit 08040ced86 (cmake: Look up on-disk case of
input paths on macOS, 2024-11-20, v4.0.0-rc1~390^2).  Update relevant
comments.
2025-03-07 18:14:57 -05:00
Matthew Woehlke
dd8bf95271 Help: Document handling of CPS transitive components
Add documentation explaining how CMake handles component requests of a
CPS transitive dependency.
2025-03-07 13:19:43 -05:00
Brad King
abee5a5068 Merge branch 'release-3.31' into release-4.0 2025-03-07 12:14:38 -05:00
Brad King
f80118609d Merge branch 'release-3.30' into release-3.31 2025-03-07 12:14:26 -05:00
Brad King
f68bd58c9f Merge topic 'cmake-gui-incidental-errors' into release-3.31
e9c494005c cmake-gui: Fix regression that prints an incidental error on fresh build trees

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !10429
2025-03-07 12:14:00 -05:00
Brad King
de5749332a Merge topic 'cmake-gui-incidental-errors' into release-3.30
e9c494005c cmake-gui: Fix regression that prints an incidental error on fresh build trees

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !10429
2025-03-07 12:12:42 -05:00
Brad King
e8b7c9c975 Merge topic 'cmake-gui-incidental-errors' into release-4.0
e9c494005c cmake-gui: Fix regression that prints an incidental error on fresh build trees

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !10429
2025-03-07 12:10:16 -05:00
Brad King
309bc1f332 Merge topic 'ctest-regression' into release-4.0
712cb8cb14 ctest: Restore support for -T Test without dashboard configuration
e47dc29967 cmCTestStartCommand: Remove unnecessary code
f54699d31d cmCTest: De-duplicate working directory code

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !10432
2025-03-07 12:08:31 -05:00
Juan Ramos
e9c494005c cmake-gui: Fix regression that prints an incidental error on fresh build trees
Since commit a872844908 (cmake-gui: Handle relative paths in the build
directory text input, 2024-04-24, v3.30.0-rc1~5^2), `cmake-gui` gave an
incidental error message even when a valid build directory was being
passed.  Fix this by checking for a non-empty path before using it.

Fixes: #26744
2025-03-06 11:13:06 -05:00
Daniel Pfeifer
712cb8cb14 ctest: Restore support for -T Test without dashboard configuration
Since commit 774fcbe49c (CTest: Base command line mode on top of
scripting commands, 2024-10-05, v4.0.0-rc1~653^2) we drive dashboard
client steps through `cmCTestHandlerCommand::ExecuteHandlerCommand`
instead of calling `ProcessHandler` directly.  This requires the
`BuildDirectory` to be known to establish a work directory.

Fixes: #26743
Co-authored-by: Brad King <brad.king@kitware.com>
2025-03-06 09:43:22 -05: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
Brad King
f54699d31d cmCTest: De-duplicate working directory code 2025-03-06 09:43:22 -05:00
Brad King
2b0d0b1544 Merge topic 'fix-cps-cmake-deps' into release-4.0
c3d279841b find_package: CPS component requirements != CMake components

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !10427
2025-03-06 07:53:25 -05:00
Matthew Woehlke
c3d279841b find_package: CPS component requirements != CMake components
Modify how CMake handles required components of a CPS transitive
dependency to not pass them as COMPONENTS if a CMake-script package is
found as the resolved dependency. This is necessary as many CMake-script
package description files do not treat component requests as target
requests (which, in CPS-land, they effectively are), but do implement
logic to mark themselves 'not found' if requested components are
missing. As a result, passing in the required targets as required
components is likely to cause the dependency to be spuriously not found
if it is only available via a CMake-script package configuration file.

Fix this by introducing a new 'required targets' concept, and by passing
CPS component requirements as both required targets and optional
components. The latter serves as a hint for packages that might provide
only a subset of themselves. The former is used to post-validate a
CMake-script package, or is folded on-the-fly into required components
when considering CPS packages.

Note that this functionality is not exposed to the user at this time,
and is only used when resolving transitive dependencies for a CPS
package.
2025-03-05 14:47:49 -05:00
Brad King
bc51d06814 CMake 4.0.0-rc3 v4.0.0-rc3 2025-03-05 09:08:59 -05:00
Brad King
48b437418b Merge topic 'license-rst' into release-4.0
cbc54536b7 ci: Forward our dedicated license file to CPack packaging steps

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !10426
2025-03-05 09:08:12 -05:00
Brad King
cbc54536b7 ci: Forward our dedicated license file to CPack packaging steps
This was missed in commit a9190bd38d (CMake: Prepare dedicated license
file for our own CPack configuration, 2025-03-02).
2025-03-05 09:01:37 -05:00
Brad King
6017ac8f38 Merge topic 'ninja-many-subdirs' into release-4.0
5a36d0c9e7 Ninja: Fix regression with a large number of subdirectories
a30cf4a66a Tests/RunCMake/Configure: Split ninja-specific RerunCMake case

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !10420
2025-03-05 08:22:25 -05:00
Brad King
581182e8f5 Merge topic 'license-rst' into release-4.0
00b6a4b592 bootstrap: Update copyright line extraction for reST markup in LICENSE.rst

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !10425
2025-03-05 08:20:52 -05:00
Brad King
00b6a4b592 bootstrap: Update copyright line extraction for reST markup in LICENSE.rst
Since commit 8d83487e60 (CONTRIBUTORS: Factor contributors list out of
license file, 2025-03-02) the copyright line has reStructuredText
markup.  Filter it out of the copyright line printed by `bootstrap`.
2025-03-05 06:48:39 -05:00
Ben Boeckel
5a36d0c9e7 Ninja: Fix regression with a large number of subdirectories
Since commit f50fb77a4f (Ninja: Regenerate when test or install scripts
are missing, 2024-10-29, v4.0.0-rc1~516^2) the list of paths we pass to
`ninja -t restat` scales with the number of project subdirectories.
Run it in blocks to avoid "command line too long" errors, particularly
on Windows.

Fixes: #26738
2025-03-04 13:37:01 -05:00
Brad King
a30cf4a66a Tests/RunCMake/Configure: Split ninja-specific RerunCMake case
Split the test case from commit f50fb77a4f (Ninja: Regenerate when test
or install scripts are missing, 2024-10-29, v4.0.0-rc1~516^2) into a
dedicated case.
2025-03-04 17:46:31 +01:00
Brad King
fb8872653c Merge topic 'license-rst' into release-4.0
a9bcf09edd CONTRIBUTORS: Update per-contributor hyperlinks

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !10419
2025-03-04 09:40:41 -05:00
Brad King
a9bcf09edd CONTRIBUTORS: Update per-contributor hyperlinks
In commit 2f852580fb (CONTRIBUTORS: Improve formatting of
per-contributor hyperlinks, 2025-03-02) we accidentally added `mailto:`
on a few URLs that should use `https://` instead.

Reported-by: Rolf Eike Beer <eb@emlix.com>
2025-03-04 08:57:03 -05:00
Brad King
455f2249bc Merge topic 'fix-cps-component-documentation' into release-4.0
76e11bd4ea Help: Fix find_package documentation about CPS and COMPONENTS

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !10405
2025-03-04 08:45:06 -05:00
Brad King
2dac61ce26 Merge topic 'license-rst' into release-4.0
2f852580fb CONTRIBUTORS: Improve formatting of per-contributor hyperlinks
8d83487e60 CONTRIBUTORS: Factor contributors list out of license file
1fd8a2be4d LICENSE: Clarify role of copyright in contributions
de273b2e11 LICENSE: Replace references to Copyright.txt with LICENSE.rst
2d42a5444f LICENSE: Rename Copyright.txt to LICENSE.rst
5317564894 Copyright.txt: Add contributor section headers
834c9236e4 Copyright.txt: Remove excess indentation
afeca383d6 Copyright.txt: Drop outdated content around copyright notice line
...

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Acked-by: Alex <leha-bot@yandex.ru>
Merge-request: !10416
2025-03-04 08:38:09 -05:00
Brad King
2f852580fb CONTRIBUTORS: Improve formatting of per-contributor hyperlinks 2025-03-03 09:56:17 -05:00
Brad King
8d83487e60 CONTRIBUTORS: Factor contributors list out of license file
It is more conventional to list contributors in a dedicated file.
Also drop the long out-of-date sponsorship section.
2025-03-03 09:56:17 -05:00
Brad King
1fd8a2be4d LICENSE: Clarify role of copyright in contributions 2025-03-03 09:56:17 -05:00
Kitware Robot
de273b2e11 LICENSE: Replace references to Copyright.txt with LICENSE.rst
```
git grep -lz 'Copyright.txt or https://cmake.org/licensing ' |
  while IFS= read -r -d $'\0' f ; do
    sed -i '/Copyright.txt or https:\/\/cmake.org\/licensing / {
              s/Copyright.txt/LICENSE.rst/
            }' "$f" ; done
```
2025-03-03 09:56:07 -05:00
Brad King
2d42a5444f LICENSE: Rename Copyright.txt to LICENSE.rst
The name `LICENSE` is now more conventional.
Format as reStructuredText to improve rendering.
2025-03-03 09:55:56 -05:00
Brad King
5317564894 Copyright.txt: Add contributor section headers 2025-03-03 08:59:09 -05:00
Brad King
834c9236e4 Copyright.txt: Remove excess indentation 2025-03-03 08:59:09 -05:00