218 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 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 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
Tyler Yankee 09ded3a354 Help/dev: Note cm::unreachable and CM_UNREACHABLE
Encourage this pattern throughout our sources for optimization and
consistent style.
2026-08-26 13:37:01 -04:00
Brad King eb708db6f8 Merge topic 'sphinx-copybutton'
392a79b910 Help/dev: Document use of sphinx-copybutton
1c5e70c9d0 bootstrap: Add --sphinx-html-copybutton option
1b1225a766 ci: Enable Sphinx copybutton for cmake.org and Sphinx jobs
6e2301357d ci: Add sphinx-copybutton extension to Fedora base image
ad5a65dd34 Utilities/Sphinx: Add option to build with copybutton
59875d4a08 Tests/FindImageMagick: Tolerate pre-release versions
45a426a4e3 codespell: Fix some hyphenated spellings

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !12424
2026-08-24 11:34:23 -04:00
Tyler Yankee 392a79b910 Help/dev: Document use of sphinx-copybutton
Add a section on third-party Sphinx extensions. While we're here, add
a cross-reference on CMake's `README.rst`.
2026-08-21 09:43:48 -04:00
Ben Boeckel ed603380f1 Help/dev/review: mention the new Do: test --tag flag 2026-08-19 22:25:04 -04:00
Ben Boeckel 67e086d29c Help/dev/review: mention behavior of multiple Do: test --stage behavior 2026-08-19 22:24:55 -04:00
Vito Gamberini ab1bd6f6c6 c++modules: Remove CXX_MODULE_STD and CMAKE_CXX_COMPILER_IMPORT_STD
Fixes: #27966, #27992, #28000
2026-08-03 10:05:34 -04:00
Brad King dfd1cf8d87 Merge topic 'import-std-refactor'
42d2d63235 c++modules: Copy props from BMI consumers more correctly
6d3e9d8220 c++modules: single import std target

Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: buildbot <buildbot@kitware.com>
Reviewed-by: Ben Boeckel <ben.boeckel@kitware.com>
Merge-request: !12193
2026-06-22 18:21:02 -04:00
Vito Gamberini 6d3e9d8220 c++modules: single import std target 2026-06-18 15:20:54 -04:00
Daniel Tierney b533f229b8 cmSbom: Generate SPDX data denoting project licenses 2026-06-15 14:40:26 -04:00
Brad King f4c858d328 Merge topic 'multi_export_sbom'
2900aa2911 SBOM: Update experimental UUID
273fc4cc49 SBOM: Support multi export set SBOMs
9669829573 Install: Refactor ResolveTargetsInGeneratorExpression
7c31cbf9ae SBOM: Handle PACKAGE_URL argument

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !12080
2026-06-02 09:15:40 -04:00
Tom Osika 2900aa2911 SBOM: Update experimental UUID 2026-06-01 12:27:13 -04:00
Brad King 645ca80972 Merge topic 'rust-make'
1102abd224 ci: Enable Rust tests in Fedora + Unix Makefiles configuration
03ac6b9c2b Rust: Update experimental UUID
8154a4bc5c Rust: Add support for compiling Rust with Makefile generator

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !12105
2026-05-27 11:45:23 -04:00
Baudouin Feildel 03ac6b9c2b Rust: Update experimental UUID 2026-05-25 22:18:25 +02:00
Ben Boeckel 575c3dd990 builddb: support builds with empty configuration
Rotates the UUID to indicate changed behavior.

See: https://discourse.cmake.org/t/15654
2026-05-22 13:51:06 -04:00
scivision c720e2a23d Help: Document execute_process(RESULT_VARIABLE) capture in source code guide
Issue: #27782
2026-05-07 13:42:00 -04:00
Matthew Woehlke 3cccce8ca2 Help: Add developer documentation for new diagnostics
Add a developer-targeted document explaining the basics of how to use
CMake 4.4's new diagnostic framework.
2026-04-30 15:36:23 -04:00
Matthew Woehlke ffe4c2a8ff Help: Fix developer documentation
HTML is not normally generated for developer documentation. As a result,
the validity of the reST is effectively never checked, and thus contains
a small handful of issues (mostly bad indent). Fix these.
2026-04-30 14:19:54 -04:00
Baudouin Feildel abe64ca2d3 Rust: Update experimental UUID 2026-03-26 23:15:58 +01:00
Brad King 9cfa221b88 Merge topic 'ai-policy'
475cc5487f Help: Document CMake's AI policy

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !11842
2026-03-23 08:18:50 -04:00
Craig Scott 475cc5487f Help: Document CMake's AI policy 2026-03-21 08:35:50 +11:00
Baudouin Feildel e6a544836b Rust: Update experimental UUID 2026-03-20 09:42:44 -04:00
Marc Chevrier ec2daddf47 cmext/algorithm: add helpers functions cm::keys and cm::values 2026-03-14 11:55:55 +01:00
Marc Chevrier 19453a1749 Add cm::ranges::views::Keys and cm::ranges::views::values templates
Add, from c++20, templates to manage keys and values. This is a subset of
std::ranges::views::keys and std::ranges::views::values templates.

