Commit Graph
77133 Commits
Author SHA1 Message Date
Taylor Braun-Jones f1b6b3a6f0 devcontainer: Run local customization hooks through the container's life
The container ran a developer's own `hooks/root.sh` and `hooks/user.sh`
while the image was built, and nothing of theirs afterwards.  A
customization that has to start something, or to reach the source tree,
had nowhere to run: the tree is not mounted during the build, and the one
lifecycle command the configuration used was spoken for by the status
report.

Run an optional script per phase through `run-hooks.sh`, and offer five:
`initialize` on the host, `build` in the image, and `post-create`,
`post-start` and `post-attach` in the container.  A failing `build` hook
fails the image build, because an image whose customizations did not
apply is quietly wrong; the rest are reported and otherwise ignored, so
that a typo in a personal hook cannot leave its author unable to open the
container in order to fix it.

The two build hooks become one, running as the container user, who may
`sudo`: one hook that reaches either user is simpler to write against
than two that each reach one.  Every hook is told where it lives, and
every hook but the build one is given a directory to keep state in,
beside the hooks rather than among them because state is written by
whatever they start rather than by hand.  `.dockerignore` keeps that
directory out of the build context, which state written as `root` would
otherwise make unreadable.
2026-09-09 18:35:57 -04:00
Taylor Braun-Jones 3cfbea10e4 devcontainer: Name the workspace path explicitly
A tool that opens the container picks a workspace path of its own when
the configuration names none, and `.gitlab/ci/devcontainer-run.sh` mounts
the source tree at a path it spells itself.  The two disagreed: an editor
opened the tree at `/workspaces/cmake` while CI used the
`/home/cmake-dev/workspace` that `create_user.sh` prepares for it.  Say
which one it is, so that a path means the same thing everywhere.
2026-09-09 18:35:56 -04:00
Ben Boeckel f8f4dc7f43 gitlab-ci: add a job to verify the devcontainer in CI 2026-09-08 16:26:08 +00:00
Ben BoeckelandTaylor Braun-Jones ea0667e779 ci: add scripts to run and verify the devcontainer
Co-authored-by: Taylor Braun-Jones <taylor@braun-jones.org>
2026-09-08 16:26:02 +00:00
Taylor Braun-Jones 9c17332601 devcontainer: Add clang-tidy, clang-tools, and clazy
Provide the analysis tools our CI images carry: `clang-tidy` to run the
checks in `.clang-tidy`, `clang-tools` for `scan-build`, and `clazy`, the
compiler our Clazy job builds with.

Name the version of `clang-tidy` our checks are written against rather
than install Ubuntu's unversioned package, which is a release behind and
reports `cmake-use-cmsys-fstream` where it should not.  `CMakeLists.txt`
searches for `clang-tidy` only under the unversioned name, so link the
version installed by name to it, as we already do for `clang-format`.

`clazy` and `clang-tools` remain whatever versions Ubuntu carries rather
than the ones the CI image does, so expect their diagnostics to differ
from those jobs'.  CMake's own clang-tidy checks are not available either
way: `CMake_USE_CLANG_TIDY_MODULE` needs `Utilities/ClangTidyModule` built
against Clang's development files, which are not installed here.

Suggested-by: Tyler Yankee <tyler.yankee@kitware.com>
2026-09-08 16:25:48 +00:00
Taylor Braun-Jones a8872df649 devcontainer: Add clang, gfortran, and valgrind
Provide `clang` for developers who prefer to build with it rather than
with the default `g++`, and `valgrind` to run CMake and its tests under a
memory checker.  The sanitizer runtimes already come with both
compilers, so building with `-fsanitize=` needs nothing installed.

Name `gfortran` as well, without which Clang cannot link at all.  Ubuntu
26.04 carries a Fortran-only `gcc-16` build that provides no C++ standard
library, `libopenmpi-dev` lists `gfortran-16` first among the
alternatives it accepts, and Clang selects the newest GCC installation it
finds.  Naming `gfortran` lets `apt` satisfy that dependency with
`gfortran-15` instead, so the GCC 16 installation never appears.

Suggested-by: Tyler Yankee <tyler.yankee@kitware.com>
2026-09-08 16:25:11 +00:00
Taylor Braun-Jones 8bd053379f devcontainer: Reword the comment on caching package downloads
The sentence packed the two purposes of the mounts and their effect into
one clause chain, which was hard to follow.  Split it in two.

