Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 844919 - gnome-base/gnome-shell-42.1-r1 with sys-auth/polkit-0.120_p20220509: /usr/include/glib-2.0/glib/gmacros.h:1195:49: error: redefinition of ‘glib_autoptr_clear_PolkitAgentListener’
Summary: gnome-base/gnome-shell-42.1-r1 with sys-auth/polkit-0.120_p20220509: /usr/inc...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Gentoo Linux Gnome Desktop Team
URL: https://gitlab.freedesktop.org/polkit...
Whiteboard:
Keywords: PATCH
: 844922 846566 846611 (view as bug list)
Depends on:
Blocks:
 
Reported: 2022-05-15 20:16 UTC by Kobboi
Modified: 2022-06-26 07:56 UTC (History)
14 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
build.log.gz (build.log.gz,12.69 KB, application/gzip)
2022-05-15 20:17 UTC, Kobboi
Details
emerge-info.txt (emerge-info.txt,7.79 KB, text/plain)
2022-05-15 20:17 UTC, Kobboi
Details
polkit-autoptr.patch (file_844919.txt,589 bytes, patch)
2022-05-17 08:43 UTC, Sam James
Details | Diff
Patch https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2296.patch (2296.patch,2.14 KB, patch)
2022-05-17 18:26 UTC, Bernd Feige
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Kobboi 2022-05-15 20:16:20 UTC
[186/273] x86_64-pc-linux-gnu-gcc -Isrc/libgnome-shell.so.p -Isrc -I../gnome-shell-42.1/src -I. -I../gnome-shell-42.1 -Isrc/st -I../gnome-shell-42.1/src/st -Isrc/tray -I../gnome-shell-42.1/src/tray -Ijs -I/usr/include/gio-unix-2.0 -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -I/usr/include/sysprof-4 -I/usr/lib64/libffi/include -I/usr/include/libmount -I/usr/include/blkid -I/usr/include/libxml2 -I/usr/include/gtk-3.0 -I/usr/include/pango-1.0 -I/usr/include/harfbuzz -I/usr/include/freetype2 -I/usr/include/fribidi -I/usr/include/cairo -I/usr/include/pixman-1 -I/usr/include/libpng16 -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/sysprof-3 -I/usr/include/atk-1.0 -I/usr/include/at-spi2-atk/2.0 -I/usr/include/dbus-1.0 -I/usr/lib64/dbus-1.0/include -I/usr/include/at-spi-2.0 -I/usr/include/gjs-1.0 -I/usr/include/gobject-introspection-1.0 -I/usr/include/nspr -I/usr/include/mutter-10/clutter -I/usr/include/json-glib-1.0 -I/usr/include/mutter-10/cogl -I/usr/include/graphene-1.0 -I/usr/lib64/graphene-1.0/include -I/usr/include/startup-notification-1.0 -I/usr/include/polkit-1 -I/usr/include/gcr-3 -I/usr/include/p11-kit-1 -I/usr/include/gck-1 -I/usr/include/libnm -I/usr/include/libsecret-1 -I/usr/include/gstreamer-1.0 -I/usr/include/mutter-10 -I/usr/include/gsettings-desktop-schemas -I/usr/include/gnome-desktop-3.0 -fdiagnostics-color=always -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -O0 -O2 -march=znver3 -pipe -g -ggdb3 -fPIC -pthread -mfpmath=sse -msse -msse2 -mfpmath=sse -msse -msse2 -mfpmath=sse -msse -msse2 -isystem /usr/include/mozjs-91 -DCLUTTER_ENABLE_EXPERIMENTAL_API -DCOGL_ENABLE_EXPERIMENTAL_API '-DVERSION="42.1"' '-DLOCALEDIR="/usr/share/locale"' '-DDATADIR="/usr/share"' '-DGNOME_SHELL_LIBEXECDIR="/usr/libexec"' '-DGNOME_SHELL_DATADIR="/usr/share/gnome-shell"' '-DGNOME_SHELL_PKGLIBDIR="/usr/lib64/gnome-shell"' -MD -MQ src/libgnome-shell.so.p/shell-polkit-authentication-agent.c.o -MF src/libgnome-shell.so.p/shell-polkit-authentication-agent.c.o.d -o src/libgnome-shell.so.p/shell-polkit-authentication-agent.c.o -c ../gnome-shell-42.1/src/shell-polkit-authentication-agent.c
FAILED: src/libgnome-shell.so.p/shell-polkit-authentication-agent.c.o 
x86_64-pc-linux-gnu-gcc -Isrc/libgnome-shell.so.p -Isrc -I../gnome-shell-42.1/src -I. -I../gnome-shell-42.1 -Isrc/st -I../gnome-shell-42.1/src/st -Isrc/tray -I../gnome-shell-42.1/src/tray -Ijs -I/usr/include/gio-unix-2.0 -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -I/usr/include/sysprof-4 -I/usr/lib64/libffi/include -I/usr/include/libmount -I/usr/include/blkid -I/usr/include/libxml2 -I/usr/include/gtk-3.0 -I/usr/include/pango-1.0 -I/usr/include/harfbuzz -I/usr/include/freetype2 -I/usr/include/fribidi -I/usr/include/cairo -I/usr/include/pixman-1 -I/usr/include/libpng16 -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/sysprof-3 -I/usr/include/atk-1.0 -I/usr/include/at-spi2-atk/2.0 -I/usr/include/dbus-1.0 -I/usr/lib64/dbus-1.0/include -I/usr/include/at-spi-2.0 -I/usr/include/gjs-1.0 -I/usr/include/gobject-introspection-1.0 -I/usr/include/nspr -I/usr/include/mutter-10/clutter -I/usr/include/json-glib-1.0 -I/usr/include/mutter-10/cogl -I/usr/include/graphene-1.0 -I/usr/lib64/graphene-1.0/include -I/usr/include/startup-notification-1.0 -I/usr/include/polkit-1 -I/usr/include/gcr-3 -I/usr/include/p11-kit-1 -I/usr/include/gck-1 -I/usr/include/libnm -I/usr/include/libsecret-1 -I/usr/include/gstreamer-1.0 -I/usr/include/mutter-10 -I/usr/include/gsettings-desktop-schemas -I/usr/include/gnome-desktop-3.0 -fdiagnostics-color=always -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -O0 -O2 -march=znver3 -pipe -g -ggdb3 -fPIC -pthread -mfpmath=sse -msse -msse2 -mfpmath=sse -msse -msse2 -mfpmath=sse -msse -msse2 -isystem /usr/include/mozjs-91 -DCLUTTER_ENABLE_EXPERIMENTAL_API -DCOGL_ENABLE_EXPERIMENTAL_API '-DVERSION="42.1"' '-DLOCALEDIR="/usr/share/locale"' '-DDATADIR="/usr/share"' '-DGNOME_SHELL_LIBEXECDIR="/usr/libexec"' '-DGNOME_SHELL_DATADIR="/usr/share/gnome-shell"' '-DGNOME_SHELL_PKGLIBDIR="/usr/lib64/gnome-shell"' -MD -MQ src/libgnome-shell.so.p/shell-polkit-authentication-agent.c.o -MF src/libgnome-shell.so.p/shell-polkit-authentication-agent.c.o.d -o src/libgnome-shell.so.p/shell-polkit-authentication-agent.c.o -c ../gnome-shell-42.1/src/shell-polkit-authentication-agent.c
In file included from /usr/lib64/glib-2.0/include/glibconfig.h:9,
                 from /usr/include/glib-2.0/glib/gtypes.h:32,
                 from /usr/include/glib-2.0/glib/galloca.h:32,
                 from /usr/include/glib-2.0/glib.h:30,
                 from /usr/include/glib-2.0/gobject/gbinding.h:28,
                 from /usr/include/glib-2.0/glib-object.h:22,
                 from /usr/include/polkit-1/polkitagent/polkitagenttypes.h:29,
                 from /usr/include/polkit-1/polkitagent/polkitagent.h:30,
                 from ../gnome-shell-42.1/src/shell-polkit-authentication-agent.h:12,
                 from ../gnome-shell-42.1/src/shell-polkit-authentication-agent.c:13:
