! Please note that this is a snapshot of our old Bugzilla server, which is read only since May 29, 2020. Please go to gitlab.xfce.org for our new server !
compilation of panel against vala0.48 fails
Status:
RESOLVED: FIXED
Product:
Xfce4-panel
Component:
General

Comments

Description Mukundan Ragavan 2020-02-04 23:53:23 CET
Fedora 32 rebuild happened recently and xfce4-panel does not build from source when compiled against GCC-10.

The build log is here - https://kojipkgs.fedoraproject.org//work/tasks/5282/41325282/build.log

How can I fix this? Thanks.
Comment 1 Simon Steinbeiss editbugs 2020-02-05 23:40:01 CET
Hi, what version of gcc did you compile with before?
I'm just surprised, there's no real change between 4.14.2 and 4.14.3 that would explain the build failure you're getting...

(FWIW I still have GCC 9.2.1)
Comment 2 Mukundan Ragavan 2020-02-05 23:47:27 CET
(In reply to Simon Steinbeiss from comment #1)
> Hi, what version of gcc did you compile with before?

9.2.1

> I'm just surprised, there's no real change between 4.14.2 and 4.14.3 that
> would explain the build failure you're getting...
> 
I do not think it is 4.14.2/4.14.3

The issue is most likely https://gcc.gnu.org/gcc-10/porting_to.html#common.

I am not sure though.
Comment 3 Mukundan Ragavan 2020-02-06 00:04:12 CET
Similar gcc-10 issue can also be found in xfce4-cpufreq-plugin, xfce4-sensors-plugin and thunarx-python. Fix is shown in #2.

I am not familiar with the code to apply the fix sadly.

See build logs here in these pages - 

cpufreq - https://koji.fedoraproject.org/koji/taskinfo?taskID=41325300

sensors - https://koji.fedoraproject.org/koji/taskinfo?taskID=41322934

thunarx-python - https://koji.fedoraproject.org/koji/taskinfo?taskID=41323181
Comment 4 Mukundan Ragavan 2020-02-06 00:33:20 CET
(In reply to Mukundan Ragavan from comment #3)
> 
> cpufreq - https://koji.fedoraproject.org/koji/taskinfo?taskID=41325300
> 

I think I was able to fix cpufreq with 

sed -i 's/CpuFreqPlugin \*cpuFreq/extern CpuFreqPlugin \*cpuFreq/' panel-plugin/xfce4-cpufreq-plugin.h


That said, not sure how to address panel (which is what this bug is about).
Comment 5 Mukundan Ragavan 2020-02-19 00:15:49 CET
ping! Any ideas on getting this to compile?

Thanks.
Comment 6 Dan Horák 2020-02-23 19:02:06 CET
The problem here isn't gcc10, but new vala (at least on my ppc64le system)

...
make[3]: Entering directory '/builddir/build/BUILD/xfce4-panel-4.14.3/libxfce4panel'
/usr/bin/vapigen-0.48  --library libxfce4panel-2.0 --metadatadir .  --girdir /usr/share/gir-1.0  libxfce4panel-2.0.gir
Generation failed: 1 error(s), 1 warning(s)
make[3]: Leaving directory '/builddir/build/BUILD/xfce4-panel-4.14.3/libxfce4panel'
warning: empty metadata
libxfce4panel-2.0.gir:2359.7-2359.40: error: overriding method `Xfce.PanelPlugin.remote_event' is incompatible with base method `bool Xfce.PanelPluginProvider.remote_event (string, GLib.Value, uint)': too few parameters.
      <glib:signal name="remote-event" when="last">
      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
make[3]: *** [/usr/share/vala/Makefile.vapigen:61: libxfce4panel-2.0.vapi] Error 1
make[3]: *** Waiting for unfinished jobs....
make[3]: Entering directory '/builddir/build/BUILD/xfce4-panel-4.14.3/libxfce4panel'
/usr/bin/g-ir-compiler --includedir=. --includedir=/usr/share/gir-1.0 --includedir=. --includedir=. libxfce4panel-2.0.gir -o libxfce4panel-2.0.typelib
make[3]: Leaving directory '/builddir/build/BUILD/xfce4-panel-4.14.3/libxfce4panel'
make[2]: *** [Makefile:891: all] Error 2

xfce4-panel-4.14.3-2.fc33 builds fine in Rawhide when I downgrade vala to vala-0.46.5-1.fc32. From the error message I guess it reports a real problem in xfce4-panel.
Comment 7 Robin Lee 2020-02-24 16:18:26 CET
Created attachment 9486 
Fix build for Fedora 32

This patch can fix the build, but I haven't go deep to see whether it is semantically correct.
Comment 8 Simon Steinbeiss editbugs 2020-03-02 23:49:54 CET
I'm also not sure if this is semantically correct, but for reference, this is the commit that introduced the handle:
https://git.xfce.org/xfce/xfce4-panel/commit/?id=d168066d3
Comment 9 Robin Lee 2020-03-03 04:04:48 CET
Comment on attachment 9486 
Fix build for Fedora 32

The code is insane on the C level. But it is ambiguous on the Vala level and latest Vala turns this ambiguity into an error. To fix that, the Vala API has to be specified manually, otherwise the C API/ABI has to be changed.
Comment 10 ToZ editbugs 2020-03-08 12:46:54 CET
Additional info: with vala 0.48.0, xfce4-panel no longer builds. Downgrading to 0.46.6 makes it work again. Looks like a vala regression/change.
Comment 11 Ali Akcaagac 2020-03-16 22:15:32 CET
*** Bug 16562 has been marked as a duplicate of this bug. ***
Comment 12 ToZ editbugs 2020-03-23 22:53:03 CET
The patch from comment #9 breaks the plugin-event refresh functionality.
Comment 13 Simon Steinbeiss editbugs 2020-04-21 01:28:59 CEST
*** Bug 16706 has been marked as a duplicate of this bug. ***
Comment 14 inactive 2020-04-21 03:43:38 CEST
(In reply to ToZ from comment #12)
> The patch from comment #9 breaks the plugin-event refresh functionality.

I might be missing something but isn't the args order wrong? 

-                 name, value, &stop_emission);
+                 name, value, handle, &stop_emission);
Comment 15 inactive 2020-04-21 03:48:26 CEST
oh, nevermind!!11
Comment 16 inactive 2020-04-21 04:32:35 CEST
Maybe these warnings should be errors? please ? (while using patch from Comment 9 )

xfce-panel-plugin.c:353: Warning: libxfce4panel: incorrect number of parameters in comment block, parameter annotations will be ignored.
  GICOMP   libxfce4panel-2.0.gir
 VAPIGEN libxfce4panel-2.0.vapi
warning: empty metadata

applicationsmenu.c: In function ‘applications_menu_plugin_class_init’:
applicationsmenu.c:143:30: warning: assignment to ‘gboolean (*)(XfcePanelPlugin *, const gchar *, const GValue *, guint *)’ {aka ‘int (*)(struct _XfcePanelPlugin *, const char *, const struct _GValue *, unsigned int *)’} from incompatible pointer type ‘gboolean (*)(XfcePanelPlugin *, const gchar *, const GValue *)’ {aka ‘int (*)(struct _XfcePanelPlugin *, const char *, const struct _GValue *)’} [-Wincompatible-pointer-types]
  143 |   plugin_class->remote_event = applications_menu_plugin_remote_event;
      |                

directorymenu.c: In function ‘directory_menu_plugin_class_init’:
directorymenu.c:132:30: warning: assignment to ‘gboolean (*)(XfcePanelPlugin *, const gchar *, const GValue *, guint *)’ {aka ‘int (*)(struct _XfcePanelPlugin *, const char *, const struct _GValue *, unsigned int *)’} from incompatible pointer type ‘gboolean (*)(XfcePanelPlugin *, const gchar *, const GValue *)’ {aka ‘int (*)(struct _XfcePanelPlugin *, const char *, const struct _GValue *)’} [-Wincompatible-pointer-types]
  132 |   plugin_class->remote_event = directory_menu_plugin_remote_event;
      |        

launcher.c: In function ‘launcher_plugin_class_init’:
launcher.c:280:30: warning: assignment to ‘gboolean (*)(XfcePanelPlugin *, const gchar *, const GValue *, guint *)’ {aka ‘int (*)(struct _XfcePanelPlugin *, const char *, const struct _GValue *, unsigned int *)’} from incompatible pointer type ‘gboolean (*)(XfcePanelPlugin *, const gchar *, const GValue *)’ {aka ‘int (*)(struct _XfcePanelPlugin *, const char *, const struct _GValue *)’} [-Wincompatible-pointer-types]
  280 |   plugin_class->remote_event = launcher_plugin_remote_event;
      |      

windowmenu.c: In function ‘window_menu_plugin_class_init’:
windowmenu.c:164:30: warning: assignment to ‘gboolean (*)(XfcePanelPlugin *, const gchar *, const GValue *, guint *)’ {aka ‘int (*)(struct _XfcePanelPlugin *, const char *, const struct _GValue *, unsigned int *)’} from incompatible pointer type ‘gboolean (*)(XfcePanelPlugin *, const gchar *, const GValue *)’ {aka ‘int (*)(struct _XfcePanelPlugin *, const char *, const struct _GValue *)’} [-Wincompatible-pointer-types]
  164 |   plugin_class->remote_event = window_menu_plugin_remote_event;
      |                              ^
Comment 17 inactive 2020-04-21 04:35:43 CEST
let me align those so that's more obvious there's a missing arg.

applicationsmenu.c: In function ‘applications_menu_plugin_class_init’:
applicationsmenu.c:143:30: warning: assignment to 
‘gboolean (*)(XfcePanelPlugin *, const gchar *, const GValue *, guint *)’ 
{aka ‘int (*)(struct _XfcePanelPlugin *, const char *, const struct _GValue *, unsigned int *)’} 
from incompatible pointer type 
‘gboolean (*)(XfcePanelPlugin *, const gchar *, const GValue *)’ 
{aka ‘int (*)(struct _XfcePanelPlugin *, const char *, const struct _GValue *)’} 
[-Wincompatible-pointer-types]
  143 |   plugin_class->remote_event = applications_menu_plugin_remote_event;
      |                

directorymenu.c: In function ‘directory_menu_plugin_class_init’:
directorymenu.c:132:30: warning: assignment to 
‘gboolean (*)(XfcePanelPlugin *, const gchar *, const GValue *, guint *)’ 
{aka ‘int (*)(struct _XfcePanelPlugin *, const char *, const struct _GValue *, unsigned int *)’}
from incompatible pointer type 
‘gboolean (*)(XfcePanelPlugin *, const gchar *, const GValue *)’ 
{aka ‘int (*)(struct _XfcePanelPlugin *, const char *, const struct _GValue *)’} 
[-Wincompatible-pointer-types]
  132 |   plugin_class->remote_event = directory_menu_plugin_remote_event;
      |        

launcher.c: In function ‘launcher_plugin_class_init’:
launcher.c:280:30: warning: assignment to 
‘gboolean (*)(XfcePanelPlugin *, const gchar *, const GValue *, guint *)’ 
{aka ‘int (*)(struct _XfcePanelPlugin *, const char *, const struct _GValue *, unsigned int *)’} 
from incompatible pointer type 
‘gboolean (*)(XfcePanelPlugin *, const gchar *, const GValue *)’ 
{aka ‘int (*)(struct _XfcePanelPlugin *, const char *, const struct _GValue *)’} 
[-Wincompatible-pointer-types]
  280 |   plugin_class->remote_event = launcher_plugin_remote_event;
      |      

windowmenu.c: In function ‘window_menu_plugin_class_init’:
windowmenu.c:164:30: warning: assignment to 
‘gboolean (*)(XfcePanelPlugin *, const gchar *, const GValue *, guint *)’ 
{aka ‘int (*)(struct _XfcePanelPlugin *, const char *, const struct _GValue *, unsigned int *)’} 
from incompatible pointer type 
‘gboolean (*)(XfcePanelPlugin *, const gchar *, const GValue *)’ 
{aka ‘int (*)(struct _XfcePanelPlugin *, const char *, const struct _GValue *)’} 
[-Wincompatible-pointer-types]
  164 |   plugin_class->remote_event = window_menu_plugin_remote_event;
      |                              ^
Comment 18 inactive 2020-04-21 05:06:12 CEST
Created attachment 9763 
the Comment 9 patch without the above warnings (eg. built with -Werror)

not sure if it's complete, maybe that 'handle' arg. needs to be used somehow, no idea
Comment 19 Skunnyk editbugs 2020-04-25 01:24:44 CEST
From what I understand, the "handle" has been added back in 2010 in https://git.xfce.org/xfce/xfce4-panel/commit/?id=d168066d3
But not for internal plugins.
External plugins (all plugins not in core panel - launcher, windowmenu, directorymenu, applicationmenu) already get the "handle" with https://git.xfce.org/xfce/xfce4-panel/tree/panel/panel-plugin-external-wrapper.c#n346 / https://git.xfce.org/xfce/xfce4-panel/tree/panel/panel-plugin-external-wrapper.c#n424 . Btw, It seems that only xfce4-places-plugin g_connect to the "remote-event" signal

I don't know exactly why internal plugins doesn't have the handle emitted (omission ?) 
I guess your patch is logic, and fix the problem (need to double check if any behavior change). Looks good on 4.14 branch too.

gtkdoc needs to be updated for "XfcePanelPlugin::remote-event" part to add handle arg.
Comment 20 ToZ editbugs 2020-04-25 21:24:39 CEST
Unfortunately, the patch in comment 18 doesn't work for me with respect to remote event functionality. Tested with applicationsmenu and directorymenu:

Commands:
   /usr/bin/xfce4-panel --plugin-event=applicationsmenu:popup:bool:false
   /usr/bin/xfce4-panel --plugin-event=directorymenu:popup:bool:false
(this is basically what the popup commands do).

Also doesn't work for the genmon plugin, but I haven't looked into yet as this needs to fixed first. As well, the whiskermenu and places plugin use remote event functionality.
Comment 21 Skunnyk editbugs 2020-04-26 01:26:11 CEST
Yes, right, I really don't understand this code :)
For now you can compile panel with "--enable-vala=no". We can update m4/vapigen.m4 to default to "no" until fixed.

Or we can skip remote_event processing by vapigen with:
"""
PanelPlugin.remote_event skip
"""

in libxfce4panel/libxfce4panel-2.0.metadata file, not sure what this can break, but not so much people are using vala binding…

Note: I spotted a bug in '-p' argument on xfce4-popup-windowmenu or xfce4-popup-applicationsmenu or xfce4-popup-directorymenu: the menu is not popped up at pointer, but that's another topic.
Comment 22 ToZ editbugs 2020-04-26 01:41:06 CEST
Enabled debugging. I get this message when trying using remote-event:

(xfce4-panel:39074): libxfce4panel-CRITICAL **: 19:33:33.617: _libxfce4panel_marshal_BOOLEAN__STRING_BOXED: assertion 'n_param_values == 3' failed
Comment 23 ToZ editbugs 2020-04-26 01:52:11 CEST
@Skunnyk, thanks. With "--enable-vala=no", remote-event works again and can build with vala 48. 

Not sure if anything else gets broken with vala disabled. 

You are right about the "-p" parameter, something is broken there. Here is the debug output:

(xfce4-panel:59323): Gtk-CRITICAL **: 19:50:59.607: gtk_menu_popup_at_widget: assertion 'GTK_IS_WIDGET (widget)' failed
Comment 24 Skunnyk editbugs 2020-04-26 23:26:48 CEST
Created attachment 9806 
Fix panel build with vala 0.48

For now, skip the processing of "PanelPlugin.remote_event" during vapigen. 
The warning was present on vala <0.48, but is now an error.

This will remove "PanelPlugin.remote_event" from vala binding until we find a better fix (if there is any)
Comment 25 ToZ editbugs 2020-04-27 00:41:30 CEST
Thanks for the simplified patch. Works fine here. No issues noted yet.
Comment 26 Git Bot editbugs 2020-04-27 22:54:52 CEST
Romain Bouvier referenced this bugreport in commit 659d61ee2901ffe1e34f7dbcf5d8213b7a17d142

Fix panel build with vala 0.48 (Bug #16426)

https://git.xfce.org/xfce/xfce4-panel/commit?id=659d61ee2901ffe1e34f7dbcf5d8213b7a17d142
Comment 27 Simon Steinbeiss editbugs 2020-04-27 23:01:32 CEST
I will close this issue as fixed - even if it is a workaround - until someone with a vala plugin wants to use this feature and reopens it ;)
Comment 28 Git Bot editbugs 2020-04-28 12:51:51 CEST
Romain Bouvier referenced this bugreport in commit 4922b1136a91b3696b65c6f8b43253aa52c12b76

Fix panel build with vala 0.48 (Bug #16426)

https://git.xfce.org/xfce/xfce4-panel/commit?id=4922b1136a91b3696b65c6f8b43253aa52c12b76

Bug #16426

Reported by:
Mukundan Ragavan
Reported on: 2020-02-04
Last modified on: 2020-04-28
Duplicates (2):
  • 16562 xfce4-panel 4.15.x fails building on the upcoming Fedora 32 release worked with Fedora 31
  • 16706 compiling error archlinux

People

Assignee:
Simon Steinbeiss
CC List:
9 users

Version

Version:
4.14.3

Attachments

Additional information