Fix meson.build, add CI job to validate it - #670
Open
kolyshkin wants to merge 3 commits into
Open
Conversation
|
Ephemeral COPR build failed. @containers/packit-build please check. |
Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
The meson build was not covered by CI at all -- all workflows build via the Makefile or nix. As a result, meson.build can silently rot between releases, which is how the deprecated run_command and source_root usages accumulated in the first place. Add a meson-build job to the validate workflow that configures and builds with meson, so breakage is caught at PR time. Note that --fatal-meson-warnings is deliberately not used, since it also trips on the pre-existing "consider using the built-in optimization level" style warnings for -Os/-Wall/-Werror, which are a separate issue. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
Passing these as raw c_args makes meson emit three warnings: WARNING: Consider using the built-in optimization level instead of using "-Os". WARNING: Consider using the built-in warning_level option instead of using "-Wall". WARNING: Consider using the built-in werror option instead of using "-Werror". Use the corresponding built-in options instead, which silences them and lets the meson-build CI job enable --fatal-meson-warnings, so future deprecations fail the build rather than accumulating unnoticed. The resulting compiler flags are equivalent. Before: -Wall -Winvalid-pch -std=c99 -O0 -g -Os -Wall -Werror After: -Wall -Winvalid-pch -Werror -std=c99 -Os -g The duplicate -Wall collapses, since warning_level=1 already emitted one, and -O0 (from the default debug buildtype) disappears as it was being overridden by the trailing -Os regardless. Note this makes the settings overridable: -Doptimization=2 or -Dwerror=false are now honored, whereas add_project_arguments forced them unconditionally. This is generally desirable for distro packaging, which often needs -Werror disabled to survive new compiler releases. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
kolyshkin
force-pushed
the
meson-ci-653
branch
from
August 14, 2026 21:33
3d3c30f to
7102106
Compare
Collaborator
Author
|
Rebased on top of just-merged #669 |
jnovy
approved these changes
Aug 15, 2026
jnovy
left a comment
Collaborator
There was a problem hiding this comment.
LGTM. All three commits are correct - deprecation fixes, CI job, and built-in option migration are well done.
One suggestion: meson.build has src/ctr_logging.c and src/ctr_logging.h listed twice in the executable() source list (pre-existing, not introduced by this PR). Meson silently deduplicates today, but since this PR adds --fatal-meson-warnings to CI, a future meson release that warns about duplicate sources would break the new job. Might be worth adding a 4th commit to deduplicate while you are already touching this file.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Carrying #653.
The meson build is not covered by CI at all --
validaterunsmake fmt,coverageandintegrationbuild via the Makefile, andstaticbuilds via nix. Nothing invokes meson, someson.buildcan silently rot between releases. That is how the deprecatedrun_commandandmeson.source_root()usages fixed in #653 accumulated in the first place.This PR:
meson: fix deprecation warnings) unchanged.meson-buildjob to thevalidateworkflow, plus a/build/entry in.gitignoreso the meson build directory does not dirty local trees.-Os,-Walland-Werrorfrom rawc_argsto the corresponding meson built-in options, which silences the last three warnings and lets the CI job run with--fatal-meson-warnings. Future deprecations now fail the build instead of accumulating unnoticed.The compiler flags are unchanged in effect. Before:
After:
The duplicate
-Wallcollapses (warning_level=1already emitted one), and-O0from the default debug buildtype disappears since it was being overridden by the trailing-Osanyway.One deliberate behavior change worth reviewer attention: because these are now
default_options, they become overridable ---Doptimization=2and-Dwerror=falseare honored, whereasadd_project_argumentsforced them unconditionally. This is generally desirable for distro packaging, which often needs-Werroroff to survive new compiler releases, but it is a real change rather than a pure refactor.Verified locally from a clean clone with meson 1.11.2 and gcc 16.1.1:
meson setup --fatal-meson-warnings buildexits 0 with no warnings or notices,ninjalinksconmonunder-Werror, and the binary reports the correct version and commit.