/usr/include/glib-2.0/glib/gmacros.h:1195:49: error: redefinition of ‘glib_autoptr_clear_PolkitAgentListener’
 1195 | #define _GLIB_AUTOPTR_CLEAR_FUNC_NAME(TypeName) glib_autoptr_clear_##TypeName
      |                                                 ^~~~~~~~~~~~~~~~~~~
/usr/include/glib-2.0/glib/gmacros.h:1211:36: note: in expansion of macro ‘_GLIB_AUTOPTR_CLEAR_FUNC_NAME’
 1211 |   static G_GNUC_UNUSED inline void _GLIB_AUTOPTR_CLEAR_FUNC_NAME(TypeName) (TypeName *_ptr)                     \
      |                                    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/glib-2.0/glib/gmacros.h:1228:3: note: in expansion of macro ‘_GLIB_DEFINE_AUTOPTR_CLEANUP_FUNCS’
 1228 |   _GLIB_DEFINE_AUTOPTR_CLEANUP_FUNCS(TypeName, TypeName, func)
      |   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../gnome-shell-42.1/src/shell-polkit-authentication-agent.h:18:1: note: in expansion of macro ‘G_DEFINE_AUTOPTR_CLEANUP_FUNC’
   18 | G_DEFINE_AUTOPTR_CLEANUP_FUNC (PolkitAgentListener, g_object_unref)
      | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/glib-2.0/glib/gmacros.h:1195:49: note: previous definition of ‘glib_autoptr_clear_PolkitAgentListener’ with type ‘void(PolkitAgentListener *)’ {aka ‘void(struct _PolkitAgentListener *)’}
 1195 | #define _GLIB_AUTOPTR_CLEAR_FUNC_NAME(TypeName) glib_autoptr_clear_##TypeName
      |                                                 ^~~~~~~~~~~~~~~~~~~
