Commit Graph

36425 Commits

Author SHA1 Message Date
Brad King
823e1df54c cmSystemTools: Implement GetRealPath on Windows
Use `cm::PathResolver`'s `RealPath` variant to normalize paths,
look up their on-disk case, and resolve symlinks, but without
resolving `subst` drives on Windows.

Fixes: #17206
2024-11-04 11:56:14 -05:00
Brad King
384dbef61e Merge topic 'normalize-input-paths'
799602b983 cmQtAutoMocUic: Remove now-unnecessary mutex around CollapseFullPath
5ca6234d13 KWSys: Remove path translation map settings for build within CMake
74c497ca65 Merge branch 'upstream-KWSys' into normalize-input-paths
10a381e446 KWSys 2024-11-04 (bef1f021)
73dddffe32 KWSys: Disable the path translation map for build within CMake
b378781c5d cmSystemTools: Cache ToNormalizedPathOnDisk actual-case lookups
622596c6b2 cmSystemTools: Re-implement ToNormalizedPathOnDisk without translation map
5aed3ee49d cmSystemTools: Add GetLogicalWorkingDirectory

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !9969
2024-11-04 10:09:16 -05:00
Brad King
799602b983 cmQtAutoMocUic: Remove now-unnecessary mutex around CollapseFullPath
KWSys's `CollapseFullPath` no longer maintains global state. The mutual
exclusion added by commit 51676cf655 (Autogen: Split JobEvalCacheT job
into separate moc and uic jobs, 2019-09-12, v3.16.0-rc1~94^2~7) and
commit 53d523f2e1 (autogen: fix race in depfile parsing, 2021-04-15,
v3.20.2~10^2) is no longer needed.
2024-11-04 10:00:17 -05:00
Brad King
74c497ca65 Merge branch 'upstream-KWSys' into normalize-input-paths
# By KWSys Upstream
* upstream-KWSys:
  KWSys 2024-11-04 (bef1f021)
2024-11-04 09:59:56 -05:00
Brad King
f21c08ebbf Merge topic 'ctest-crash-handling'
0a4ee422c1 ctest: Restore Windows Error Reporting in interactive mode

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !9855
2024-11-04 09:52:51 -05:00
Brad King
847f74d294 Merge topic 'swift-spaces'
75e4cd8d18 Ninja: Fix escaping of paths with spaces for Swift tooling

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !9956
2024-11-04 09:40:48 -05:00
Kitware Robot
90f9f480bb CMake Nightly Date Stamp 2024-11-04 00:03:24 -05:00
Brad King
73dddffe32 KWSys: Disable the path translation map for build within CMake
It is about to be removed from KWSys.
2024-11-03 08:32:46 -05:00
Brad King
b378781c5d cmSystemTools: Cache ToNormalizedPathOnDisk actual-case lookups
Prior to re-implementing `ToNormalizedPathOnDisk`, its use of KWSys's
`GetActualCaseForPathCached` cached file actual-case lookups to avoid
redundant filesystem access.  Add caching to the actual-case lookups we
do for `cm::PathResolver`.
2024-11-03 08:30:30 -05:00
Brad King
622596c6b2 cmSystemTools: Re-implement ToNormalizedPathOnDisk without translation map
Use `cm::PathResolver`'s `LogicalPath` variant to normalize paths while
preserving symlinks not followed by `..` components.  This avoids
needing the KWSys path translation map to preserve symlinks through
`realpath` operations.  It also works with symlinks on Windows.

Fixes: #16228
2024-11-03 08:26:43 -05:00
Brad King
5aed3ee49d cmSystemTools: Add GetLogicalWorkingDirectory
Track the current working directory with symbolic links preserved.
2024-11-03 08:26:36 -05:00
Brad King
f9f4ab55ac Merge topic 'path-resolver'
1a6015e5fc PathResolver: Add helper to compute normalized paths
2a6f86ec5e Tests/CMakeLib: Remove stray output from test loop
646f37b473 clang-tidy: disable modernize-concat-nested-namespaces

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !9965
2024-11-03 08:19:10 -05:00
Brad King
f37a5270f2 Merge topic 'update-kwsys'
88ea162db7 Merge branch 'upstream-KWSys' into update-kwsys
f09390fbf1 KWSys 2024-11-01 (1cfc8445)

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !9966
2024-11-03 08:17:05 -05:00
Kitware Robot
2369e65b59 CMake Nightly Date Stamp 2024-11-03 00:01:59 -04:00
Kitware Robot
08878dcc29 CMake Nightly Date Stamp 2024-11-02 00:01:25 -04:00
Brad King
88ea162db7 Merge branch 'upstream-KWSys' into update-kwsys
# By KWSys Upstream
* upstream-KWSys:
  KWSys 2024-11-01 (1cfc8445)
2024-11-01 10:04:53 -04:00
Dylan Snelgrove
0a4ee422c1 ctest: Restore Windows Error Reporting in interactive mode
This behavior was removed when we switched to libuv in CMake 3.11.
After backporting new changes from libuv v2, we can restore the
behavior.

