Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 924979

Summary: =gui-libs/gtk-4.12.5: fatal error: gdk/version/gdkversionmacros.h: No such file or directory
Product: Gentoo Linux Reporter: Michael Orlitzky <mjo>
Component: Current packagesAssignee: Gentoo Linux Gnome Desktop Team <gnome>
Status: RESOLVED FIXED    
Severity: normal CC: erhard_f, eschwartz, leio, mjo
Priority: Normal    
Version: unspecified   
Hardware: All   
OS: Linux   
URL: https://gitlab.gnome.org/GNOME/gtk/-/issues/6618
See Also: https://gitlab.gnome.org/GNOME/gtk/-/merge_requests/7127
https://gitlab.gnome.org/GNOME/gtk/-/merge_requests/7150
Whiteboard:
Package list:
Runtime testing required: ---
Bug Depends on:    
Bug Blocks: 351559    
Attachments: build.log

Description Michael Orlitzky gentoo-dev 2024-02-19 12:47:35 UTC
I'm getting this build failure on only one machine. It looks like a missing build dependency? Here are the two failed compilations from the build log:

  In file included from ../gtk-4.12.5/gtk/gtk.h:29,
                   from ../gtk-4.12.5/tools/gtk-launch.c:34:
  ../gtk-4.12.5/gtk/css/gtkcss.h:30:10: fatal error: 
  gdk/version/gdkversionmacros.h: No such file or directory

  In file included from ../gtk-4.12.5/gdk/gdktypes.h:45,
                   from ../gtk-4.12.5/gdk/gdkapplaunchcontext.h:27,
                   from ../gtk-4.12.5/gdk/gdk.h:29,
                   from ../gtk-4.12.5/tools/encodesymbolic.c:21:
  ../gtk-4.12.5/gdk/gdkenums.h:33:10: fatal error:
  gdk/version/gdkversionmacros.h: No such file or directory


If I build gtk-4.12.5 myself (not using portage), I don't hit the failure. If I su to root, cd to the portage build directory, and run,

  $S/build-aux/meson/gen-visibility-macros.py 4.12.5 versions-macros
  ../gtk-4.12.5/gdk/version/gdkversionmacros.h.in gdk/version/gdkversionmacros.h

Then the subsequent "meson compile" dies with a similar error for gdk-visibility.h that I can fix by running,

  $S/build-aux/meson/gen-visibility-macros.py 4.12.5 visibility-macros GDK
  gdk/version/gdk-visibility.h

Afterwards, "meson compile" finishes.

Is it just some missing dependencies in tools/meson.build?
Comment 1 Michael Orlitzky gentoo-dev 2024-02-19 12:47:59 UTC
Created attachment 885413 [details]
build.log
Comment 2 Michael Orlitzky gentoo-dev 2024-02-19 13:14:24 UTC
I should mention that this is with USE="introspection wayland" and everything else off.

Adding,


  src_compile() {
  	pushd "${BUILD_DIR}"
  	einfo "building gdkversionmacros.h early"
  	eninja gdk/version/gdkversionmacros.h
  	einfo "building gdk-visibility.h early"
  	eninja gdk/version/gdk-visibility.h
  	popd
  	meson_src_compile
  }

to the ebuild allows it to build for me FWIW.
Comment 3 Mart Raudsepp gentoo-dev 2024-04-06 20:36:26 UTC
Looks like a race between gdkenums.h and gdkversionmacros.h generation with gdk_enums setup in gdk/meson.build adding a

header_prefix: '#include "version/gdkversionmacros.h"\n'

but not adding gdkversionmacros_h as a source dependency.

I'm not quite sure how this would be set up properly as a dependency, but maybe changing

gdk_enums = gnome.mkenums_simple('gdkenumtypes',
  sources: gdk_public_headers,

sources to be "gdk_public_headers + gdkversionmacros_h" might work? My main concern is that it will try to generate enums out of the version macros header as well then.
Comment 4 Michael Orlitzky gentoo-dev 2024-04-07 23:07:37 UTC
Thanks, I think you're right. We can move this upstream to $URL.
Comment 5 Eli Schwartz gentoo-dev 2024-08-12 16:25:59 UTC
*** Bug 937823 has been marked as a duplicate of this bug. ***
Comment 6 Eli Schwartz gentoo-dev 2024-08-12 16:26:56 UTC
Apropos of nothing, other people are hitting the issue too.
Comment 7 Eli Schwartz gentoo-dev 2024-08-12 16:46:33 UTC
It was cherry-picked into 4.14 upstream
Comment 8 Larry the Git Cow gentoo-dev 2024-08-12 16:49:22 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=d5e9a6d557b54cfc2495d7875c29792452900214

commit d5e9a6d557b54cfc2495d7875c29792452900214
Author:     Eli Schwartz <eschwartz@gentoo.org>
AuthorDate: 2024-08-12 16:47:26 +0000
Commit:     Eli Schwartz <eschwartz@gentoo.org>
CommitDate: 2024-08-12 16:48:27 +0000

    gui-libs/gtk: backport patch to fix race conditions when building
    
    Backported upstream in 4.14 already.
    
    Closes: https://bugs.gentoo.org/924979
    Signed-off-by: Eli Schwartz <eschwartz@gentoo.org>

 .../6510b876d1cb5428db4822974cdebfed209692b0.patch | 134 +++++++++++++++++++++
 gui-libs/gtk/gtk-4.12.5-r2.ebuild                  |   2 +
 2 files changed, 136 insertions(+)