/usr/include/glib-2.0/glib/gmacros.h:1211:36: note: in expansion of macro ‘_GLIB_AUTOPTR_CLEAR_FUNC_NAME’
 1211 |   static G_GNUC_UNUSED inline void _GLIB_AUTOPTR_CLEAR_FUNC_NAME(TypeName) (TypeName *_ptr)                     \
      |                                    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/glib-2.0/glib/gmacros.h:1228:3: note: in expansion of macro ‘_GLIB_DEFINE_AUTOPTR_CLEANUP_FUNCS’

(...)

Reproducible: Always
Comment 1 Kobboi 2022-05-15 20:17:17 UTC
Created attachment 779150 [details]
build.log.gz
Comment 2 Kobboi 2022-05-15 20:17:19 UTC
Created attachment 779153 [details]
emerge-info.txt
Comment 3 Kobboi 2022-05-15 20:18:23 UTC
Note that this is not due to the recent gnome-shell bump, 42.1 fails with this as well.
Comment 4 Kobboi 2022-05-15 20:19:44 UTC
*** Bug 844922 has been marked as a duplicate of this bug. ***
Comment 5 Kobboi 2022-05-15 20:41:12 UTC
Compiles fine with polkit-0.120_p20220221-r1, adapted the description.
Comment 6 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2022-05-17 08:43:46 UTC
Created attachment 779327 [details, diff]
polkit-autoptr.patch

Untested but this might work. Anyone fancy trying it?
Comment 7 Kobboi 2022-05-17 09:17:51 UTC
Compiles fine with patch
Comment 8 Kobboi 2022-05-17 09:29:31 UTC
And no particular runtime problems either :)
Comment 9 Johannes Penßel 2022-05-17 13:41:58 UTC
For some reason, this patch seems to have no effect on my system. (still the exact same build errors as before) 

Simply patching out the offending line entirely works fine though, so the solution does work in principle. Maybe there is some issue on my end.
Comment 10 Harris Landgarten 2022-05-17 13:47:55 UTC
I also had the same error with the patch.
Comment 11 Kobboi 2022-05-17 14:22:20 UTC
And the build logs show the patch being applied?

>>> Emerging (1 of 1) gnome-base/gnome-shell-42.1::gentoo
 * gnome-shell-42.1.tar.xz BLAKE2B SHA512 size ;-) ...                                                                                                                                                      [ ok ]
 * Using python3.9 to build
>>> Unpacking source...
>>> Unpacking gnome-shell-42.1.tar.xz to /var/tmp/portage/gnome-base/gnome-shell-42.1/work
>>> Source unpacked in /var/tmp/portage/gnome-base/gnome-shell-42.1/work
>>> Preparing source in /var/tmp/portage/gnome-base/gnome-shell-42.1/work/gnome-shell-42.1 ...
 * Applying 42.0-optional-bluetooth.patch ...
patching file js/misc/meson.build
Hunk #1 succeeded at 3 with fuzz 1.
patching file meson.build
patching file meson_options.txt                                                                                                                                                                             [ ok ]
 * Applying 40.0-defaults.patch ...                                                                                                                                                                         [ ok ]
 * ================================================================================================================================================================================================================
 * Applying user patches from /etc/portage/patches ...
 * Applying blahblah.patch ...                                                                                                                                                                                  [ ok ]
 * User patches applied.
 * =========================================================
