35343 Commits

Author SHA1 Message Date
Brad King
b47368e425 CMake 3.29.9 2024-11-21 08:34:26 -05:00
Brad King
60af429c5d execute_process: Restore CLOEXEC on OUTPUT_FILE and ERROR_FILE descriptors
Since commit 5420639a8d (cmExecuteProcessCommand: Replace cmsysProcess
with cmUVProcessChain, 2023-06-01, v3.28.0-rc1~138^2~8), the descriptors
for the `OUTPUT_FILE` and `ERROR_FILE` leak to child processes.

With `ExternalProject` + `INSTALL_COMMAND` + `LOG_INSTALL`, the logging
wrapper script leaks the log files' descriptors to the native build
tool.  If they happen to match the `make` job server's pipe fds, e.g.,
with GNU `make` <= 4.3, then the build fails with an error like:

    gmake[4]: *** read jobs pipe: Bad file descriptor.  Stop.

Fixes: #26398
2024-11-20 06:16:11 -05:00
Brad King
16fbb8c142 CMake 3.29.8 2024-08-29 14:33:54 -04:00
Brad King
928571f3c2 CMake 3.29.7 2024-07-16 13:14:29 -04:00
Brad King
be53dcdda6 Merge topic 'vs-17.11' into release-3.29
dfe0f3f358 VS: Fix '-T version=14.4x' under VS 17.1x

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !9622
2024-06-24 09:43:02 -04:00
Brad King
1c4c5ad545 Merge topic 'ctest-windows-std-handles' into release-3.29
e4d0169107 ctest: Fix spurious build failures with CTEST_USE_LAUNCHERS on Windows

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !9598
2024-06-24 09:36:19 -04:00
Brad King
dfe0f3f358 VS: Fix '-T version=14.4x' under VS 17.1x
Starting with VS 17.10 the v143 toolset reserves versions `14.30`
through `14.49`.  This is the first time that the first three digits of
the version do not match the toolset name.  Extend the special case from
commit d256581bb0 (VS: Fix '-T version=14.40' under VS 17.10 preview 1,
2024-02-19, v3.29.0-rc2~10^2) to cover the entire reserved version range.
2024-06-24 08:47:33 -04:00
Brad King
cdc901797a CMake 3.29.6 2024-06-17 14:49:43 -04:00
Brad King
9b672e8075 VS: Quote custom command arguments containing semicolons
The `GoogleTest` module needs this to pass the `TEST_EXECUTOR`
definition to its `GoogleTestAddTests.cmake` helper script in
the `POST_BUILD` command since commit f875c479f5 (GoogleTest: Honor
TEST_LAUNCHER in gtest_discover_tests, 2024-01-17, v3.29.0-rc1~34^2).
Previously it worked only if other characters, such as spaces,
caused the argument to be quoted.  This was exposed by running the
`RunCMake.GoogleTest` test in a path without spaces.

Reported-by: Garrett Campbell <gcampbell@microsoft.com>
2024-06-14 08:24:21 -04:00
Brad King
e4d0169107 ctest: Fix spurious build failures with CTEST_USE_LAUNCHERS on Windows
Remove the stdio handle inheritance suppression originally added by
commit f262298bb0 (... do not inherit pipes in child procs for ctest so
it can kill them, 2007-09-11, v2.6.0~1136).  It's not clear what problem
it was trying to solve, was only done in `ctest` and not `cmake`, and
since commit 9c3ffe2474 (BUG: fix problem with stdout and stderr not
showing up in ms dos shells, 2007-09-25, v2.6.0~1066) has not been done
in `ctest` launched under interactive consoles.

Furthermore, the code has been spuriously breaking stdio when `ctest` is
started with both stdout and stderr connected to the same pipe, such as
when `ctest --launch` is used under `ninja`.  This is because it used
`DuplicateHandle` with `DUPLICATE_CLOSE_SOURCE` on the stdout handle and
then the stderr handle.  If the handles are the same, then the stderr
handle becomes invalid in between these operations, leading to
likely-undefined behavior.  Since commit 96b3dd329e
(cmCTestLaunchReporter: Replace cmsysProcess with cmUVProcessChain,
2023-07-26, v3.28.0-rc1~138^2~2) this became more noticeable because
`uv_spawn` performs additional verification on stdio handles.

This could be fixed by instead suppressing inheritance via

    SetHandleInformation(h, HANDLE_FLAG_INHERIT, 0);

However, the functionality no longer seems necessary, so remove it.
2024-06-14 07:32:29 -04:00
Brad King
facfba088f CMake 3.29.5 2024-06-06 08:57:14 -04:00
Joan Bruguera Micó
ff077af032 ctest: Set close-on-exec for jobserver FIFO
Set the close-on-exec flag to prevent the jobserver FIFO file
descriptor from leaking to subprocesses spawned by `ctest`.

This leak is usually harmless, but can cause `make test -jN` to hang
at the end of the build if a test leaves a background process running
with the jobserver FIFO file descriptor open.