Suggested-by: Tyler Yankee <tyler.yankee@kitware.com>
2026-09-08 16:25:05 +00:00
Taylor Braun-Jones 7ae5c3cfb2 devcontainer: Add the Kitware APT repository
Configure `apt.kitware.com` in the development container so that `cmake`
is the latest CMake release rather than the older one Ubuntu carries, and
so that developers reach each further release through `apt-get` alone.

Fetch the repository's signing key, verified against the hash the
`Dockerfile` pins, and trust it just long enough to install
`kitware-archive-keyring`, which then provides the key, so that `apt`
follows the rotations Kitware makes to it.  Interpolating the hash into
the step that fetches the key also busts the build cache when the hash
changes, so a rotation is picked up rather than served from an old layer.
Reaching either the key or the repository needs `curl` and a certificate
store, neither of which the base image carries, so install them first.
2026-09-08 16:24:41 +00:00
Taylor Braun-Jones 69c15636b6 devcontainer: Add the GitLab CLI and glab-axi
Install `glab`, the GitLab CLI, and `glab-axi`, an agent-ergonomic
wrapper around it, in the development container.

Default `GITLAB_HOST` to `gitlab.kitware.com` so that both address our
GitLab instance without further configuration, persist the `glab`
configuration directory on a volume so that a credential need be created
only once, and pass a `GITLAB_TOKEN` or `GITLAB_CLIENT_ID` from the host
through to the container.

Neither tool can authenticate on its own, so check for a working
credential each time a tool attaches to the container and print what
remains to be set up if there is none.
2026-09-08 16:23:53 +00:00
Taylor Braun-Jones d326c8afd5 devcontainer: Add a Dev Container definition for CMake development
Provide a `.devcontainer` definition, following the Dev Container
Specification, to give contributors a ready-made Linux environment with
the tools needed to build CMake, run its test suite, build its
documentation, and satisfy its style rules.

Base the container on Ubuntu, which offers the broadest ecosystem of
packages and tooling for development, including a recent `cmake` and the
`clang-format` version our style rules require, exactly.  Mirror the
package lists of the Debian image our CI infrastructure uses, section by
section, so that the dependencies available closely match the ones
against which merge requests are tested.  Build the image the way the
images under `.gitlab/ci/docker/` are built: bind mount the package
lists and the installation script rather than copying them in, and cache
the package lists and downloaded archives so that a rebuild fetches only
what has changed.

Run optional `.devcontainer/hooks/root.sh` and
`.devcontainer/hooks/user.sh` scripts, both ignored by Git, so that
developers may customize the container without modifying tracked files.

Document usage in a new `Help/dev/devcontainer.rst`.

