Build failure due to gdkversionmacros.h race condition
I originally reported a build failure at https://bugs.gentoo.org/924979 that involves gdkversionmacros.h
and gdk-visibility.h
, but without a satisfying explanation. Mart Raudsepp thinks it may be a race condition in,
gdk_enums = gnome.mkenums_simple('gdkenumtypes',
sources: gdk_public_headers,
decorator: 'GDK_AVAILABLE_IN_ALL',
body_prefix: '#include "config.h"',
header_prefix: '#include "version/gdkversionmacros.h"\n',
install_dir: gtk_includedir / 'gtk-4.0/gdk',
install_header: true,
)
and, after reading some meson docs, I find his explanation plausible.
In short, the snippet above adds an implicit dependency on version/gdkversionmacros.h
, but does not declare it in sources
, which can lead to parallel build failures if gdk-visibility.h
is not built in time. I also had trouble with gdk-visibility.h
, but I now believe that is because gdkversionmacros.h
includes gdk-visibility.h
. In other words, whatever depends on gdk-visibility.h
should depend on gdk-visibility.h
as well.