Moreover, the cm::is_pair and cm::is_tuple helpers are provided to check,
respectively, if the type is a std::pair or a std::tuple.
2026-03-09 23:27:10 +01:00
Brad King c1d58d3f3d Experimental: Restore import std gate
Several problems with this feature came up while testing 4.3.0-rc1.
These include both broken stdlib distributions and regressions in our
implementation of the feature since CMake 4.2.

Revert commit 70c1f0f43d (Experimental: Remove import std experimental
gate, 2026-02-04, v4.3.0-rc1~61^2) except for its incidental fixes.

Remove the 4.3 release notes related to `import std`.

Rotate the experimental gate's UUID.

Issue: #27426
Issue: #27597
Issue: #27626
Issue: #27635
2026-02-26 17:19:19 -05:00
Brad King 2e29354040 Experimental: Restore documentation link to CPS
This was accidentally removed by commit 70c1f0f43d (Experimental: Remove
import std experimental gate, 2026-02-04, v4.3.0-rc1~61^2).
2026-02-26 16:17:30 -05:00
Matthew Woehlke f5c515cbf2 CPS: Remove experimental gate (mostly)
Remove basic CPS import and export from 'experimental' status. Update
documentation and tests accordingly.

Note that mapped exports (CMAKE_EXPERIMENTAL_MAPPED_PACKAGE_INFO) are
still experimental.
2026-02-11 16:10:29 -05:00
Brad King e686b86649 Merge topic 'import-std-no-experimental'
70c1f0f43d Experimental: Remove import std experimental gate

Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: buildbot <buildbot@kitware.com>
Merge-request: !11657
2026-02-08 09:18:01 -05:00
Vito Gamberini 70c1f0f43d Experimental: Remove import std experimental gate
Fixes: #27571
2026-02-07 09:03:43 -05:00
Ayush Singh 5c1b0a6b7e Rust: Add experimental support with Ninja
The TU for Rust is a crate, not per-source.  `rustc` expects entry file
to TU as input, and cannot work with object files.  So we need to have
one-step build/link in most cases, similar to what old Swift was doing.

Issue: #25492
Signed-off-by: Ayush Singh <ayush@beagleboard.org>
2026-02-06 11:32:56 -05:00
Martin Duffy 95dc40d8a8 Experimental: Remove Instrumentation experimental gating
Fixes: #27348
2026-02-05 14:05:42 -05:00
Brad King e9b2f1ff5e Merge topic 'filesystem-path-enhancements'
b86a77e8c8 cm::filesystem::path: ensure independence from the program locale.

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !11583
2026-01-16 10:05:04 -05:00
Marc Chevrier b86a77e8c8 cm::filesystem::path: ensure independence from the program locale.
Fixes: #27472
2026-01-15 19:44:14 +01:00
Matthew Woehlke 28647db676 Experimental: Add CMAKE_EXPERIMENTAL_MAPPED_PACKAGE_INFO
Update experimental documentation to mention support for generating CPS
package info from `install(EXPORT)`.
2026-01-14 13:06:17 -05:00
Matthew Woehlke 197099e393 Experimental: Update PACKAGE_INFO, SBOM documentation
Update experimental documentation to mention that the `install`
command's PACKAGE_INFO and SBOM modes have an `export` equivalent.
2026-01-14 13:06:17 -05:00
Matthew Woehlke a121e5d49e export: Reset CPS export experimental gate
Change the UUID associated with CPS export. This is in preparation for
refactoring the `export` command interface.
2026-01-09 11:28:05 -05:00
Taylor Sasser 8ec5a595cd cmSbom: Add documentation for install(SBOM) and export(SBOM) 2025-12-17 14:35:12 -05:00
ferdymercury 7323fbd65e Help: Be more explicit about what ...<policy_max> does not mean
Also use `<policy_max>` more consistently in signatures.
2025-12-02 15:25:47 -05:00
Taylor Sasser 985b0f5bcf CMake C++11 Compatibility: Add more type_traits from C++14 and C++17 2025-10-22 13:01:12 -04:00
Alex Overchenko 2b5fcf1d07 Help/dev: Fix typo in Source Code Guide 2025-10-06 10:20:03 -04:00
Brad King f1ce50dc81 cmVersionMacros: Adopt CMake_VERSION_DEVEL
Rename it from DEVEL_CMAKE_VERSION.  It requires version macros
not guaranteed to be available from its old header anyway.
2025-09-24 17:40:40 -04:00
Martin Duffy b8014633dc Experimental: Update the Instrumentation UUID
Update experimental UUID for instrumentation after commit 4683db44a1
(instrumentation: Write index files to data/index/ subdirectory, 2025-09-19)
updated the location of index files.
2025-09-23 10:59:54 -04:00
Tyler Yankee 7c13444fb5 Experimental: Update the Instrumentation UUID
Update experimental UUID for instrumentation after commit fbb5b47fbf
(instrumentation: Rename postTest and postInstall hooks, 2025-09-04)
broke old hook names.
2025-09-04 14:01:17 -04:00
Tyler Yankee 8d04c4d741 Experimental: Update the Instrumentation UUID
Update experimental UUID for instrumentation after commit bf52fbfbc4
(instrumentation: Add Google trace output, 2025-08-28) introduced a
significant feature.
2025-09-03 15:24:40 -04:00
Taylor Sasser 9d93853405 Help: Add documentation for debugging with GDB 2025-08-14 10:44:18 -04:00