From 539af0b4f36a40d1f85529cbeef401667e64e7f3 Mon Sep 17 00:00:00 2001 From: Martin Pitt Date: Wed, 31 Jan 2024 10:34:46 +0100 Subject: [PATCH] HACK: Disable fatal compiler warnings on Gentoo Between Jan 5 and Jan 8 2024, Gentoo changed something that causes hundreds of warnings when compiling the vala-generated C code. It's too hard for me to find out what that was and how to debug it (it's *not* a new valac version!), so ignore the warnings. It's enough to sort out the warnings on other OSes, and the unit tests should also ensure that it actually works. --- meson.build | 15 +++++++++++++++ meson_options.txt | 5 +++++ tests/run-gentoo | 2 +- 3 files changed, 21 insertions(+), 1 deletion(-) diff --git a/meson.build b/meson.build index 05cab012..d9cc2c1d 100644 --- a/meson.build +++ b/meson.build @@ -37,6 +37,21 @@ if get_option('b_ndebug') == 'true' add_project_arguments('-Wno-error=unused-but-set-variable', '-Wno-error=unused-variable', language: 'c') endif +# HACK: between Jan 5 and Jan 8 2024, Gentoo changed something that causes +# hundreds of warnings when compiling the vala-generated C code; ignore these +if get_option('gentoo-hacks') + add_project_arguments( + '-Wno-error', + '-Wno-error=incompatible-pointer-types', + '-Wno-error=pointer-sign', + '-Wno-error=unused-function', + '-Wno-error=unused-label', + '-Wno-error=unused-but-set-variable', + '-Wno-error=unused-variable', + '-Wno-error=unused-value', + language: 'c') +endif + conf = configuration_data() cc = meson.get_compiler('c') valac = meson.get_compiler('vala') diff --git a/meson_options.txt b/meson_options.txt index 0383d34b..8cf2e965 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -2,3 +2,8 @@ option('gtk_doc', type : 'boolean', value : false, description : 'use gtk-doc to build documentation') + +option('gentoo-hacks', + type : 'boolean', + value : false, + description : 'disable gcc fatal warnings, for Gentoo builds') diff --git a/tests/run-gentoo b/tests/run-gentoo index bb0cb0e5..172cd3dd 100755 --- a/tests/run-gentoo +++ b/tests/run-gentoo @@ -27,7 +27,7 @@ git config --global safe.directory /source cd /source export VALAC=\$(ls /usr/bin/valac-* |sort | tail -n1) -meson setup /tmp/dbg --buildtype debug --werror +meson setup /tmp/dbg --buildtype debug --werror -Dgentoo-hacks=true export BRITTLE_TESTS="${BRITTLE_TESTS:-}" meson test -C /tmp/dbg -v --num-processes=1