Opened 4 years ago

Closed 3 years ago

#61113 closed defect (fixed)

py27-gobject +quartz build failure: implicit declaration of function 'g_desktop_app_info_set_desktop_env'

Reported by: jmercouris (John Mercouris) Owned by: landonf (Landon Fuller)
Priority: Normal Milestone:
Component: ports Version: 2.6.3
Keywords: Cc: ryandesign (Ryan Carsten Schmidt), MaurizioLoreti, iefdev (Eric F), ccottap (Carlos Cotta), p-bro, khyox (Jose Manuel Martí), michaellass (Michael Lass), ShadSterling (Shad Sterling), Tatsh (Andrew Udvare), MarcusCalhoun-Lopez (Marcus Calhoun-Lopez), hmeine (Hans Meine), snarkhunter (Steve Langer)
Port: py-gobject

Description

Fails to compile. Only the X11 variant can compile on my system. Please see attached log.

Attachments (2)

main.log (164.3 KB) - added by jmercouris (John Mercouris) 4 years ago.
py27-gobject+quartz_to_destroot_main.log (204.2 KB) - added by iefdev (Eric F) 4 years ago.
If it helps… Here's a log from: sudo port -t destroot py27-gobject +quartz

Download all attachments as: .zip

Change History (37)

Changed 4 years ago by jmercouris (John Mercouris)

Attachment: main.log added

comment:1 Changed 4 years ago by jmroot (Joshua Root)

Port: py-gobject added; py27-gobject removed
Summary: py27-gobject +quartzpy27-gobject +quartz build failure: implicit declaration of function 'g_desktop_app_info_set_desktop_env'

comment:2 Changed 4 years ago by ryandesign (Ryan Carsten Schmidt)

Cc: ryandesign added

MacPorts glib2 contains a substantial patch written by a MacPorts contributor to implement a new glib2 feature: the introduction of a macOS-specific appinfo implementation. Previously, glib2 only offered a "freedesktop" appinfo implementation which was suitable for Linux systems but not as useful for Macs.

g_desktop_app_info_set_desktop_env is part of the "freedesktop" appinfo implementation which we now offer only in the +x11 variant. It's not available when you select the macOS appinfo implementation by using the +quartz variant.

py-gobject evidently uses g_desktop_app_info_set_desktop_env, so py-gobject cannot be used with glib2's +quartz variant. If you want py-gobject, you'll need to use +x11 for glib2 and everything else. Or you might ask the developers of py-gobject if they want to stop using g_desktop_app_info_set_desktop_env, since it has been deprecated since glib 2.42. Or maybe we can apply this patch to py-gobject to do so.

Here is the issue tracking the new macOS appinfo implemenation. Over three years later it still hasn't been resolved. The last comments in the issue, from over a year ago, are about maybe reimplementing it as a runtime option.

In the mean time, glib2 has switched to meson, and any further development by them of this feature will be incorporated into the meson build system. MacPorts has not updated to a meson version of glib2 yet because that is difficult.

comment:3 Changed 4 years ago by MaurizioLoreti

py27-gobject +quartz is between my ports because I installed gimp +quartz. Still no foresight for a working py27-gobject +quartz ? GIMP does not run currently on my Mac, but I don't know if that is due to gobject or not. Please?

comment:4 Changed 4 years ago by MaurizioLoreti

Cc: MaurizioLoreti added

comment:5 Changed 4 years ago by ryandesign (Ryan Carsten Schmidt)

It doesn't look like anybody is volunteering to work on this now. Until it's resolved, if you want gimp (or anything else that depends on py-gobject), you'll need to avoid using the +quartz variant.

comment:6 Changed 4 years ago by kencu (Ken)

I thought lots of people were running gimp +quartz on MacPorts, and had been for many years now. Did something recently break it?

Last edited 4 years ago by kencu (Ken) (previous) (diff)

comment:7 in reply to:  6 Changed 4 years ago by iefdev (Eric F)

Replying to kencu:

I thought lots of people were running gimp +quartz on MacPorts, and had been for many years now. Did something recently break it?

It wasn't too long we updated gimp2 and fixed it for <= 10.7 (#60508). I use quartz, and it works. Is this a new break?

$ port installed gimp2 py27-gobject
The following ports are currently installed:
  gimp2 @2.10.20_0+python27+quartz (active)
  py27-gobject @2.28.7_1+quartz (active)

comment:8 Changed 4 years ago by iefdev (Eric F)

Cc: iefdev added