Comment 12 Bernd Feige 2022-05-17 15:38:48 UTC
I'm in the "patch does apply but error remains" camp:

>>> Emerging (2 of 2) gnome-base/gnome-shell-42.1-r1::gentoo
 * gnome-shell-42.1.tar.xz BLAKE2B SHA512 size ;-) ...                                       [ ok ]
 * Using python3.10 to build
>>> Unpacking source...
>>> Unpacking gnome-shell-42.1.tar.xz to /var/tmp/portage/gnome-base/gnome-shell-42.1-r1/work
>>> Source unpacked in /var/tmp/portage/gnome-base/gnome-shell-42.1-r1/work
>>> Preparing source in /var/tmp/portage/gnome-base/gnome-shell-42.1-r1/work/gnome-shell-42.1 ...
 * Applying 42.0-optional-bluetooth.patch ...
patching file js/misc/meson.build
Hunk #1 succeeded at 3 with fuzz 1.
patching file meson.build
patching file meson_options.txt                                                              [ ok ]
 * Applying 40.0-defaults.patch ...                                                          [ ok ]
 * =================================================================================================
 * Applying user patches from /etc/portage/patches ...
 * Applying polkit-autoptr.patch ...                                                         [ ok ]
 * User patches applied.
 * =================================================================================================
>>> Source prepared.

...

In file included from /usr/lib64/glib-2.0/include/glibconfig.h:9,
                 from /usr/include/glib-2.0/glib/gtypes.h:32,
                 from /usr/include/glib-2.0/glib/galloca.h:32,
                 from /usr/include/glib-2.0/glib.h:30,
                 from /usr/include/glib-2.0/gobject/gbinding.h:28,
                 from /usr/include/glib-2.0/glib-object.h:22,
                 from /usr/include/polkit-1/polkitagent/polkitagenttypes.h:29,
                 from /usr/include/polkit-1/polkitagent/polkitagent.h:30,
                 from ../gnome-shell-42.1/src/shell-polkit-authentication-agent.h:12,
                 from ../gnome-shell-42.1/src/shell-polkit-authentication-agent.c:13:
/usr/include/glib-2.0/glib/gmacros.h:1195:49: error: redefinition of ‘glib_autoptr_clear_PolkitAgentListener’
 1195 | #define _GLIB_AUTOPTR_CLEAR_FUNC_NAME(TypeName) glib_autoptr_clear_##TypeName
      |                                                 ^~~~~~~~~~~~~~~~~~~
/usr/include/glib-2.0/glib/gmacros.h:1211:36: note: in expansion of macro ‘_GLIB_AUTOPTR_CLEAR_FUNC_NAME’
 1211 |   static G_GNUC_UNUSED inline void _GLIB_AUTOPTR_CLEAR_FUNC_NAME(TypeName) (TypeName *_ptr)                     \
      |                                    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~


Just as the others suggested, replacing
#ifndef glib_autoptr_clear_PolkitAgentListener
with
#if 0

makes compilation succeed here, so obviously glib_autoptr_clear_PolkitAgentListener is not defined here.
Comment 13 matt 2022-05-17 17:28:48 UTC
I have the exact same output as Bernd, applying the patch and the build still fails.
Comment 15 Bernd Feige 2022-05-17 18:26:31 UTC
Created attachment 779351 [details, diff]
Patch https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2296.patch

Thanks! 2296.patch applies cleanly and allows gnome-shell to compile here.
Comment 16 Ben Kohler gentoo-dev 2022-05-17 18:29:59 UTC
Also can report success here with MR 2296.patch
Comment 17 Larry the Git Cow gentoo-dev 2022-05-17 21:59:13 UTC
The bug has been closed via the following commit(s):

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

commit 042dabffb96f3b8fd74e0cbb14c524c81e7304df
Author:     Sam James <sam@gentoo.org>
AuthorDate: 2022-05-17 21:58:52 +0000
Commit:     Sam James <sam@gentoo.org>
CommitDate: 2022-05-17 21:58:52 +0000

    gnome-base/gnome-shell: backport new Polkit patch (g_autoptr)
    
    Closes: https://bugs.gentoo.org/844919
    Signed-off-by: Sam James <sam@gentoo.org>

 .../gnome-shell/files/42.1-polkit-g_autoptr.patch  | 53 ++++++++++++++++++++++
 gnome-base/gnome-shell/gnome-shell-42.1-r1.ebuild  |  3 ++
 2 files changed, 56 insertions(+)
