Skip to content

Commit

Permalink
HACK: Disable fatal compiler warnings on Gentoo
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
martinpitt committed Jan 31, 2024
1 parent 6a1d57a commit 539af0b
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 1 deletion.
15 changes: 15 additions & 0 deletions meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand Down
5 changes: 5 additions & 0 deletions meson_options.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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')
2 changes: 1 addition & 1 deletion tests/run-gentoo
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 539af0b

Please sign in to comment.