Fixes: #26027
2024-06-05 09:37:05 -04:00
Brad King
efaa9efece CMake 3.29.4 2024-06-03 14:28:41 -04:00
Brad King
9f72ac3644 CMake 3.28.6 2024-06-03 13:35:26 -04:00
Brad King
f2ea85f516 Merge topic 'update-kwsys' into release-3.29
98dd754b62 KWSys: ConsoleBuf: Fix test case when running under Windows Terminal

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !9553
2024-05-29 08:30:10 -04:00
Brad King
98dd754b62 KWSys: ConsoleBuf: Fix test case when running under Windows Terminal
Our test case writes a NUL byte to the console to test its behavior.
The behavior of Windows Terminal differs from Windows Console Host
(conhost.exe).  Detect which of these is in use at runtime and adjust
our expected result accordingly.
2024-05-28 09:11:56 -04:00
Brad King
ea44e63a7c Merge topic 'cxxmodules-gcc-binary-mode' into release-3.29
9e2f31ec23 cmCxxModuleMapper: add a query for the open mode for the modmap

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !9525
2024-05-17 11:16:16 -04:00
Brad King
32a8d5a4ac Merge topic 'cxxmodules-gcc-binary-mode' into release-3.28
9e2f31ec23 cmCxxModuleMapper: add a query for the open mode for the modmap

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !9525
2024-05-17 11:15:38 -04:00
Ben Boeckel
9e2f31ec23 cmCxxModuleMapper: add a query for the open mode for the modmap
GCC (MinGW) wants to use `\n` on Windows too.

Fixes: #25974
2024-05-16 09:54:16 -04:00
Brad King
19c2f8e1f3 Merge topic 'cmp0037-message' into release-3.29
c773d5b436 CMP0037: Restore diagnostic message for invalid ALIAS target names

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Reviewed-by: Ben Boeckel <ben.boeckel@kitware.com>
Merge-request: !9519
2024-05-15 09:58:48 -04:00
Brad King
c773d5b436 CMP0037: Restore diagnostic message for invalid ALIAS target names
Refactoring in commit 7a4c02cb38 (cmGlobalGenerator: factor out
messaging for CMP0037, 2023-09-24, v3.28.0-rc1~39^2~7) incorrectly
switched to reporting the aliased target name instead of the invalid
name of the alias itself.

Fixes: #25979
2024-05-14 10:44:47 -04:00
Brad King
b39fb31bf4 CMake 3.29.3 2024-05-07 12:49:54 -04:00
Brad King
9f7ec4c297 CMake 3.28.5 2024-05-07 08:42:47 -04:00
Brad King
74a07abcc6 Merge topic 'cxxmodules-build-export-different-directory' into release-3.29
1fba6d3233 Merge branch 'cxxmodules-build-export-different-directory-3.28' into cxxmodules-build-export-different-directory
ec35251510 cmDyndepCollation: look at all `export(TARGETS)` calls

Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: buildbot <buildbot@kitware.com>
Merge-request: !9485
2024-05-03 09:23:35 -04:00
Brad King
1086902abd Merge topic 'cxxmodules-build-export-different-directory' into release-3.28
ec35251510 cmDyndepCollation: look at all `export(TARGETS)` calls

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !9485
2024-05-03 09:13:18 -04:00
Brad King
a344140dfa Merge topic 'vs-scan-module-deps-settings' into release-3.29
3022f0363f VS: set ScanSourceForModuleDependencies at vcxproj level
dff511ad28 cmGeneratorTarget: add a target-level query for "needs dyndep"

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: AaronRuizMoraUK <aaronruizmora@gmail.com>
Merge-request: !9471
2024-05-02 09:40:03 -04:00
Ben Boeckel
1fba6d3233 Merge branch 'cxxmodules-build-export-different-directory-3.28' into cxxmodules-build-export-different-directory
* cxxmodules-build-export-different-directory-3.28:
  cmDyndepCollation: look at all `export(TARGETS)` calls
2024-05-01 22:09:43 -04:00
Ben Boeckel
ec35251510 cmDyndepCollation: look at all export(TARGETS) calls
Previously, only `export()` calls in the same directory were noticed.

Also add a test that exports in a different directory than the target
itself resides in.

Fixes: #25813
2024-05-01 22:08:35 -04:00
Ben Boeckel
3022f0363f VS: set ScanSourceForModuleDependencies at vcxproj level
Implement the target-wide `CXX_SCAN_FOR_MODULES`/`CMP0155` selection
with the `.vcxproj`-wide `ScanSourceForModuleDependencies` setting.
Set the per-source equivalent only when needed for a per-source
`CXX_SCAN_FOR_MODULES` property.

This approach enables Intellisense for interfaces imported from modules.
It is also more consistent with what a user might expect when
investigating the state of module scanning from the VS property panels.

