Opened 7 years ago

Closed 7 years ago

Last modified 6 years ago

#53911 closed defect (fixed)

gtk3@3.22.11_0: fails to build with glib2-devel@2.52.0_0

Reported by: Ionic (Mihai Moldovan) Owned by: dbevans (David B. Evans)
Priority: Normal Milestone:
Component: ports Version:
Keywords: Cc: ryandesign (Ryan Carsten Schmidt), piannucci (Peter Iannucci)
Port: gtk3

Description

make[4]: Entering directory `/opt/local/var/macports/build/_opt_local_var_macports_sources_macports.rsync.ionic.de_release_ports_gnome_gtk3/gtk3/work/gtk+-3.22.11-x86_64/gdk/x11'
/bin/sh ../../libtool  --tag=CC   --mode=compile /usr/bin/clang -arch x86_64 -DHAVE_CONFIG_H -I. -I../..  -DG_LOG_DOMAIN=\"Gdk\" -DG_LOG_USE_STRUCTURED=1 -DGDK_COMPILATION -I../.. -I../../gdk -I../../gdk  -DG_ENABLE_DEBUG -DG_DISABLE_CAST_CHECKS -DGLIB_MIN_REQUIRED_VERSION=GLIB_VERSION_2_48 -DGLIB_MAX_ALLOWED_VERSION=GLIB_VERSION_2_50 -D_REENTRANT -I/opt/local/include/pango-1.0 -I/opt/local/include/harfbuzz -I/opt/local/include/pango-1.0 -I/opt/local/include/gdk-pixbuf-2.0 -I/opt/local/include/libpng16 -I/opt/local/include/cairo -I/opt/local/include/gio-unix-2.0/ -I/opt/local/include/cairo -I/opt/local/include/glib-2.0 -I/opt/local/lib/glib-2.0/include -I/opt/local/include/pixman-1 -I/opt/local/include/freetype2 -I/opt/local/include/libpng16  -I/opt/local/include -DX_LOCALE   -pipe -Os -fstrict-aliasing -arch x86_64 -Wall -c -o gdkapplaunchcontext-x11.lo gdkapplaunchcontext-x11.c
/bin/sh ../../libtool  --tag=CC   --mode=compile /usr/bin/clang -arch x86_64 -DHAVE_CONFIG_H -I. -I../..  -DG_LOG_DOMAIN=\"Gdk\" -DG_LOG_USE_STRUCTURED=1 -DGDK_COMPILATION -I../.. -I../../gdk -I../../gdk  -DG_ENABLE_DEBUG -DG_DISABLE_CAST_CHECKS -DGLIB_MIN_REQUIRED_VERSION=GLIB_VERSION_2_48 -DGLIB_MAX_ALLOWED_VERSION=GLIB_VERSION_2_50 -D_REENTRANT -I/opt/local/include/pango-1.0 -I/opt/local/include/harfbuzz -I/opt/local/include/pango-1.0 -I/opt/local/include/gdk-pixbuf-2.0 -I/opt/local/include/libpng16 -I/opt/local/include/cairo -I/opt/local/include/gio-unix-2.0/ -I/opt/local/include/cairo -I/opt/local/include/glib-2.0 -I/opt/local/lib/glib-2.0/include -I/opt/local/include/pixman-1 -I/opt/local/include/freetype2 -I/opt/local/include/libpng16  -I/opt/local/include -DX_LOCALE   -pipe -Os -fstrict-aliasing -arch x86_64 -Wall -c -o gdkasync.lo gdkasync.c
libtool: compile:  /usr/bin/clang -arch x86_64 -DHAVE_CONFIG_H -I. -I../.. -DG_LOG_DOMAIN=\"Gdk\" -DG_LOG_USE_STRUCTURED=1 -DGDK_COMPILATION -I../.. -I../../gdk -I../../gdk -DG_ENABLE_DEBUG -DG_DISABLE_CAST_CHECKS -DGLIB_MIN_REQUIRED_VERSION=GLIB_VERSION_2_48 -DGLIB_MAX_ALLOWED_VERSION=GLIB_VERSION_2_50 -D_REENTRANT -I/opt/local/include/pango-1.0 -I/opt/local/include/harfbuzz -I/opt/local/include/pango-1.0 -I/opt/local/include/gdk-pixbuf-2.0 -I/opt/local/include/libpng16 -I/opt/local/include/cairo -I/opt/local/include/gio-unix-2.0/ -I/opt/local/include/cairo -I/opt/local/include/glib-2.0 -I/opt/local/lib/glib-2.0/include -I/opt/local/include/pixman-1 -I/opt/local/include/freetype2 -I/opt/local/include/libpng16 -I/opt/local/include -DX_LOCALE -pipe -Os -fstrict-aliasing -arch x86_64 -Wall -c gdkapplaunchcontext-x11.c  -fno-common -DPIC -o .libs/gdkapplaunchcontext-x11.o
libtool: compile:  /usr/bin/clang -arch x86_64 -DHAVE_CONFIG_H -I. -I../.. -DG_LOG_DOMAIN=\"Gdk\" -DG_LOG_USE_STRUCTURED=1 -DGDK_COMPILATION -I../.. -I../../gdk -I../../gdk -DG_ENABLE_DEBUG -DG_DISABLE_CAST_CHECKS -DGLIB_MIN_REQUIRED_VERSION=GLIB_VERSION_2_48 -DGLIB_MAX_ALLOWED_VERSION=GLIB_VERSION_2_50 -D_REENTRANT -I/opt/local/include/pango-1.0 -I/opt/local/include/harfbuzz -I/opt/local/include/pango-1.0 -I/opt/local/include/gdk-pixbuf-2.0 -I/opt/local/include/libpng16 -I/opt/local/include/cairo -I/opt/local/include/gio-unix-2.0/ -I/opt/local/include/cairo -I/opt/local/include/glib-2.0 -I/opt/local/lib/glib-2.0/include -I/opt/local/include/pixman-1 -I/opt/local/include/freetype2 -I/opt/local/include/libpng16 -I/opt/local/include -DX_LOCALE -pipe -Os -fstrict-aliasing -arch x86_64 -Wall -c gdkasync.c  -fno-common -DPIC -o .libs/gdkasync.o
In file included from gdkapplaunchcontext-x11.c:27:
In file included from ./gdkprivate-x11.h:37:
./gdkscreen-x11.h:33:31:In file included from gdkasync.c:47:
In file included from ./gdkprivate-x11.h:37:
./gdkscreen-x11.h:33: warning: redefinition of typedef 'GdkX11Monitor' is a C11 feature [-Wtypedef-redefinition]
typedef struct _GdkX11Monitor GdkX11Monitor;
                              ^
../../gdk/x11/gdkx11monitor.h:37:3631: warning: redefinition of typedef 'GdkX11Monitor' is a C11 feature [-Wtypedef-redefinition]
typedef struct _GdkX11Monitor GdkX11Monitor;
                              ^
../../gdk/x11/gdkx11monitor.h:37:36: note: previous definition is here
typedef struct _GdkX11Monitor      GdkX11Monitor;
                                   ^
: note: previous definition is here
typedef struct _GdkX11Monitor      GdkX11Monitor;
                                   ^
gdkapplaunchcontext-x11.c:30:10: fatal error: 'gio/gdesktopappinfo.h' file not found
#include <gio/gdesktopappinfo.h>
         ^
1 warning and 1 error generated.
make[4]: *** [gdkapplaunchcontext-x11.lo] Error 1
make[4]: *** Waiting for unfinished jobs....

Upstream has already fixed this: https://git.gnome.org/browse/gtk+/commit/?h=gtk-3-22&id=30b961c84b7788d1079aae93665097c405695bb6

We'll probably need a backport.

Attachments (1)

glib2-gtk3-select-appinfo-impl.patch (40.7 KB) - added by Ionic (Mihai Moldovan) 7 years ago.
Make appinfo implementation selectible, fix errors caused by missing header files and switch to using the "generic" freedesktop-based implementation when building for X11.

Download all attachments as: .zip

Change History (14)

comment:1 Changed 7 years ago by Ionic (Mihai Moldovan)

Hm, that's only fixing another problem that I haven't encountered yet, because the original failure is caused by other files.

I need to patch that myself for gtk3 to work with glib 2.52 correctly.

comment:2 Changed 7 years ago by Ionic (Mihai Moldovan)

Cc: ryandesign added

The more I dig into that, the worse it gets.

In glib 2.52.0, a new class gosxappinfo was introduced, which is supposed to be used with Cocoa on OS X and handles application information via app bundles. In the course of this, gdesktopappinfo (which handles application information via standard .desktop files) has been completely removed from being built and shipped on OS X.

The last approach looks very wrong, since we still need gdesktopappinfo for X11 builds of glib and GTK+.

Also, while gosxappinfo is being built and baked into libgio, its header file is never installed. I haven't yet fully understood if that's by design (because it might a private implementation and not public API) or a mistake.

comment:3 Changed 7 years ago by Ionic (Mihai Moldovan)

Upstream suggests adding a configure switch for glib to switch between gosxappinfo and gdesktopappinfo. That sounds sane. We can than use that to toggle based upon quartz/x11 builds.

Changed 7 years ago by Ionic (Mihai Moldovan)

Make appinfo implementation selectible, fix errors caused by missing header files and switch to using the "generic" freedesktop-based implementation when building for X11.

comment:4 Changed 7 years ago by Ionic (Mihai Moldovan)

Ryan, please review that patch.

I had to go to some length to make sure that I do not overwrite the changes you did for building universally (which, I may add, should really better be part of the autoconf/automake files instead of a generated configure script...)

Essentially, I implemented the changes in autoconf.ac and Makefile.am, then had autotools re-generate the affected files (config.h.in, configure, Makefile.in) and spun that off in a different patchfile that can be applied without having to use autoreconf.

I have also added x11 and quartz variants to glib. They do not really do anything X11- or Quartz-related per se, but switch to the generic (freedesktop-based) appinfo implementation for X11 builds and stick to the native (appbundle-based) implementation for Quartz builds. Needless to say, either maintainers or users have to make sure that gtk3 and glib2-devel are built with the same variants, but I think that's fine. (To make that clear: upstream's master branch currently disables .desktop parsing support on OS X pretty much, as far as I can tell. We'll need to revert this in a sane manner so that our X11 builds can continue to use it, while only messing with it for quartz builds. It's better to do that in the upstream package I'd say.)

Regarding gtk3, I'm only using the mentioned upstream patch for +quartz builds. This is because we actually *want* to use the freedesktop-based implementation for +x11 builds. This also means that we will have to work with upstream to make sure that once that patch is part of a new official GTK+ release, switching between these implementations is possible at build time.

I will make sure to work with upstream to include the glib2 patch as soon as possible, so that we're not burdened by maintaining it for a prolonged time.

With these changes, gtk3 builds fine with glib2-devel for me now, all X11-based. I have tested a Quartz-Build of glib2-devel (but not gtk3 because that would have required to rebuild "everything") and it also works as intended - baking in the gosxappinfo implementation into libgio-2.0.

Last edited 7 years ago by Ionic (Mihai Moldovan) (previous) (diff)

comment:5 Changed 7 years ago by Ionic (Mihai Moldovan)

Subtle ping.

comment:6 Changed 7 years ago by ryandesign (Ryan Carsten Schmidt)

Well I'm not thrilled about adding x11 and quartz variants to glib2. We really want ports to simultaneously support both and thus make a variant unnecessary. But if it's unavoidable, and especially if this is taken from work already committed to upstream's repo, then we can do it for now until a better solution emerges.

comment:7 Changed 7 years ago by Ionic (Mihai Moldovan)

I haven't submitted it upstream yet, since I wanted to have your feedback first.

Sadly, the different appinfo implementations in glib are mutually exclusive. Only one specific implementation can be compiled in into the library at build time, so supporting both is borderline impossible currently.

Upstream goes a way incompatible with MacPorts - by default, they build and test with Quartz-based versions of GTK+ which use the appbundle-based appinfo implementation instead of the .desktop-files-based one. I'm not quite sure what you and devans are aiming for in MacPorts, but I imagined it would be being compatible with full desktop environments, which would need to be able to use and parse .desktop files. For our standard X11 builds, using the appbundle-based appinfo implementation doesn't make a lot of sense, since almost no program creates .app bundles.

Supporting multiple appinfo implementations would require a pretty huge rewrite of the subsystem in glib and while upstream would probably not be against it, it's not by any means a priority for them at the moment and unlikely to be available any time soon.

comment:8 Changed 7 years ago by Mihai Moldovan <ionic@…>

In 30351b8d9a69125828625d7fe299d03706ebe89a/macports-ports:

devel/glib2-devel: add appinfo implementation switcher and quartz/x11 variants.

Part of: #53911.

Since we change autogenerated files via patches manually, generating the
actual patchfile from autoconf templates is tricky. If you need to
update glib2-devel, refer to the documentation provided in the -mp.diff
patch header.

comment:9 Changed 7 years ago by Mihai Moldovan <ionic@…>

Resolution: fixed
Status: newclosed

In e52bcd5195361316e315379a91e2222e8db51f65/macports-ports:

gnome/gtk3: fix +quartz builds with newer glib2 versions.

Fixes: #53911.

comment:10 Changed 7 years ago by JacksonIsaac (Jackson Isaac)

In be60a93f94547a609771ecd6e43697f6098c2550/macports-ports:

glib2: Update to 2.52.2

#53911 is marked 'fixed'.

comment:11 Changed 7 years ago by piannucci (Peter Iannucci)

I'm getting build failures for gtk3 3.22.11 with glib2 @2.52.2_1+quartz installed.

:info:build gtkapplicationwindow.c:34:10: fatal error: 'gio/gdesktopappinfo.h' file not found
Last edited 7 years ago by ryandesign (Ryan Carsten Schmidt) (previous) (diff)

comment:12 in reply to:  11 Changed 7 years ago by ryandesign (Ryan Carsten Schmidt)

Cc: piannucci added

Replying to piannucci:

I'm getting build failures for gtk3 3.22.11 with glib2 @2.52.2_1+quartz installed.

Then install glib2 with +x11 instead.

comment:13 in reply to:  7 Changed 6 years ago by ryandesign (Ryan Carsten Schmidt)

Replying to Ionic:

I haven't submitted it upstream yet, since I wanted to have your feedback first.

Just to document it, you did subsequently submit an upstream issue. It is still open at this time.

Note: See TracTickets for help on using tickets.