Comment 18 Larry the Git Cow gentoo-dev 2022-05-18 02:47:17 UTC
The bug has been referenced in the following commit(s):

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

commit e1df0e6bebfefc3201442e0da922a81689cb28bd
Author:     Sam James <sam@gentoo.org>
AuthorDate: 2022-05-18 02:45:09 +0000
Commit:     Sam James <sam@gentoo.org>
CommitDate: 2022-05-18 02:47:09 +0000

    gnome-base/gnome-shell: revbump for Polkit patch
    
    As Matt points out, we might end up installing gnome-shell w/ an older
    polkit, then upgrading polkit, and then nobody provides the autoref
    bits.
    
    Given it can go both ways, depend on a newer Polkit which always
    has the autoref bits, and add the patch to said new version.
    
    (Also, revbump -r1 -> r2 with no patch, for consistency, as people
    will have likely merged the -r1 w/ the polkit build fix, but in theory
    could (but unlikely!) downgrade polkit at some point, and it's
    just a lot easier to handle bugs this way if we know everything is
    in a sane state.)
    
    Bit annoyed I didn't think it through fully as I went back and forth
    a few times and decided on not, wrongly.
    
    Bug: https://bugs.gentoo.org/844919
    Signed-off-by: Sam James <sam@gentoo.org>

 gnome-base/gnome-shell/gnome-shell-42.1-r2.ebuild  | 203 +++++++++++++++++++++
 ...l-42.1-r1.ebuild => gnome-shell-42.1-r3.ebuild} |   2 +-
 2 files changed, 204 insertions(+), 1 deletion(-)
Comment 19 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2022-05-20 12:34:37 UTC
*** Bug 846566 has been marked as a duplicate of this bug. ***
Comment 20 Ciaran 2022-06-18 03:47:19 UTC
*** Bug 846611 has been marked as a duplicate of this bug. ***
Comment 21 Larry the Git Cow gentoo-dev 2022-06-24 03:43:10 UTC
The bug has been referenced in the following commit(s):

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

commit dea2c90c1aee7d012a467eeb937fc4a7ecae9237
Author:     Sam James <sam@gentoo.org>
AuthorDate: 2022-06-24 03:42:30 +0000
Commit:     Sam James <sam@gentoo.org>
CommitDate: 2022-06-24 03:42:42 +0000

    gnome-base/gnome-shell: restore 42.1-r3 for Polkit fix
    
    Bug: https://bugs.gentoo.org/844919
    Bug: https://bugs.gentoo.org/849566
    Fixes: eed2ee4b79e40099d84db0dde29dced1e3346bb6
    Signed-off-by: Sam James <sam@gentoo.org>

 .../gnome-shell/files/42.1-polkit-g_autoptr.patch  |  53 ++++++
 gnome-base/gnome-shell/gnome-shell-42.1-r3.ebuild  | 206 +++++++++++++++++++++
 2 files changed, 259 insertions(+)
Comment 22 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2022-06-26 07:56:07 UTC
(In reply to Larry the Git Cow from comment #21)
> The bug has been referenced in the following commit(s):
> 
> https://gitweb.gentoo.org/repo/gentoo.git/commit/
> ?id=dea2c90c1aee7d012a467eeb937fc4a7ecae9237
> 
> commit dea2c90c1aee7d012a467eeb937fc4a7ecae9237
> Author:     Sam James <sam@gentoo.org>
> AuthorDate: 2022-06-24 03:42:30 +0000
> Commit:     Sam James <sam@gentoo.org>
> CommitDate: 2022-06-24 03:42:42 +0000
> 
>     gnome-base/gnome-shell: restore 42.1-r3 for Polkit fix
>     
>     Bug: https://bugs.gentoo.org/844919
>     Bug: https://bugs.gentoo.org/849566
>     Fixes: eed2ee4b79e40099d84db0dde29dced1e3346bb6
>     Signed-off-by: Sam James <sam@gentoo.org>
> 
>  .../gnome-shell/files/42.1-polkit-g_autoptr.patch  |  53 ++++++
>  gnome-base/gnome-shell/gnome-shell-42.1-r3.ebuild  | 206
> +++++++++++++++++++++
>  2 files changed, 259 insertions(+)

... and now stabled. Oops.