Fixes: #28043
2026-09-08 16:23:33 +00:00
Brad King b56fabdb46 Merge topic 'test-implicit-info'
e9c3a8a1d8 Tests/RunCMake/ParseImplicit*Info: Run more cases on Windows hosts
7716efa3c6 Tests/RunCMake/ParseImplicitLinkInfo: Run more cases on non-Windows hosts
769bff22d9 Tests/RunCMake/ParseImplicitIncludeInfo: Simplify platform exclusions

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !12457
2026-09-01 11:04:34 -04:00
Brad King 8e49148617 Merge topic 'llvmflang-compile-warn-error'
32c8a4bd01 LLVMFlang: Add support for COMPILE_WARNING_AS_ERROR

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !12455
2026-09-01 10:41:59 -04:00
Brad King f19b680c9a Merge topic 'pre-commit-typos-version-bump+fix-typos'
76a8381c98 ci(pre-commit): version bump `typos` hook + fix found typos

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !12452
2026-09-01 10:39:32 -04:00
Brad King 457b8a2acb Merge branch 'release-4.4' 2026-09-01 09:13:33 -04:00
Brad King 142bbc166c Merge topic 'doc-cpack-D'
af4e79b101 Help/manual/cpack: Document when `-D<var>=<value>` form was added

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !12451
2026-09-01 09:13:32 -04:00
Brad King 7973ccc395 Merge topic 'doc-cpack-D' into release-4.4
af4e79b101 Help/manual/cpack: Document when `-D<var>=<value>` form was added

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !12451
2026-09-01 09:13:30 -04:00
Kitware Robot 2f319547d1 CMake Nightly Date Stamp 2026-09-01 00:06:26 -04:00
Brad King e9c3a8a1d8 Tests/RunCMake/ParseImplicit*Info: Run more cases on Windows hosts
The KWSys actual-case cache no longer exists, so we can run
the cases it previously broke on Windows hosts.
2026-08-31 15:22:12 -04:00
Brad King 7716efa3c6 Tests/RunCMake/ParseImplicitLinkInfo: Run more cases on non-Windows hosts 2026-08-31 15:22:11 -04:00
Brad King 769bff22d9 Tests/RunCMake/ParseImplicitIncludeInfo: Simplify platform exclusions 2026-08-31 15:22:11 -04:00
leha-bot af4e79b101 Help/manual/cpack: Document when -D<var>=<value> form was added
Closes: #28059
2026-08-31 12:32:30 -04:00
scivision 32c8a4bd01 LLVMFlang: Add support for COMPILE_WARNING_AS_ERROR
LLVM/Flang has supported `-Werror` since version 13.
2026-08-31 12:05:01 -04:00
Brad King 3c3ea1421a Merge topic 'jsonstate-fuzz'
8048ba5678 cmJSONParserFuzzer: Add array test case
286d490845 cmJSONParserFuzzer: Port to use cmJSONState
59733a83be cmJSONState: Catch exceptions during parsing

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !12447
2026-08-31 11:51:44 -04:00
Brad King d4d7c4116b Merge topic 'sarif-exe-info'
afcf9ac341 SARIF: Report information about processes invoked in the SARIF log

Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: buildbot <buildbot@kitware.com>
Merge-request: !12439
2026-08-31 11:50:18 -04:00
Brad King a13db261f6 Merge topic 'cpack-nsis-exe-dir'
6b695daab8 CPack/NSIS: Fix PATH modification without "bin" directory

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !12449
2026-08-31 11:40:40 -04:00
Brad King d4c466aa3b Merge topic 'ctest-preset-unreachable'
2cf0f3713f cmCTest: Sprinkle CM_{FALLTHROUGH,UNREACHABLE} a few more places

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: scivision <michael@scivision.dev>
Merge-request: !12450
2026-08-31 11:27:20 -04:00
Brad King afd855e80b Merge topic 'runtime-deps-case-sensitivity'
728e6ce203 file(GET_RUNTIME_DEPENDENCIES): Fix DLL case insensitivity for cross-compiling
4ce278389f cmBinUtilsWindowsPELinker: Resolve cased and lower names together
6ed37c9ed0 cmBinUtilsWindowsPELinker: Track cased and lower names more clearly
f7ce592c98 cmBinUtilsWindowsPELinker: Switch case conversion to value semantics
86846f57b8 cmBinUtilsWindowsPELinker: Factor out helper to store cased and lower names
343723dd56 cmBinUtilsWindowsPELinker: Reduce conditional block nesting

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !12437
2026-08-31 11:03:39 -04:00
Brad King a08b56e7ad Merge branch 'release-4.4' 2026-08-31 11:01:11 -04:00
Brad King ab498e7cad Merge topic 'revert-googletest-discovery'
5e5467bfc3 GoogleTest: Revert "Base on builtin command discover_tests"
c0ef680605 GoogleTest: Avoid else after return

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !12448
2026-08-31 11:01:11 -04:00
Brad King 6c32d5ed52 Merge topic 'revert-googletest-discovery' into release-4.4
5e5467bfc3 GoogleTest: Revert "Base on builtin command discover_tests"
c0ef680605 GoogleTest: Avoid else after return

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !12448
2026-08-31 11:01:07 -04:00
Kitware Robot 313ad95baa CMake Nightly Date Stamp 2026-08-31 00:05:44 -04:00
Kitware Robot 4db79cc9aa CMake Nightly Date Stamp 2026-08-30 00:07:33 -04:00
Tyler Yankee 8048ba5678 cmJSONParserFuzzer: Add array test case
This input makes jsoncpp throw a runtime error, which is caught by
cmJSONState.
2026-08-29 18:49:33 -04:00
Tyler Yankee 286d490845 cmJSONParserFuzzer: Port to use cmJSONState
Given that most call-sites throughout CMake now use the cmJSONState
wrapper instead of calling into jsoncpp directly, the fuzzing test
should also now go through the wrapper.
2026-08-29 18:49:33 -04:00
Tyler Yankee 59733a83be cmJSONState: Catch exceptions during parsing
When CMake is linked against a sufficiently new jsoncpp supporting
exceptions, and built with the configuration to enable it, we can more
gracefully recover from runtime errors when parsing bad inputs.
2026-08-29 18:49:33 -04:00
Kitware Robot 80c848cd10 CMake Nightly Date Stamp 2026-08-29 00:05:31 -04:00
Alex Turbov 76a8381c98 ci(pre-commit): version bump typos hook + fix found typos 2026-08-29 05:26:37 +04:00
Stepanov Igor 728e6ce203 file(GET_RUNTIME_DEPENDENCIES): Fix DLL case insensitivity for cross-compiling
When cross-compiling to Windows from a (Linux) host with a
case-sensitive filesystem, match DLL file names case-insensitively.

