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
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.
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`.
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
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
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
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.
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.
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