[MacPorts] #65663: glib2 @2.68.4: build failure for 10.4 PPC

MacPorts noreply at macports.org
Mon Aug 15 10:43:55 UTC 2022


#65663: glib2 @2.68.4: build failure for 10.4 PPC
-------------------------+----------------------
  Reporter:  evanmiller  |      Owner:  mascguy
      Type:  defect      |     Status:  assigned
  Priority:  Normal      |  Milestone:
 Component:  ports       |    Version:  2.7.2
Resolution:              |   Keywords:  tiger
      Port:  glib2       |
-------------------------+----------------------

Comment (by ballapete):

 The reason for the failure is in this function:

 {{{
   211   /**
   212    * g_credentials_to_string:
   213    * @credentials: A #GCredentials object.
   214    *
   215    * Creates a human-readable textual representation of @credentials
   216    * that can be used in logging and debug messages. The format of
 the
   217    * returned string may change in future GLib release.
   218    *
   219    * Returns: (transfer full): A string that should be freed with
 g_free().
   220    *
   221    * Since: 2.26
   222    */
   223   gchar *
   224   g_credentials_to_string (GCredentials *credentials)
   225   {
   226     GString *ret;
   227   #if G_CREDENTIALS_USE_APPLE_XUCRED
   228     glib_typeof (credentials->native.cr_ngroups) i;
   229   #endif
   230
   231     g_return_val_if_fail (G_IS_CREDENTIALS (credentials), NULL);
   232
   233     ret = g_string_new ("GCredentials:");
   234   #if G_CREDENTIALS_USE_LINUX_UCRED
   235     g_string_append (ret, "linux-ucred:");
   236     if (credentials->native.pid != (pid_t) -1)
   237       g_string_append_printf (ret, "pid=%" G_GINT64_FORMAT ",",
 (gint64) credentials->native.pid);
   238     if (credentials->native.uid != (uid_t) -1)
   239       g_string_append_printf (ret, "uid=%" G_GINT64_FORMAT ",",
 (gint64) credentials->native.uid);
   240     if (credentials->native.gid != (gid_t) -1)
   241       g_string_append_printf (ret, "gid=%" G_GINT64_FORMAT ",",
 (gint64) credentials->native.gid);
   242     if (ret->str[ret->len - 1] == ',')
   243       ret->str[ret->len - 1] = '\0';
   244   #elif G_CREDENTIALS_USE_APPLE_XUCRED
   245     g_string_append (ret, "apple-xucred:");
   246     g_string_append_printf (ret, "version=%u,",
 credentials->native.cr_version);
   247     if (credentials->native.cr_uid != (uid_t) -1)
   248       g_string_append_printf (ret, "uid=%" G_GINT64_FORMAT ",",
 (gint64) credentials->native.cr_uid);
   249     for (i = 0; i < credentials->native.cr_ngroups; i++)
   250       g_string_append_printf (ret, "gid=%" G_GINT64_FORMAT ",",
 (gint64) credentials->native.cr_groups[i]);
   251     if (ret->str[ret->len - 1] == ',')
   252       ret->str[ret->len - 1] = '\0';
   253   #elif G_CREDENTIALS_USE_FREEBSD_CMSGCRED
   254     g_string_append (ret, "freebsd-cmsgcred:");
   255     if (credentials->native.cmcred_pid != (pid_t) -1)
   256       g_string_append_printf (ret, "pid=%" G_GINT64_FORMAT ",",
 (gint64) credentials->native.cmcred_pid);
   257     if (credentials->native.cmcred_euid != (uid_t) -1)
   258       g_string_append_printf (ret, "uid=%" G_GINT64_FORMAT ",",
 (gint64) credentials->native.cmcred_euid);
   259     if (credentials->native.cmcred_gid != (gid_t) -1)
   260       g_string_append_printf (ret, "gid=%" G_GINT64_FORMAT ",",
 (gint64) credentials->native.cmcred_gid);
   261   #elif G_CREDENTIALS_USE_NETBSD_UNPCBID
   262     g_string_append (ret, "netbsd-unpcbid:");
   263     if (credentials->native.unp_pid != (pid_t) -1)
   264       g_string_append_printf (ret, "pid=%" G_GINT64_FORMAT ",",
 (gint64) credentials->native.unp_pid);
   265     if (credentials->native.unp_euid != (uid_t) -1)
   266       g_string_append_printf (ret, "uid=%" G_GINT64_FORMAT ",",
 (gint64) credentials->native.unp_euid);
   267     if (credentials->native.unp_egid != (gid_t) -1)
   268       g_string_append_printf (ret, "gid=%" G_GINT64_FORMAT ",",
 (gint64) credentials->native.unp_egid);
   269     ret->str[ret->len - 1] = '\0';
   270   #elif G_CREDENTIALS_USE_OPENBSD_SOCKPEERCRED
   271     g_string_append (ret, "openbsd-sockpeercred:");
   272     if (credentials->native.pid != (pid_t) -1)
   273       g_string_append_printf (ret, "pid=%" G_GINT64_FORMAT ",",
 (gint64) credentials->native.pid);
   274     if (credentials->native.uid != (uid_t) -1)
   275       g_string_append_printf (ret, "uid=%" G_GINT64_FORMAT ",",
 (gint64) credentials->native.uid);
   276     if (credentials->native.gid != (gid_t) -1)
   277       g_string_append_printf (ret, "gid=%" G_GINT64_FORMAT ",",
 (gint64) credentials->native.gid);
   278     if (ret->str[ret->len - 1] == ',')
   279       ret->str[ret->len - 1] = '\0';
   280   #elif G_CREDENTIALS_USE_SOLARIS_UCRED
   281     g_string_append (ret, "solaris-ucred:");
   282     {
   283       id_t id;
   284       if ((id = ucred_getpid (credentials->native)) != (id_t) -1)
   285         g_string_append_printf (ret, "pid=%" G_GINT64_FORMAT ",",
 (gint64) id);
   286       if ((id = ucred_geteuid (credentials->native)) != (id_t) -1)
   287         g_string_append_printf (ret, "uid=%" G_GINT64_FORMAT ",",
 (gint64) id);
   288       if ((id = ucred_getegid (credentials->native)) != (id_t) -1)
   289         g_string_append_printf (ret, "gid=%" G_GINT64_FORMAT ",",
 (gint64) id);
   290       if (ret->str[ret->len - 1] == ',')
   291         ret->str[ret->len - 1] = '\0';
   292     }
   293   #else
   294     g_string_append (ret, "unknown");
   295   #endif
   296
   297     return g_string_free (ret, FALSE);
   298   }
 }}}

 The C variable type `glib_typeof` is unknown on line #228 and so the
 variable `i` on line #249 cannot be used. This variable type is only used
 in `glib-2.68.4/gio/gcredentials.c`. These `C header files` at least refer
 to it:

 {{{
 glib-2.68.4/glib/gatomic.h
 glib-2.68.4/glib/gmacros.h
 glib-2.68.4/glib/gmem.h
 glib-2.68.4/glib/grcbox.h
 glib-2.68.4/gobject/gobject.h
 }}}

 but none of them has a `#typedef`… What they do is (mainly):

 {{{
 glib-2.68.4/glib/gatomic.h:29:#if defined(glib_typeof_2_68) &&
 GLIB_VERSION_MIN_REQUIRED >= GLIB_VERSION_2_68
 glib-2.68.4/glib/gatomic.h:30:/* for glib_typeof */
 glib-2.68.4/glib/gatomic.h:111:#if defined(glib_typeof) &&
 (!defined(glib_typeof_2_68) || GLIB_VERSION_MIN_REQUIRED >=
 GLIB_VERSION_2_68)
 glib-2.68.4/glib/gatomic.h:115:    glib_typeof (*(atomic))
 gapg_temp_newval;                              \
 glib-2.68.4/glib/gatomic.h:116:    glib_typeof ((atomic)) gapg_temp_atomic
 = (atomic);                    \
 glib-2.68.4/glib/gatomic.h:123:    glib_typeof ((atomic)) gaps_temp_atomic
 = (atomic);                     \
 glib-2.68.4/glib/gatomic.h:124:    glib_typeof (*(atomic))
 gaps_temp_newval = (newval);                    \
 glib-2.68.4/glib/gatomic.h:128:#else /* if !(defined(glib_typeof) &&
 (!defined(glib_typeof_2_68) || GLIB_VERSION_MIN_REQUIRED >=
 GLIB_VERSION_2_68)) */
 glib-2.68.4/glib/gatomic.h:145:#endif /* if defined(glib_typeof) &&
 (!defined(glib_typeof_2_68) || GLIB_VERSION_MIN_REQUIRED >=
 GLIB_VERSION_2_68) */
 glib-2.68.4/glib/gatomic.h:191:#if defined(glib_typeof) &&
 defined(__cplusplus) && __cplusplus >= 201103L
 glib-2.68.4/glib/gatomic.h:203:    glib_typeof (*(atomic)) gapcae_oldval =
 (oldval);                        \
 glib-2.68.4/glib/gatomic.h:208:#else /* if !(defined(glib_typeof) &&
 defined(__cplusplus) && __cplusplus >= 201103L) */
 glib-2.68.4/glib/gatomic.h:217:#endif /* defined(glib_typeof) */
 glib-2.68.4/glib/gatomic.h:310:#if defined(glib_typeof) &&
 (!defined(glib_typeof_2_68) || GLIB_VERSION_MIN_REQUIRED >=
 GLIB_VERSION_2_68)
 glib-2.68.4/glib/gatomic.h:317:    *(atomic) = (glib_typeof (*(atomic)))
 (gsize) (newval);                  \
 glib-2.68.4/glib/gatomic.h:319:#else /* if !(defined(glib_typeof) &&
 (!defined(glib_typeof_2_68) || GLIB_VERSION_MIN_REQUIRED >=
 GLIB_VERSION_2_68)) */
 glib-2.68.4/glib/gatomic.h:328:#endif /* if defined(glib_typeof) &&
 (!defined(glib_typeof_2_68) || GLIB_VERSION_MIN_REQUIRED >=
 GLIB_VERSION_2_68) */
 glib-2.68.4/glib/gatomic.h:431:#if defined(glib_typeof) &&
 (!defined(glib_typeof_2_68) || GLIB_VERSION_MIN_REQUIRED >=
 GLIB_VERSION_2_68)
 glib-2.68.4/glib/gatomic.h:440:  (glib_typeof (*(atomic))) (void *)
 ((g_atomic_pointer_get) ((void *) atomic))
 glib-2.68.4/glib/gatomic.h:441:#else /* !(defined(glib_typeof) &&
 (!defined(glib_typeof_2_68) || GLIB_VERSION_MIN_REQUIRED >=
 GLIB_VERSION_2_68)) */
 glib-2.68.4/glib/gmacros.h:234:#undef glib_typeof
 glib-2.68.4/glib/gmacros.h:238:#define glib_typeof(t) __typeof__ (t)
 glib-2.68.4/glib/gmacros.h:244: * Within GLib itself, which use
 `glib_typeof` need to add the include
 glib-2.68.4/glib/gmacros.h:247:#define glib_typeof(t) typename
 std::remove_reference<decltype (t)>::type
 glib-2.68.4/glib/gmacros.h:248:#define glib_typeof_2_68
 glib-2.68.4/glib/gmem.h:34:#if defined(glib_typeof_2_68) &&
 GLIB_VERSION_MIN_REQUIRED >= GLIB_VERSION_2_68
 glib-2.68.4/glib/gmem.h:35:/* for glib_typeof */
 glib-2.68.4/glib/gmem.h:118:#if defined(glib_typeof) &&
 GLIB_VERSION_MAX_ALLOWED >= GLIB_VERSION_2_58 &&
 (!defined(glib_typeof_2_68) || GLIB_VERSION_MIN_REQUIRED >=
 GLIB_VERSION_2_68)
 glib-2.68.4/glib/gmem.h:123:    glib_typeof ((pp)) _pp = (pp);
 \
 glib-2.68.4/glib/gmem.h:124:    glib_typeof (*(pp)) _ptr = *_pp;
 \
 glib-2.68.4/glib/gmem.h:221:#if defined(glib_typeof) &&
 GLIB_VERSION_MAX_ALLOWED >= GLIB_VERSION_2_58 &&
 (!defined(glib_typeof_2_68) || GLIB_VERSION_MIN_REQUIRED >=
 GLIB_VERSION_2_68)
 glib-2.68.4/glib/gmem.h:222:#define g_steal_pointer(pp) ((glib_typeof
 (*pp)) (g_steal_pointer) (pp))
 glib-2.68.4/glib/grcbox.h:27:#if defined(glib_typeof_2_68) &&
 GLIB_VERSION_MIN_REQUIRED >= GLIB_VERSION_2_68
 glib-2.68.4/glib/grcbox.h:28:/* for glib_typeof */
 glib-2.68.4/glib/grcbox.h:79:#if defined(glib_typeof) &&
 (!defined(glib_typeof_2_68) || GLIB_VERSION_MIN_REQUIRED >=
 GLIB_VERSION_2_68)
 glib-2.68.4/glib/grcbox.h:82:  ((glib_typeof (mem_block))
 (g_rc_box_acquire) (mem_block))
 glib-2.68.4/glib/grcbox.h:84:  ((glib_typeof (mem_block))
 (g_atomic_rc_box_acquire) (mem_block))
 glib-2.68.4/glib/grcbox.h:88:  ((glib_typeof (mem_block)) (g_rc_box_dup)
 (block_size, mem_block))
 glib-2.68.4/glib/grcbox.h:90:  ((glib_typeof (mem_block))
 (g_atomic_rc_box_dup) (block_size, mem_block))
 glib-2.68.4/gobject/gobject.h:31:#if defined(glib_typeof_2_68) &&
 GLIB_VERSION_MIN_REQUIRED >= GLIB_VERSION_2_68
 glib-2.68.4/gobject/gobject.h:32:/* for glib_typeof */
 glib-2.68.4/gobject/gobject.h:521:#if defined(glib_typeof) &&
 GLIB_VERSION_MAX_ALLOWED >= GLIB_VERSION_2_56 &&
 (!defined(glib_typeof_2_68) || GLIB_VERSION_MIN_REQUIRED >=
 GLIB_VERSION_2_68)
 glib-2.68.4/gobject/gobject.h:523:#define g_object_ref(Obj) ((glib_typeof
 (Obj)) (g_object_ref) (Obj))
 glib-2.68.4/gobject/gobject.h:524:#define g_object_ref_sink(Obj)
 ((glib_typeof (Obj)) (g_object_ref_sink) (Obj))
 }}}

 So presumingly there is some GLib-2 C header file that defines this
 variable type… This, in `glib-2.68.4/glib/gatomic.h, could be helpful:

 {{{
    20   #ifndef __G_ATOMIC_H__
    21   #define __G_ATOMIC_H__
    22
    23   #if !defined (__GLIB_H_INSIDE__) && !defined (GLIB_COMPILATION)
    24   #error "Only <glib.h> can be included directly."
    25   #endif
    26
    27   #include <glib/gtypes.h>
    28
    29   #if defined(glib_typeof_2_68) && GLIB_VERSION_MIN_REQUIRED >=
 GLIB_VERSION_2_68
    30   /* for glib_typeof */
    31   #include <type_traits>
    32   #endif
 }}}

 No version of `gtypes.h` has this #define'd.

-- 
Ticket URL: <https://trac.macports.org/ticket/65663#comment:3>
MacPorts <https://www.macports.org/>
Ports system for macOS


More information about the macports-tickets mailing list