From: Patrick Steinhardt Date: Thu, 19 Mar 2026 05:33:19 GMT Subject: [PATCH v3 0/8] Some build system improvements Message-ID: <20260319-b4-pks-build-infra-improvements-v3-0-82f5fb3edc3f@pks.im> In-Reply-To: <20260310-b4-pks-build-infra-improvements-v1-0-ec75d0710d6a@pks.im> Hi, this patch series contains a small set of build system improvements: - The first couple patches introduce a new "tools/" directory that contains items related to our build infrastructure and to our developer tooling. This finally follows up on my promise to do this back when I did the spring clean of "contrib/". [1] - The last couple patches introduce precompiled headers into Meson for a nice compilation speedup of ~30%. It's The two topics are not really related with one another other than being related to build systems. I decided to throw them in the same patch series though so that I can introduce "precompiled.h" in "tools/". Changes in v3: - Improve commit message. - Link to v2: https://lore.kernel.org/r/20260316-b4-pks-build-infra-improvements-v2-0-4b2c2c0c0425@pks.im Changes in v2: - Turn array of precompiled headers into a simple string. - Point out in the commit message that the precompiled header is included implicitly. - Link to v1: https://lore.kernel.org/r/20260310-b4-pks-build-infra-improvements-v1-0-ec75d0710d6a@pks.im Thanks! Patrick [1]: https://lore.kernel.org/git/20250506-pks-contrib-spring-cleanup-v1-0-e6d5ddd79a72@pks.im/ --- Patrick Steinhardt (8): Introduce new "tools/" directory contrib: move "coccinelle/" directory into "tools/" contrib: move "coverage-diff.sh" script into "tools/" contrib: move "update-unicode.sh" script into "tools/" builds: move build scripts into "tools/" git-compat-util.h: move warning infra to prepare for PCHs meson: compile compatibility sources separately meson: precompile "git-compat-util.h" Makefile | 76 ++++++++--------- ci/run-static-analysis.sh | 2 +- config.mak.dev | 2 +- contrib/buildsystems/CMakeLists.txt | 18 ++-- contrib/meson.build | 1 - contrib/subtree/meson.build | 2 +- git-compat-util.h | 8 +- meson.build | 96 +++++++++++++--------- tools/README.md | 7 ++ check-builtins.sh => tools/check-builtins.sh | 0 {contrib => tools}/coccinelle/.gitignore | 0 {contrib => tools}/coccinelle/README | 2 +- {contrib => tools}/coccinelle/array.cocci | 0 {contrib => tools}/coccinelle/commit.cocci | 0 .../coccinelle/config_fn_ctx.pending.cocci | 0 {contrib => tools}/coccinelle/equals-null.cocci | 0 {contrib => tools}/coccinelle/flex_alloc.cocci | 0 {contrib => tools}/coccinelle/free.cocci | 0 .../coccinelle/git_config_number.cocci | 0 {contrib => tools}/coccinelle/hashmap.cocci | 0 .../coccinelle/index-compatibility.cocci | 0 {contrib => tools}/coccinelle/meson.build | 0 {contrib => tools}/coccinelle/object_id.cocci | 0 {contrib => tools}/coccinelle/preincr.cocci | 0 {contrib => tools}/coccinelle/qsort.cocci | 0 {contrib => tools}/coccinelle/refs.cocci | 0 {contrib => tools}/coccinelle/spatchcache | 6 +- {contrib => tools}/coccinelle/strbuf.cocci | 0 {contrib => tools}/coccinelle/swap.cocci | 0 {contrib => tools}/coccinelle/tests/free.c | 0 {contrib => tools}/coccinelle/tests/free.res | 0 {contrib => tools}/coccinelle/the_repository.cocci | 0 {contrib => tools}/coccinelle/xcalloc.cocci | 0 {contrib => tools}/coccinelle/xopen.cocci | 0 .../coccinelle/xstrdup_or_null.cocci | 0 {contrib => tools}/coccinelle/xstrncmpz.cocci | 0 {contrib => tools}/coverage-diff.sh | 0 detect-compiler => tools/detect-compiler | 0 generate-cmdlist.sh => tools/generate-cmdlist.sh | 0 .../generate-configlist.sh | 0 generate-hooklist.sh => tools/generate-hooklist.sh | 0 generate-perl.sh => tools/generate-perl.sh | 0 generate-python.sh => tools/generate-python.sh | 0 generate-script.sh => tools/generate-script.sh | 0 tools/meson.build | 1 + tools/precompiled.h | 1 + {contrib => tools}/update-unicode/.gitignore | 0 {contrib => tools}/update-unicode/README | 0 .../update-unicode/update_unicode.sh | 0 49 files changed, 123 insertions(+), 99 deletions(-) Range-diff versus v2: 1: 051b66376f = 1: bc18fe2f2d Introduce new "tools/" directory 2: 275a96c805 = 2: 393b42f433 contrib: move "coccinelle/" directory into "tools/" 3: afc5a1f8b9 = 3: 00284934e9 contrib: move "coverage-diff.sh" script into "tools/" 4: 909d996f56 = 4: 9dceec07dd contrib: move "update-unicode.sh" script into "tools/" 5: 6396ae723e = 5: af0ce83627 builds: move build scripts into "tools/" 6: 16b0e9f4fb = 6: 8cb7ea8245 git-compat-util.h: move warning infra to prepare for PCHs 7: b4cd150fdf ! 7: 495335a97a meson: compile compatibility sources separately @@ Commit message This is okay for our "normal" library sources and our builtins. But some of our compatibility sources do not include the header on purpose, and - doing so would cause compileir errors. + doing so would cause compilation errors. Prepare for this change by splitting out compatibility sources into - their static library. Like this we can selectively enable precompiled + their static library. Like this, we can selectively enable precompiled headers for the library sources. Signed-off-by: Patrick Steinhardt 8: 5899e0318b = 8: 6923592b62 meson: precompile "git-compat-util.h" --- base-commit: af2c8a61818d773325ef2324dd135786a03ebca0 change-id: 20260304-b4-pks-build-infra-improvements-cc4012c5364e