Changed 4 years ago by iefdev (Eric F)

If it helps… Here's a log from: sudo port -t destroot py27-gobject +quartz

comment:9 Changed 4 years ago by jmercouris (John Mercouris)

I would like to note that I did get it to compile with the following patch:

--- gio/unix-types.defs.orig	2020-09-02 13:56:20.000000000 +0200
+++ gio/unix-types.defs	2020-09-02 13:59:41.000000000 +0200
@@ -15,8 +15,8 @@
   )
   (in-module "giounix")
   (parent "GObject")
-  (c-name "GDesktopAppInfo")
-  (gtype-id "G_TYPE_DESKTOP_APP_INFO")
+  (c-name "GOsxAppInfo")
+  (gtype-id "G_TYPE_OSX_APP_INFO")
 )
 
 (define-object FDMessage
--- gio/unix.defs.orig	2020-09-02 13:56:46.000000000 +0200
+++ gio/unix.defs	2020-09-02 13:57:04.000000000 +0200
@@ -31,55 +31,6 @@
 )
 
 
-
-;; From gdesktopappinfo.h
-
-(define-function desktop_app_info_get_type
-  (c-name "g_desktop_app_info_get_type")
-  (return-type "GType")
-)
-
-(define-function desktop_app_info_new_from_filename
-  (c-name "g_desktop_app_info_new_from_filename")
-  (return-type "GDesktopAppInfo*")
-  (parameters
-    '("const-char*" "filename")
-  )
-)
-
-(define-function g_desktop_app_info_new_from_keyfile
-  (c-name "g_desktop_app_info_new_from_keyfile")
-  (return-type "GDesktopAppInfo*")
-  (parameters
-    '("GKeyFile*" "key_file")
-  )
-)
-
-(define-function desktop_app_info_new
-  (c-name "g_desktop_app_info_new")
-  (is-constructor-of "GDesktopAppInfo")
-  (return-type "GDesktopAppInfo*")
-  (parameters
-    '("const-char*" "desktop_id")
-  )
-)
-
-(define-method get_is_hidden
-  (of-object "GDesktopAppInfo")
-  (c-name "g_desktop_app_info_get_is_hidden")
-  (return-type "gboolean")
-)
-
-(define-function desktop_app_info_set_desktop_env
-  (c-name "g_desktop_app_info_set_desktop_env")
-  (return-type "none")
-  (parameters
-    '("const-char*" "desktop_env")
-  )
-)
-
-
-
 ;; From gunixfdmessage.h
 
 (define-function g_unix_fd_message_get_type
--- gio/unix.override.orig	2020-09-02 13:55:46.000000000 +0200
+++ gio/unix.override	2020-09-02 13:59:41.000000000 +0200
@@ -24,7 +24,7 @@
 #define NO_IMPORT_PYGOBJECT
 #include <pygobject.h>
 #include <gio/gio.h>
-#include <gio/gdesktopappinfo.h>
+#include <gio/gosxappinfo.h>
 #include <gio/gunixinputstream.h>
 #include <gio/gunixmounts.h>
 #include <gio/gunixoutputstream.h>

Not ideal, but perhaps most users do not need these functions.

comment:10 Changed 4 years ago by kencu (Ken)

I thought I would give this a try to see what's going on. I deactivated all my ports on Catalina (sigh) and tried to install this. It installed right through, without touching a thing:

% sudo port -v install py27-gobject +quartz

% port -v installed py27-gobject 
The following ports are currently installed:
  py27-gobject @2.28.7_1+quartz (active) platform='darwin 19' archs='x86_64' date='2020-09-16T08:20:50-0700'

comment:11 Changed 4 years ago by jmercouris (John Mercouris)

Could it be possibly an issue of installation ordering?

comment:12 Changed 4 years ago by kencu (Ken)

Try a trace build. maybe you're picking up something unexpected...

comment:13 Changed 4 years ago by kencu (Ken)

has duplicate #61205

comment:14 Changed 4 years ago by ccottap (Carlos Cotta)

Cc: ccottap added

comment:15 Changed 3 years ago by MaurizioLoreti

Well, here we are again. I installed MacOS 11.0 "Big Sur" and, as usual, removed all the installed ports and tried to reinstall them again. As expected, "port install gimp +quartz" barfed because the installation of py27-gobject failed. Than means that I cannot use GIMP +quartz on Big Sur.

As suggested by Kencu, after having uninstalled all the installed ports, I installed first py27-gobject + quartz. It failed. And GIMP could not be installed.

Please...

comment:16 Changed 3 years ago by kencu (Ken)

Please remember MacPorts is made up a group of generally helpful, completely unpaid, volunteers, all of whom have other things to do...

I hope that if gimp is mission-critical to you that you wouldn't update to Big Sur in the first week without knowing first if gimp works...I installed Big Sur only the day before yesterday, and have fixed several broken ports since then.

We'll fix it, we always, always, (nearly) always do. If you can help at all, that would be nice...would you like to dig in on why py27-gobject doesn't build? We'd all appreciate the patch, if you can sort it out for us.

For right now, today, --- maybe try the gimp DMG from the gimp website. It will likely work on Big Sur, I'd bet. Give us a week or two, at least, to get through the worst of the wreckage. There were many big changes in Big Sur, perhaps you know.

comment:17 Changed 3 years ago by kencu (Ken)

py-gobject has been fixed for Big Sur, so let's see where we get with gimp now...

comment:18 Changed 3 years ago by kencu (Ken)

I now see this error when building py27-gobject +quartz on BigSur.

Building in trace mode also fails:

sudo port -v -t install py27-gobject +quartz

building with macports-clang-9.0 or 10 succeeds, however:

sudo port -v install py27-gobject +quartz configure.compiler=macports-clang-9.0

% port -v installed py27-gobject
The following ports are currently installed:
  py27-gobject @2.28.7_1+quartz (active) platform='darwin 20' archs='x86_64' date='2020-11-21T21:05:55-0800'

comment:19 Changed 3 years ago by kencu (Ken)

adding this to the Portfile fixes it:

+     configure.cflags-append -Wno-implicit-function-declaration

but probably not for arm64.

comment:20 Changed 3 years ago by p-bro

I can confirm that the addition to the portfile suggested by kencu in #comment:19 also allows buidling py27-gobject +quartz on Catalina (I upgraded to Catalina the week Big Sur was released ...)

comment:21 Changed 3 years ago by p-bro

Cc: p-bro added

comment:22 Changed 3 years ago by kencu (Ken)

this one will be harder than average to fix properly as it does some on-the-fly file building magic...something like John's patch from coment 9 will be needed

comment:23 Changed 3 years ago by kencu (Ken)

has duplicate #61846

comment:24 Changed 3 years ago by khyox (Jose Manuel Martí)

Cc: khyox added

comment:25 in reply to:  19 Changed 3 years ago by khyox (Jose Manuel Martí)

Replying to kencu:

adding this to the Portfile fixes it:

+     configure.cflags-append -Wno-implicit-function-declaration

Many thanks for the fix! Confirmed for py27-gobject @2.28.7_1 +quartz in 2.6.4 on Big Sur 11.1 (with Xcode 12.2 and SDK 11.1). With that, the port for gimp +quartz -x11 is successfully installed. Now, gimp crashes because of the runtime error described in #61586.

comment:26 Changed 3 years ago by kencu (Ken)

the fix for that crash is known, and we'll soon have it in MP. For now, I found the x11 version of gimp works well...

comment:27 Changed 3 years ago by michaellass (Michael Lass)

Cc: michaellass added

comment:28 Changed 3 years ago by ShadSterling (Shad Sterling)

Cc: ShadSterling added

comment:29 Changed 3 years ago by mascguy (Christopher Nielsen)

Cc: mascguy added

comment:30 Changed 3 years ago by Tatsh (Andrew Udvare)

Cc: Tatsh added

comment:31 Changed 3 years ago by MarcusCalhoun-Lopez (Marcus Calhoun-Lopez)

Cc: MarcusCalhoun-Lopez added

comment:32 Changed 3 years ago by hmeine (Hans Meine)

Cc: hmeine added

comment:33 Changed 3 years ago by mascguy (Christopher Nielsen)

Cc: mascguy removed

comment:34 Changed 3 years ago by snarkhunter (Steve Langer)

Cc: snarkhunter added

comment:35 Changed 3 years ago by landonf (Landon Fuller)

Owner: set to landonf
Resolution: fixed
Status: newclosed

In bdc92aceb5ff6849f3274ef9422c983f36e609c7/macports-ports (master):

py-gobject: fix +quartz build

The previous patch adopted GOsxAppInfo (replacing GDesktopAppInfo),
but retained the IDL symbol definitions to functions only defined by
GDesktopAppInfo, triggering build failures with -Werror=implicit-function-declaration.

Patch submitted by: John Mercouris
Fixes: #61113

Note: See TracTickets for help on using tickets.