Fixes: #28049
2026-08-28 18:53:43 +03:00
Daniel Tierney afcf9ac341 SARIF: Report information about processes invoked in the SARIF log
Fixes: #27903
2026-08-28 11:27:44 -04:00
Pedro López-Cabanillas 6b695daab8 CPack/NSIS: Fix PATH modification without "bin" directory
Previously our NSIS project template hard-coded `$INSTDIR\bin` for
inclusion in the `PATH`.  If the directory does not exist, nothing is
done.  Use `CPACK_NSIS_EXECUTABLES_DIRECTORY` instead of `bin`.

Fixes: #15635
2026-08-28 11:18:18 -04:00
Daniel Pfeifer 5e5467bfc3 GoogleTest: Revert "Base on builtin command discover_tests"
Revert commit a324c2bb58 (GoogleTest: Base on builtin command
discover_tests, 2026-03-01, v4.4.0-rc1~30^2).  The `discover_tests`
implementation does not persist already-discovered tests across ctest
runs, making it much slower on projects whose test binaries take a while
just to start up and list tests.  Revert to the prior implementation
pending caching support in `discover_tests`.

Fixes: #28053
Issue: #28060
2026-08-28 11:08:59 -04:00
Tyler Yankee 2cf0f3713f cmCTest: Sprinkle CM_{FALLTHROUGH,UNREACHABLE} a few more places
Amend commit f460a199e3 (Source: Add and use CM_UNREACHABLE macro,
2026-08-23).
2026-08-28 10:30:30 -04:00
Daniel Pfeifer c0ef680605 GoogleTest: Avoid else after return
Commit c3c95f3010 (GoogleTest: Avoid generation error on duplicate
target test discovery, 2026-07-14, v4.4.1~24^2) has added a level of
indentation which made rebasing other changes harder than necessary.
Avoiding an else branch after a return command allows keeping the
original indentation.
2026-08-28 10:21:52 -04:00
Brad King 3773fb5a46 Merge topic 'option-git'
95eef05f28 Add option(CMake_VERSION_NO_GIT) for broken Git or slow filesystem

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !12442
2026-08-28 09:51:40 -04:00
Brad King 129c921fd0 Merge topic 'iar-fix-icstat-handler'
a17cbbee93 IAR: Add post-processing step in C-STAT outputs
4a8aeff8e4 IAR: Update ichecks error message
57fea01732 IAR: Fix malformed C-STAT command line

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !12441
2026-08-28 09:31:26 -04:00
Brad King c23b537168 Merge topic 'instrumentation-proc-metrics'
5f222e8f3a Instrumentation: Add Process Resource Usage Metrics
7204679f48 Merge branch 'upstream-KWSys' into instrumentation-proc-metrics
431a794a66 KWSys 2026-08-27 (8f4afc3e)

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !12381
2026-08-28 09:17:39 -04:00
Kitware Robot 68b467a889 CMake Nightly Date Stamp 2026-08-28 00:06:59 -04:00
Brad King 4ce278389f cmBinUtilsWindowsPELinker: Resolve cased and lower names together 2026-08-27 17:00:41 -04:00
Brad King 6ed37c9ed0 cmBinUtilsWindowsPELinker: Track cased and lower names more clearly 2026-08-27 16:58:03 -04:00
Brad King f7ce592c98 cmBinUtilsWindowsPELinker: Switch case conversion to value semantics 2026-08-27 16:51:57 -04:00