22 Commits
Author SHA1 Message Date
Tyler Yankee 4f25560fc6 cmInstallScriptHandler: Remove unused JSON reader 2026-08-18 14:09:56 -04:00
Brad King 4c0451ac95 Merge topic 'install-parallel-timestamp-jitter'
06fe796c9a install: Compare parallel index freshness at whole-second resolution

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !12247
2026-07-09 10:08:14 -04:00
Daksh Mamodiya 06fe796c9a install: Compare parallel index freshness at whole-second resolution
The install handler runs `cmake --install -j` in parallel only when the
CMakeFiles/InstallScripts.json index is at least as new as
CMakeFiles/cmake.check_cache.  Both files are written during a single
generate step, so any ordering between them is sub-second.  On
filesystems that do not order two near-simultaneous writes by their
sub-second modification time (e.g. NFS on AIX), a fresh index can appear
older than the marker and the install spuriously falls back to serial.

Compare the two modification times at whole-second resolution.  This
ignores sub-second jitter within one generate step while still detecting
a genuinely stale index from an older CMake reconfigure, which is always
at least a configure run older.

Fixes: #27919
2026-07-08 19:40:45 +02:00
Daksh Mamodiya 63e4a989e0 Instrumentation: Write cmakeInstall snippet on interrupted install
With instrumentation enabled, interrupting `cmake --install` (Ctrl+C)
terminated the process before its overall `cmakeInstall` envelope
snippet was written, orphaning the per-script `install` snippets.

Extend the `cmake --build` interrupt handling to the install site: wrap
the `cmakeInstall` command in `HandleInterrupt`, skip the post-install
hook, and re-raise so the exit status reflects the signal.  Add
cooperative cancellation so the command unwinds -- serial-loop and
parallel `queueScripts` guards stop launching further scripts, and the
parallel failure aggregation is scoped to dispatched runners so
un-launched scripts are not counted as failed.  Force a non-zero result
on interrupt (Windows cannot re-raise), and write the envelope
atomically so a second Ctrl+C cannot truncate it.

Issue: #27859
2026-07-06 15:17:58 +02:00
Daksh Mamodiya ae5f506906 Install: Exit non-zero when an install script fails
`cmake --install` did not propagate per-script failures into its
process exit code.

In parallel mode, cmInstallScriptHandler::Install spawned each install
script as a child process but never inspected the child exit status or
termination signal, and always returned 0.  It now reads each child's
status after the event loop, prints the failing script's exit code or
signal, and returns non-zero if any script failed.  A failed parallel
install also no longer writes the combined install_manifest.txt, so a
partial manifest is not mistaken for a complete install.

In serial mode, GetScripts() returns the top-level cmake_install.cmake
once per component and per configuration, so multiple scripts run only
when installing several components or configurations at once.  The loop
overwrote its result on every iteration, so an earlier script that
failed via cmake_language(EXIT) was masked by a later one that
succeeded.  The loop now stops at the first failure.  This is a no-op
for a single component and configuration; it changes only installs of
multiple components or configurations, which now stop at the first
failed script and report it instead of attempting the rest.

Fixes: #27906
2026-06-30 18:06:50 +02:00
Matthew Woehlke 732b9585a7 Style: Use camelCase identifiers
Fix most snake_case identifiers in cmInstall* to use camelCase instead.

Also, update clang-tidy configuration to help with applying these
changes, though the relevant check remains off by default.
2026-05-06 11:17:02 -04:00
Robert Maynard bd605ba9e6 cmake --install: Support multiple --components
Issue: #25178
2026-03-09 13:47:58 -04:00
Robert Maynard f059d95484 cmInstallScriptHandler: Now handles adding the component to install 2026-03-05 10:06:01 -05:00
Brad King c94d70c345 cmUVProcessChain: Open output streams automatically
Avoid repeating the logic at every call site.
2025-12-19 07:52:29 -05:00
Martin Duffy 2fdd1e787f instrumentation: Additional data in custom, install and link snippets
- Include `config` in all `install` and `custom` snippets
- Include `target` for `custom` snippets where applicable
- Document and test inclusion of `language` in `link` snippets

Issue: #27244
2025-09-24 16:39:09 -04:00
Martin Duffy 3db07b0189 cmInstallScriptHandler: Refactor to store config and path for each command 2025-09-24 12:41:32 -04:00
Ben Boeckel 557c44b93e cmStrCat: use character literals where possible
Found and replaced using the `cmstrcat-to-char-literal` rule for
`ast-grep`.
2025-05-15 19:12:04 +02:00
Kitware Robot 1772622772 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 10:43:35 -05:00
Kitware Robot 0b96ae1f6a Revise C++ coding style using clang-format with "east const"
Run the `clang-format.bash` script to update all our C and C++ code to a
new style defined by `.clang-format`, now with "east const" enforcement.
Use `clang-format` version 18.

* If you reached this commit for a line in `git blame`, re-run the blame
  operation starting at the parent of this commit to see older history
  for the content.

* See the parent commit for instructions to rebase a change across this
  style transition commit.

Issue: #26123
2025-01-23 13:09:50 -05:00
Martin Duffy 097d4fd1b5 instrumentation: Collect and record project build system metrics
Add a feature for collecting build instrumentation for CMake projects.

Issue: #26099
2025-01-15 09:16:50 -05:00
Martin Duffy ea8e3107ec cmake --install: Respect CMAKE_DEFAULT_CONFIGS
When `cmake --install` is run with no `--config` passed, use
`CMAKE_DEFAULT_CONFIGS` to determine which config(s) to install.

Fixes: #21475
2024-11-19 11:37:47 -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
Martin Duffy a980418f7b cmake --install: Fix concurrency level of parallel install
- Increment the number of currently working installs
- Call uv_run only once
2024-09-09 17:36:08 -04:00
Rose abc8410ac7 cmInstallScriptHandler: Reserve and emplace vector entries 2024-08-19 15:10:19 -04:00
Alex Turbov 3855131c53 Refactor: Eliminate sequential calls to cmSystemTools::Stdout 2024-08-13 22:14:05 +04:00
Martin Duffy 9799491c7e install: Write manifest file in parallel install
Updates the parallel install to generate the install_manifest.txt file.
2024-07-25 12:36:32 -04:00
Martin Duffy 159ba027b9 Install: Add parallel installation option
Fixes: #26000
2024-07-15 11:49:29 -04:00