Fixes: #20115
2024-11-01 09:56:54 -04:00
Brad King
9fdf716ee8 Merge topic 'debug-adapter-value-formatting'
41621c3afb Debugger: Add Value Formatting support for StackTrace request

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !9940
2024-11-01 09:16:18 -04:00
Brad King
5317d9267a Merge topic 'load-command'
3f55f5264d cmLoadCommandCommand: Port away from cmCommand

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !9962
2024-11-01 09:15:05 -04:00
Brad King
60977c2ef2 Merge topic 'ctest-handler-refactoring'
9fe40b33e0 cmCTest*Handler: Use default member initialization
d07a35a336 cmCTest: Remove handler instances
b64e59d571 cmCTestSubmitHandler: Initialize HttpHeaders with command line
81e904bd53 cmCTestScriptHandler: Don't inherit from cmCTestGenericHandler
914a355810 CTest: Remove unneeded code
70dfb24957 cmCTestTestHandler: Consolidate simple options into cmCTestTestOptions
b43d3dcfba cmCTestTestHandler: Consolidate File options into cmCTestTestOptions
f7181175ad cmCTestTestHandler: Consolidate RegExp options into cmCTestTestOptions
...

Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: buildbot <buildbot@kitware.com>
Merge-request: !9926
2024-11-01 09:14:11 -04:00
Brad King
7b23e2f884 Merge topic 'find_package-user-dir-not-ignored'
230e5ec172 find_package: Don't test <name>_DIR against ignored paths

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !9961
2024-11-01 09:13:20 -04:00
Winfried Auner
75e4cd8d18 Ninja: Fix escaping of paths with spaces for Swift tooling
If a path inside a project contains spaces, the generated Ninja
definitions previously contained superfluous quotes.

Fixes: #26404
2024-11-01 08:59:32 -04:00
Brad King
1a6015e5fc PathResolver: Add helper to compute normalized paths
Create a `cm::PathResolver` helper to compute normalized paths.
Provide a common implementation with compile-time dispatch to
select details w.r.t. symbolic links, existence, and matching
the on-disk case of existing paths.  Later we can use this to
implement:

* `ToNormalizedPathOnDisk`: Normalizes paths while resolving symlinks
  only when followed by `..` components.  Does not require paths to
  exist, but reads on-disk case of paths that do exist (on Windows).

* `GetRealPath`: Normalizes paths while resolving all symlinks.
   Requires paths to exist, and reads their on-disk case (on Windows).

* `CollapseFullPath`: Normalizes paths in memory without disk access.
  Assumes components followed by `..` components are not symlinks.

Abstract filesystem access through runtime dispatch so that we can test
Windows symbolic link and network path behavior without relying on real
environments.  The overhead of runtime dispatch should be insignificant
during real filesystem access.

Issue: #16228
Issue: #17206
2024-11-01 08:44:17 -04:00
Kitware Robot
a0c4a4f164 CMake Nightly Date Stamp 2024-11-01 00:01:45 -04:00
Kitware Robot
90c120cbf2 CMake Nightly Date Stamp 2024-10-31 00:01:16 -04:00
Daniel Pfeifer
3f55f5264d cmLoadCommandCommand: Port away from cmCommand 2024-10-30 14:41:42 +01:00
Kitware Robot
ae6561699d CMake Nightly Date Stamp 2024-10-30 00:01:20 -04:00
Jonathan Phippen
41621c3afb Debugger: Add Value Formatting support for StackTrace request
Add support for the "format" property of the Debug Adapter Protocol
StackTrace request to fulfill the host's request to format the resulting
StackFrame name differently.
2024-10-29 13:29:00 -07:00
Matthew Woehlke
230e5ec172 find_package: Don't test <name>_DIR against ignored paths
Tweak `find_package` to not compare an already-specified `<name>_DIR`
against the set of ignored paths. This is a minor behavior change in
that, if a previously found package is in a location that is NEWLY
ignored (i.e. because the user modified the ignored paths since the
previous run of CMake), we won't throw out the old result. However, it
also means that a user specifying `<name>_DIR` takes precedence over the
set of ignored paths, which seems like the desired behavior.

