18d5daa7f3 file(DOWNLOAD/UPLOAD): Restore support for curl built without a TLS backend
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !12104
Since commit 38390245a2 (ctest: Require minimum TLS 1.2 by default,
2024-09-23, v3.31.0-rc1~47^2), our TLS-1.2 default fails with a curl
built without any TLS backend, causing even `file://` and `http://`
URLs to fail. Teach CMake to recognize both ways libcurl may report
that it was built without TLS support.
Fixes: #27849
As of GCC 16, `gcc` implies `gcc_s_asneeded` but `g++` implies `gcc_s`.
When linking mixed C and C++ binaries, avoid listing one if the other is
already implied by the linker language.
Fixes: #27796
Replace `std::endl` with simple newline to eliminate performance issue
caused by a `write()` system call per line issued to the configure log.
The addition of the `find-v1` configure log item in commit e94ace226b
(Merge topic 'configure-log-find-v1', 2025-04-29, v4.1.0-rc1~266) caused
a large increase in the size of the configure log (1300 lines to 36000
lines in one test case) and exposed this latent performance issue.
It caused serious (10x) degradation in configure time when run on
common filesystems where `write()` is expensive, such as WSL or NFS.
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
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.
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
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
The logic to compute the CPS prefix by comparing the specified relative
path to the actual path contained a potential overflow if the specified
path is longer than the actual path. Fix this by comparing the path
lengths first.
Fixes: #27631
This was broken by commit 96b3dd329e (cmCTestLaunchReporter: Replace
cmsysProcess with cmUVProcessChain, 2023-07-26, v3.28.0-rc1~138^2~2).
KWSys Process shares stdin by default. Now it must be explicit.
Issue: #27610
Since commit 99bdf2ae16 (cmLocalGenerator: add PDB copying dependency on
its script, 2025-06-16, v4.2.0-rc1~481^2~8) the copy is repeated
whenever the copying script is updated. Avoid updating the copy script
timestamp when it does not change.
Fixes: #27608
The FASTBuild generator puts source files from different subdirectories
into different `FastbuildObjectListNode` instances. This ensures that
files with the same name will not write to the same object file. A unity
bucket can only contain files from a single `FastbuildObjectListNode`
instance, so a side effect of this logic is that unity buckets can only
contain files in the same subdirectory. This change fixes the problem by
skipping the subdirectory check logic for files with unity enabled.
Fixes: #27457
6d8ce8b190 VS: Accept Windows 11 SDKs as semantically equivalent to Windows 10 SDKs
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !11671
Some projects might get unlucky and have targets which collide in the
sha3-512 hash (truncated to 4) in a directory which also collides in the
same way (easily done by sharing it). Note such problems as potentially
colliding and offer potential remedies.
Also add a test which generates the error.
Closes: #27465