Alex Turbov
76a8381c98
ci(pre-commit): version bump typos hook + fix found typos
2026-08-29 05:26:37 +04:00
Alex Turbov
da9a8a3fbe
CPack/DEB: Fix regression when package architecture is explicitly specified
...
Since commit 302a645d73 (CPack/DEB: use `triggers` instead of legacy
postXXX scripts for `ldconfig`, 2026-03-05, v4.4.0-rc1~583^2) the
`triggers` feature refers to `DPKG_EXECUTABLE` if the latter is defined.
Unfortunately, it is defined only if one particular execution branch has
executed. Move the `find_program(dpkg)` to the function scope to make
it available in all execution branches.
2026-07-30 12:28:11 -04:00
Alex Turbov
8768b1f1e1
pre-commit: Add tutorial exceptions for IDs and typos 1.48.0
2026-07-07 14:50:06 -04:00
Alex Turbov
1ef92d645d
CPack/DEB: fix md5sums paths in dbgsym packages
...
The Debian `lintian` tool reported the dbgsym package issue as
`md5sums-lists-nonexistent-file`.
The DEB generator writes `md5sums` entries by stripping a top-level prefix
from each packaged file path. That used `CPACK_TEMPORARY_DIRECTORY`, which
works for regular debs but not for dbgsym packages.
Dbgsym package files are collected from `GEN_DBGSYMDIR` and passed to
`DebGenerator` with `WorkDir` rooted there. Because the `md5sums` writer
stripped `TemporaryDir` instead, the prefix did not match and absolute
staging paths leaked into `md5sums`.
Strip `WorkDir` instead. That is the actual root of `PackageFiles` for both
regular deb and dbgsym package generation, so `md5sums` entries stay
relative in both cases.
2026-04-12 07:37:49 +04:00
Alex Turbov
30aa150c25
CPack/RPM: CPACK_RPM_SPEC_MORE_DEFINE could be a list
...
Signed-off-by: Alex Turbov <i.zaufi@gmail.com >
2026-04-12 05:54:58 +04:00
Alex Turbov
427cf86cb8
cmCMakePresetsGraph: better name for a local variable of PrintPresets
2026-04-11 21:36:44 +04:00
Alex Turbov
0f3347bb27
cmCMakePresetsGraph: generalize printing presets of different types
2026-04-11 21:36:43 +04:00
Alex Turbov
9638624ebe
cmCMakePresetsGraph: move the static PrintPresets out of class
2026-04-11 21:35:27 +04:00
Alex Turbov
f60a1270bc
cmCMakePresetsGraph: move static members to private scope
2026-04-11 21:28:27 +04:00
Alex Turbov
0bf8df384c
cmCMakePresetsGraph: use std::setw instead of for-loop + one space at time
2026-04-11 21:28:20 +04:00
Alex Turbov
43a18bfaee
cmCMakePresetsGraph: simplify presets printing
...
Remove public type `PrintPrecedingNewline` and its pointer passing
to every printing function.
It's enough to have a static flag variable inside the `printPrecedingNewline()`.
2026-04-11 20:57:17 +04:00
Alex Turbov
9aa7036093
cmCMakePresetsGraph: printPrecedingNewline() no need to be a member
2026-04-11 20:57:17 +04:00
Alex Turbov
37853f25b7
cmCMakePresetsGraph: class -> typename in template declarations
2026-04-11 20:57:16 +04:00
Alex Turbov
661e8119dd
cmCMakePresetsGraph: move GetGeneratorForPreset from header to *.cxx file
2026-04-11 20:57:16 +04:00
Alex Turbov
943749a1d3
cmCMakePresetsGraph: use struct for class w/o methods and only public data
2026-04-11 20:57:13 +04:00
Alex Turbov
4249935d08
tests: Replace ls -l → stat --format=%A to get file permissions
2026-03-10 05:42:25 +04:00
Alex Turbov
1f939db3c4
CPack/RPM: Remove superfluous %clean section from generated spec file
...
According to [this] commit message in the `rpmlint` codebase,
a %clean section is not necessary since `rpm` 4.8.0 (2010)
and nowadays `rpmlint` at least issues a warning about it, and
(seems) in some distros it's even considered as an error.
[this]: https://github.com/rpm-software-management/rpmlint/commit/b1a8a422
2026-03-08 03:52:21 +04:00
Alex Turbov
302a645d73
CPack/DEB: use triggers instead of legacy postXXX scripts for ldconfig
2026-03-05 23:14:10 +04:00
Alex Turbov
f461382d42
CPack/DEB: rename variable w/ result of dpkg find to match other vars
2026-03-05 22:07:58 +04:00
Alex Turbov
8a8bceda98
CPack/DEB: rename internal variable
2026-03-05 22:06:12 +04:00
Alex Turbov
430eb26511
CPack/DEB: modernize parent scope variables pass
2026-03-04 21:29:45 +04:00
Alex Turbov
165889e7d2
CPack/DEB: refactor some functions to check for errors+exit earlier
...
… and deindent the rest of the function body.
2026-03-04 21:29:45 +04:00
Alex Turbov
ed04dda2a2
CPack/DEB: wrap too long lines
2026-03-04 21:29:45 +04:00
Alex Turbov
6978f9591c
CPack/DEB: remove redundant quotes and variable expansions
2026-03-04 21:29:44 +04:00
Alex Turbov
4c889716fa
CPack/DEB: modernize filesystem operations
2026-03-04 20:31:50 +04:00
Alex Turbov
b1f715a2ce
Help: Fix inline code RST markup in cmake-cxxmodules(7)
...
Found by `pre-commit`:
```
rst ``code`` is two backticks...............................................Failed
- hook id: rst-backticks
- exit code: 1
Help/manual/cmake-cxxmodules.7.rst:396: sources reverses (i.e., `a` importing `b` becomes `b` importing `a`) between
```
2026-03-04 09:49:47 -05:00
Alex Turbov
41500ba575
CPack/RPM: avoid ls -la process fork in tests
...
Use `file(READ_SYMLINK)` instead.
2026-03-03 21:51:16 +04:00
Alex Turbov
963a022782
CPack/RPM: wrap some too long lines
2026-03-03 21:42:47 +04:00
Alex Turbov
17a39084c2
CPack/RPM: some other simplifications
2026-03-03 21:42:47 +04:00
Alex Turbov
0966151c73
CPack/RPM: modernize file and path operations
2026-03-03 21:42:47 +04:00
Alex Turbov
16407d6934
CPack/RPM: escape regex in the modern way
2026-03-03 21:42:46 +04:00
Alex Turbov
9ed6106a27
CPack/RPM: remove redundant quotes and variable expansions
2026-03-03 21:42:38 +04:00
Alex Turbov
d7701b758b
CPack/RPM: use list transform instead of string manipulations
2026-03-03 21:41:52 +04:00
Alex Turbov
fd321c02c5
CPack/RPM: ls -la execution + parse → file(READ_SYMLINK)
2026-03-03 21:41:52 +04:00
Alex Turbov
8549727ff4
CPack/RPM: use the modern return(PROPAGATE…)
2026-03-03 21:41:52 +04:00
Alex Turbov
2fe2665541
CPack/RPM: execute stat to get permissions instead of ls -l
...
Ask `stat` to output only human-readable permissions and nothing else.
Secondly, simplify parsing algorithm. Instead of multiple regex matches
transform permissions into a list and split into groups.
2026-03-03 21:41:52 +04:00
Alex Turbov
69691f5bb2
pre-commit: version bump typos hook + fix found typo
2026-03-02 09:54:13 -05:00
Alex Turbov
6445447692
CPack/RPM: modernize foreach calls to use IN LISTS/ITEMS
2026-02-28 02:27:38 +04:00
Alex Turbov
06460b7764
expat: Fix linking with system Expat via its CMake package
...
The Expat package intentionally provides the lowercase imported target
name `expat::expat` [1]. CMake performs `find_package(EXPAT)` w/o
specifying a finding mode (CONFIG or MODULE). However, if a user
provides `CMAKE_FIND_PACKAGE_PREFER_CONFIG=TRUE`, the build fails due to
an unknown `EXPAT::EXPAT` target.
[1] https://github.com/libexpat/libexpat/tree/R_2_7_4/expat#using-libexpat-in-your-cmake-based-project
Issue: #27646
2026-02-25 11:42:12 -05:00
Alex Turbov
000d572d04
CPack.cmake: reduce foreach iterations count matching CPACK* vars
2026-01-08 22:36:50 +04:00
Alex Turbov
472a04ab9e
ci(pre-commit): bump pre-commit hooks + fixes of found typos
2025-11-26 02:32:04 +04:00
Alex Turbov
1405dc49e8
pre-commit: version bump typos and sphinx-lint hooks + fix found typos
2025-11-03 10:18:16 -05:00
Alex Turbov
2ca11db2e3
pre-commit: version bump typos hook plus fix found typos
...
Backport commit 8de02a14c8 (ci(pre-commit): version bump `typos` hook
plus fix found typos, 2025-10-23) to the CMake 4.2 release branch.
2025-10-30 17:43:16 -04:00
Alex Turbov
8de02a14c8
ci(pre-commit): version bump typos hook plus fix found typos
2025-10-23 21:14:25 +04:00
Alex Turbov
cb07358256
cmake_language: add TRACE subcommand
...
Closes 27235.
2025-09-23 03:02:03 +04:00
Alex Turbov
f100769d72
Add SKIP_LINTING target property and CMAKE_SKIP_LINTING variable
...
These offer target-wide settings to disable lints.
Closes : #27191
2025-09-09 09:56:35 -04:00
Alex Turbov
8fb6449275
ci: Update to typos 1.36.1 in Fedora base image
2025-09-08 12:20:28 -04:00
Alex Turbov
49e05f9569
pre-commit: bump to typos 1.36.1
2025-09-08 12:17:47 -04:00
Alex Turbov
20e19a713d
Source: Fix typo discovered by typos 1.36.1
2025-09-08 12:14:39 -04:00
Alex Turbov
0d6b5d54b2
Tests/RunCMake/MultiLint: Extract test preparation code into separate file
2025-09-04 09:40:18 -04:00
Alex Turbov
3a21092d75
Tests/RunCMake/MultiLint: Refactor test runs
2025-09-04 09:40:05 -04:00
Alex Turbov
15d558016c
pre-commit: change the repo and version bump typos hook
2025-06-24 20:40:11 +04:00
Alex Turbov
45b374234a
Help: fix typo found by the sphinx-lint plugin of pre-commit
2025-06-20 14:26:39 -04:00
Alex Turbov
9784834b4c
Help: Use *.rst extension for included files
...
So, editor(s) can correctly highlight the RST syntax in the included files.
2025-04-14 03:07:46 +04:00
Alex Turbov
d6aeb98869
pre-commit: ignore all text after scissor line in COMMIT_EDITMSG
...
If `git` is configured to open an editor on commit (to edit a commit
message), it adds a `git diff` below the scissor line. Tell `typos`
to ignore everything below it.
2025-03-10 10:30:16 -04:00
Alex Turbov
d168cd397f
pre-commit: version bump typos hook to 1.30 + add some more ignore IDs
2025-03-04 04:28:07 +04:00
Alex Turbov
4d99e2b702
Help(FindJasper): Fix the spelling typo in the variable documentation
2025-03-04 04:25:36 +04:00
Alex Turbov
4558c8f9ff
ci: Use typos to check commit messages
...
Commit messages in the CMake repo may have Git hashes that can trigger
false positives in the `typos` checker.
Revert commit ddebf4653d (ci: Do not check commit messages with 'typos'
due to false positives, 2025-02-07). Instead, copy the top-level config
file to a temporary location, add a configuration option to mark
10-hex-digit identifiers as always valid, and pass it to `typos` at the
commit checking phase.
2025-02-14 10:10:12 -05:00
Alex Turbov
72cce810ce
ci(fedora41-hip): update the image in sync w/ fedora41
...
- Use the correct path for the DNF cache.
- There is not much sense in having a DNF cache image separately when
the only `RUN` command is to install required packages.
2025-02-03 11:05:58 -05:00
Alex Turbov
fa08bd803d
ci(fedora41): refactor tests removal from Python packages
2025-02-03 11:05:57 -05:00
Alex Turbov
0e5159656a
ci(fedora41): split install prerequisites and build for Rust packages
2025-02-03 11:05:55 -05:00
Alex Turbov
88c5cf809a
ci(fedora41): split install prerequisites and build RBEnv into separate phases
...
It improves parallelization and speeds up the build by reusing cached layers.
2025-02-03 11:05:54 -05:00
Alex Turbov
86e96322eb
ci(fedora41): tune RVM build to speedup and minimize the final image
...
- Do not waste time looking for pre-built images for Fedora.
Tell to `rvm` to always build from sources.
- No need to update startup files (in the intermediate image).
- Exclude useless (documentation) files from the final archive.
2025-02-03 11:05:52 -05:00
Alex Turbov
264c902403
ci(fedora41): split install prerequisites and build RVM into separate phases
...
It improves parallelization and speeds up the build by reusing cached layers.
2025-02-03 11:05:51 -05:00
Alex Turbov
59383f6509
ci(fedora41): use cache for IWYU build
2025-02-03 11:05:49 -05:00
Alex Turbov
dc9b7a15c0
ci(fedora41): split install prerequisites and build IWYU into separate phases
...
It improves parallelization and speeds up the build by reusing cached layers.
2025-02-03 11:05:48 -05:00
Alex Turbov
4b0ac15b49
ci(fedora41): use CMake to build and install IWYU
...
… instead of calling underlaid buildsystem tool. Also, add parallelization.
2025-02-03 11:05:46 -05:00
Alex Turbov
1edede9276
ci(fedora41): move Perforce download to a separate image
...
It improves parallelization and speeds up the build.
Since downloading is a quick task, put the results to the final image
at the beginning to avoid waiting for other (longer) tasks.
2025-02-03 11:05:45 -05:00
Alex Turbov
8946e0a3ba
ci(fedora41): drop unused cache mount
2025-02-03 11:05:44 -05:00
Alex Turbov
d2c34c95d9
ci(fedora41): restore the path to dnf cache
...
So, images would really use it again!
This reduce build time up to 25%!
This was accidentally broken by commit 46d89b8524 (ci: update Linux
image to Fedora 41, 2024-10-23, v3.31.0-rc3~7^2~2) by misdiagnosing an
error.
2025-02-03 11:05:42 -05:00
Alex Turbov
5eb8f47b67
ci(fedora41): use dnf.conf for options and simplify dnf install CLI
2025-02-03 11:05:40 -05:00
Alex Turbov
b5a36e1efc
ci(fedora41): sort dependency lists
2025-02-03 11:05:38 -05:00
Alex Turbov
31f0e8dd92
ci(fedora41): remove duplicate dependency package
2025-02-03 11:05:24 -05:00
Alex Turbov
8d8fd9de2c
Help: Fix typos in RST found by the rst-backticks hook
2025-02-02 18:56:26 +04:00
Alex Turbov
7d4086d239
codespell: Fix one more typo found by version 2.4
...
Was missed in the MR 10236 ;-(
2025-01-28 17:39:03 +04:00
Alex Turbov
d2752135cb
codespell: Fix typos found by version 2.4
2025-01-27 10:55:58 -05:00
Alex Turbov
b83c5b2c83
pre-commit: Add pygrep-hooks repo and 3 hooks to check RST files
2025-01-27 02:06:56 +04:00
Alex Turbov
bc4c71627a
Help: Fix typos found by the rst-backticks hook
...
The corresponding `pre-commit` configuration is coming in the
separate MR.
Signed-off-by: Alex Turbov <i.zaufi@gmail.com >
2025-01-27 01:43:26 +04:00
Alex Turbov
c833629508
Help: Fix typos found by the rst-directive-colons hook
...
The corresponding `pre-commit` configuration is coming in the
separate MR.
Signed-off-by: Alex Turbov <i.zaufi@gmail.com >
2025-01-27 01:00:46 +04:00
Alex Turbov
abe46bf9e1
pre-commit: Add the clang-format hook
...
The hook version is the same as the `.clang-format` config file.
2025-01-26 05:43:33 +04:00
Alex Turbov
8f4dd0558e
pre-commit: Add the typos hook for extra spellchecking
...
Also, use it to spellcheck commit messages.
2025-01-26 05:38:56 +04:00
Alex Turbov
54eba3a42a
pre-commit: Add the codespell hook
...
Also, use it to spellcheck commit messages.
2025-01-26 05:38:52 +04:00
Alex Turbov
244e3d314c
pre-commit: Add the sphinx-lint hook
2025-01-26 05:34:18 +04:00
Alex Turbov
efa7c6aedf
pre-commit: Add a hook to check whitespaces and conflict markers
...
The hook uses settings from `.gitattributes`.
2025-01-26 05:34:18 +04:00
Alex Turbov
2c06b9f429
pre-commit: Add a hook to fix missed EOL at the end of files
...
For now some files from `Tests/` have been excluded. However,
some files could be really fixed and removed from exclude list.
2025-01-26 05:34:18 +04:00
Alex Turbov
1861948755
pre-commit: Add a hook to check JSON files
2025-01-26 05:34:17 +04:00
Alex Turbov
4b34c07205
pre-commit: Add a hook to check YAML files
2025-01-26 05:34:17 +04:00
Alex Turbov
3a73e1b8f4
pre-commit: Add a hook to strip trailing whitespaces on commit
2025-01-26 05:34:17 +04:00
Alex Turbov
8e832f0084
pre-commit: Add a hook to check files for mixed line endings
2025-01-26 05:34:17 +04:00
Alex Turbov
de59765336
pre-commit: Add an initial configuration file
...
Add (except some meta-hooks) the `check-case-conflict` hook to
make sure the repo don't contain files that can cause a conflict
on case-insensitive filesystems.
Also, exclude third-party sources from further checks.
2025-01-26 05:34:15 +04:00
Alex Turbov
d34971f455
Refactor: Eliminate redundant std::to_string as arg of cmStrCat
...
Plus optimize some other string operations in the modified files.
2025-01-26 04:03:38 +04:00
Alex Turbov
c3777c1536
ci: Extend spellcheck job with 'typos' tool
...
Unlike the `codespell`, `typos` is capable of finding typos
in combined identifiers (`CamelCase` or `snake_case`).
2025-01-22 08:51:45 -05:00
Alex Turbov
d620d77d26
FindDoxygen: Rename _Doxygen_dne_header -> _Doxygen_do_not_edit_header
2025-01-12 18:49:35 +04:00
Alex Turbov
e7ff3cccea
PushToAndroidDevice.cmake: Rename cmake_parse_arguments prefix
...
The upcoming `typos` spell checker don't like the old prefix,
so to avoid further false-positive, let's rename it to a more generic
and a bit more readable `_arg`.
2025-01-12 18:49:34 +04:00
Alex Turbov
bc8621d999
Fix: A lot of typos in code found by typos
...
Yet another great code spellchecker: https://github.com/crate-ci/typos/
(Will be added later as a `pre-commit` hook)
2025-01-12 18:49:34 +04:00
Alex Turbov
b33beb7af5
Help: Fix some typos found by sphinx-lint
...
Particularly,
- Avoid TABs in RST docs.
- Avoid words ending w/ hyphen at the right side of pharagraphs.
2025-01-12 18:49:34 +04:00
Alex Turbov
78e45c2db6
Style: Replace TABs with spaces for indentation in some files
...
Mark files that must use TABs to indent in the `.gitattributes`.
Use space instead of TABs in sources and some data/test files.
2025-01-12 18:49:25 +04:00
Alex Turbov
b65930a7a7
Fortran: Add Fortran_BUILDING_INTRINSIC_MODULES for building intrinsics
...
In commit fe3f846e1b (Makefiles: Add support for building Fortran
intrinsics, 2020-11-19, v3.22.0-rc1~565^2) the property was added with
incorrect spelling `Fortran_BUILDING_INSTRINSIC_MODULES`. Add a new
property with the correct spelling. Keep the old one for compatibility.
Issue: #21463
2025-01-09 15:30:00 -05:00
Alex Turbov
74e0173f66
Tests(NuGet): Fix the test to ignore empty and space-only lines
2025-01-06 04:16:32 +04:00
Alex Turbov
c225897ca0
cmExportCMakeConfigGenerator: Optimize std::ostream::operator<< calls
2024-12-11 19:40:45 +04:00