Note that the current behavior was introduced in commit 11f97d1968
(find_package: Refactor CMAKE_[SYSTEM_]IGNORE_PATH, 2022-01-28,
v3.23.0-rc1~31^2) and appears to have been unintentional.
2024-10-29 15:01:04 -04:00
Brad King
99655b17eb Merge topic 'update-kwsys'
169b7b1256 Merge branch 'upstream-KWSys' into update-kwsys
875cf5f61f KWSys 2024-10-28 (c87126a2)

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !9957
2024-10-29 09:48:13 -04:00
Brad King
1029cd338b Merge topic 'CMP0174-OLD-regression-repeated-keyword'
c8567acc32 cmake_parse_arguments: Restore capture of value after repeated keyword

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !9953
2024-10-29 09:38:15 -04:00
Daniel Pfeifer
9fe40b33e0 cmCTest*Handler: Use default member initialization 2024-10-29 12:49:22 +01:00
Daniel Pfeifer
d07a35a336 cmCTest: Remove handler instances 2024-10-29 12:49:22 +01:00
Daniel Pfeifer
b64e59d571 cmCTestSubmitHandler: Initialize HttpHeaders with command line 2024-10-29 12:49:22 +01:00
Daniel Pfeifer
81e904bd53 cmCTestScriptHandler: Don't inherit from cmCTestGenericHandler
Add `cmake*` and `cmCTest*` instances and arguments where needed,
such that `GetScriptHandler` does not have to be called.
2024-10-29 12:47:41 +01:00
Daniel Pfeifer
914a355810 CTest: Remove unneeded code 2024-10-29 11:27:17 +01:00
Daniel Pfeifer
70dfb24957 cmCTestTestHandler: Consolidate simple options into cmCTestTestOptions 2024-10-29 11:26:54 +01:00
Daniel Pfeifer
b43d3dcfba cmCTestTestHandler: Consolidate File options into cmCTestTestOptions 2024-10-29 11:26:27 +01:00
Daniel Pfeifer
f7181175ad cmCTestTestHandler: Consolidate RegExp options into cmCTestTestOptions 2024-10-29 11:25:57 +01:00
Daniel Pfeifer
86225833f2 cmCTestTestHandler: Consolidate Output options into cmCTestTestOptions 2024-10-29 11:25:05 +01:00
Daniel Pfeifer
23c6de8808 cmCTestGenericHandler: Initialize SubmitIndex and Verbose 2024-10-29 11:18:48 +01:00
Kitware Robot
3ee90ba838 CMake Nightly Date Stamp 2024-10-29 00:01:25 -04:00
Craig Scott
c8567acc32 cmake_parse_arguments: Restore capture of value after repeated keyword
When a single-value keyword is repeated, and the first instance is
missing a value, it prevents the value from the second instance from
being stored in a variable. This was a regression introduced by
commit ceeea4e511 (cmake_parse_arguments: Set variable if empty string
given after keyword, 2024-08-18). That change also didn't create a
variable if the keyword was given but without a value. The purpose
of the change was to always define a variable if a keyword was given.
Lastly, that change didn't protect the CMP0174 logic to make it only
apply to the PARSE_ARGV form.

The first two of the above problems are fixed here by tracking the
keywords given instead of checking which keywords were missing
values. The third problem is also fixed here, being tightly coupled
to the same logic as the first two problems.

Fixes: #26397
2024-10-28 09:47:21 -04:00
Brad King
169b7b1256 Merge branch 'upstream-KWSys' into update-kwsys
# By KWSys Upstream
* upstream-KWSys:
  KWSys 2024-10-28 (c87126a2)
2024-10-28 09:35:12 -04:00
Brad King
323638f573 Merge topic 'libuv-error-mode-backport'
0f515c2d26 libuv: win/spawn: add option to use parent process error mode
728f40d4bf libuv: win/spawn: allow exception through to OS

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !9931
2024-10-28 09:32:24 -04:00
Brad King
87778f46ca Merge topic 'custom_command-depfile-management'
8979e7aaab add_custom_command(DEPFILE): avoid duplicate entries in dependencies

Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: buildbot <buildbot@kitware.com>
Merge-request: !9945
2024-10-28 09:30:26 -04:00
Brad King
4f0c36ba41 Merge topic 'link-strategy'
39fd396421 LINK_LIBRARIES_STRATEGY: Rename strategies to clarify expectations

Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: buildbot <buildbot@kitware.com>
Acked-by: Craig Scott <craig.scott@crascit.com>
Merge-request: !9949
2024-10-28 09:14:40 -04:00
Brad King
f42962bfbf Merge topic 'link-strategy' into release-3.31
39fd396421 LINK_LIBRARIES_STRATEGY: Rename strategies to clarify expectations

Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: buildbot <buildbot@kitware.com>
Acked-by: Craig Scott <craig.scott@crascit.com>
Merge-request: !9949
2024-10-28 09:14:39 -04:00
Brad King
a2d1674cbf Merge topic 'ci-fedora-41'
8779b1ad28 Merge branch 'backport-ci-fedora-41' into ci-fedora-41
566b07bbf7 ci: Restore cmake.org html documentation search results for index entries
c8591c61d8 ci: use Fedora 41 images and environments
46d89b8524 ci: update Linux image to Fedora 41
e6da61fcd9 ci: Run Fedora + Makefiles job on x86_64-v3 hosts for mpich+libfabric
92d5c48b14 CTestCustom: Suppress clang-analyzer warning in libuv
5c7a55edc2 cmStringAlgorithms: Fix core.NonNullParamChecker diagnostic in cmAlphaNum
51ed0eba18 KWSys: SystemInformation: Add missing EOF check when reading /proc/cpuinfo
...

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !9947
2024-10-28 08:25:27 -04:00
Kitware Robot
3064e8e2d6 CMake Nightly Date Stamp 2024-10-28 00:02:45 -04:00