Fixes: #25806
Fixes: #25947
2024-05-01 09:54:50 -04:00
Ben Boeckel
dff511ad28 cmGeneratorTarget: add a target-level query for "needs dyndep"
This can still be overridden per-source, but it indicates the state of
the target's default behavior.
2024-05-01 09:41:07 -04:00
Brad King
4bf49bc437 Merge topic 'export-name-safe-name' into release-3.29
142a85f9c1 cxxmodules: use filesystem-safe export names in filenames
4452d41488 cmGeneratorTarget: add method to get a filesystem-safe export name

Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: buildbot <buildbot@kitware.com>
Merge-request: !9474
2024-05-01 09:29:55 -04:00
Brad King
f909fc2f92 Merge topic 'export-name-safe-name' into release-3.28
142a85f9c1 cxxmodules: use filesystem-safe export names in filenames
4452d41488 cmGeneratorTarget: add method to get a filesystem-safe export name

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !9474
2024-05-01 09:28:59 -04:00
Brad King
c5d8fa3f2c Merge topic 'exported-modules-with-headers' into release-3.29
2041f7c9bf cmGeneratorTarget: add the original target as a COMPILE_ONLY link
051c2110c8 Tests/CXXModules: test exporting modules which include headers

Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: buildbot <buildbot@kitware.com>
Merge-request: !9469
2024-04-30 10:10:34 -04:00
Ben Boeckel
142a85f9c1 cxxmodules: use filesystem-safe export names in filenames
Also add tests.

Fixes: #25828
2024-04-30 09:05:16 -04:00
Ben Boeckel
4452d41488 cmGeneratorTarget: add method to get a filesystem-safe export name
C++ module support puts the export name in a filename. Export names with
`:` in them are not valid filenames on Windows. Add a method to escape
names as necessary.

See: #25828
2024-04-29 17:23:08 -04:00
Ben Boeckel
2041f7c9bf cmGeneratorTarget: add the original target as a COMPILE_ONLY link
Fixes: #25909
2024-04-26 20:15:05 -04:00
Brad King
d3190d6a73 CMake 3.29.2 2024-04-11 10:12:19 -04:00
Brad King
26e79ed299 Fix regression on reconfigure with unnormalized -DCMAKE_<LANG>_COMPILER=
Since commit 3f2a5971c0 (Modules: CMAKE_*_COMPILER convert path to cmake
path, 2023-12-02, v3.29.0-rc1~292^2) we normalize the path to the
compiler.  Update our logic that checks whether the compiler has changed
to account for path normalization.

Fixes: #25883
Issue: #25456
2024-04-10 12:03:17 -04:00
Evan Wilde
579472d877 Swift: Ninja: Remove module dependency for executables
We shouldn't include the swiftmodule in the ninja dependency graph
unless that target emits a swiftmodule.

Fixes: #25869
2024-04-08 18:07:13 -07:00
Brad King
a4774b0c10 CMake 3.29.1 2024-04-03 11:45:14 -04:00
Charlotte Koch
4c70e72cae cmSystemTools: Fix compilation on DragonFly BSD
Define `_XOPEN_SOURCE >= 700` to make `gettimeofday()` et al. available.
2024-04-02 17:33:02 -04:00
Brad King
85745cce7a ctest: Restore enforcement of RESOURCE_LOCK test property
Refactoring in commit 5ff0b4ed57 (cmCTestMultiProcessHandler:
Consolidate test readiness checks, 2023-10-20, v3.29.0-rc1~378^2~4)
accidentally broke `RESOURCE_LOCK`.  Fix it and replace the previous
test with one that would have caught this.

Fixes: #25843
2024-04-01 12:22:29 -04:00
Craig Scott
98cc86e265 try_compile(): Include languages with _ or - when passing linker vars
Fixes: #25809
2024-03-22 21:35:51 +11:00
Brad King
25d2850c19 CMake 3.29.0 2024-03-21 09:32:22 -04:00
Brad King
b5602e7254 CMake 3.28.4 2024-03-20 10:03:43 -04:00
Brad King
0287208bbf Merge topic 'ninja-fortran-include' into release-3.29
36dc8d6d50 Ninja: Fix Fortran module deps in files INCLUDEd by preprocessed sources

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !9351
2024-03-20 09:55:47 -04:00
Brad King
36dc8d6d50 Ninja: Fix Fortran module deps in files INCLUDEd by preprocessed sources
If a preprocessed source also uses the Fortran `INCLUDE` directive,
search the original source file's directory.

Fixes: #25792
2024-03-19 07:56:13 -04:00
Brad King
788c204788 CMake 3.29.0-rc4 2024-03-14 13:33:17 -04:00
Brad King
e497fbfca3 Merge topic 'Apple-TBD-in-subdirecory' into release-3.29
bcc26ce465 Apple Text Based Stubs: should be usage in subdirectories

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !9341
2024-03-14 13:31:10 -04:00
Brad King
742af6cff7 Merge topic 'autogen-makefile-depfile' into release-3.29
d2d1763f88 cmQtAutoGenInitializer: De-duplicate autogen/timestamp target depend logic
6193d15556 Autogen: Restore target-ordering dependencies in Makefiles with DEPFILE

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !9340
2024-03-14 11:46:53 -04:00