! 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 !
xfce4-power-manager-1.3.0 uses functions from upower-0.9.23's headers that ar...
Status:
RESOLVED: FIXED
Product:
Xfce4-power-manager
Component:
General

Comments

Description Samuli Suominen 2014-06-02 18:16:08 CEST
Created attachment 5508 
complete compile log (./configure and make)

I have UPower 0.9.23 installed, and if I had to guess, I'd guess these symbols are from UPower 0.99.0 and shouldn't be used with 0.9 git branch (such as it's last release, 0.9.23)?

 * xfpm-power.c:249:5: warning: implicit declaration of function ‘up_client_get_can_suspend’ [-Wimplicit-function-declaration]
 * xfpm-power.c:250:5: warning: implicit declaration of function ‘up_client_get_can_hibernate’ [-Wimplicit-function-declaration]
 * xfpm-power.c:398:6: warning: implicit declaration of function ‘up_client_hibernate_sync’ [-Wimplicit-function-declaration]
 * xfpm-power.c:402:6: warning: implicit declaration of function ‘up_client_suspend_sync’ [-Wimplicit-function-declaration]

See the attachment for complete build log, you can then pinpoint above lines
Comment 1 Eric Koegel editbugs 2014-06-02 19:12:10 CEST
Those symbols are supposed to be in 0.9.23! Might have to switch to direct dbus calls for them, I'll look at UPower to see what it's up to.
Comment 2 Eric Koegel editbugs 2014-06-02 19:27:24 CEST
Ah, make sure upower 0.9.23 has the --enable-deprecated configure switch. xfpm assumes upower < .99 has it. Do you want xfpm to work without upower's deprecated support?
Comment 3 Samuli Suominen 2014-06-02 19:36:17 CEST
My 0.9.23 is built with --enable-deprecated
Comment 4 Samuli Suominen 2014-06-02 19:38:43 CEST
From UPower 0.9.23 install:

$ ./configure --enable-deprecated
[ .. snip .. ]
Enable deprecated stuff:    yes

As in, the build log attached here is from with UPower that has been built with --enable-deprecated

And no, I don't care about 0.9.23 with --disable-deprecated, we don't need that in Gentoo, since _systemd users_ will move to 0.99.0
Comment 5 Samuli Suominen 2014-06-02 19:42:18 CEST
# grep define.*ENABLE_DEPRECATED config.log
| #define ENABLE_DEPRECATED 1
| #define ENABLE_DEPRECATED 1
#define ENABLE_DEPRECATED 1
Comment 6 Samuli Suominen 2014-06-02 20:37:15 CEST
I don't get a systray icon either, but the process goes to background:

ssuominen@null ~ $ xfce4-power-manager
ssuominen@null ~ $ pidof xfce4-power-manager
5765
ssuominen@null ~ $ xfce4-power-manager-settings 

(xfce4-power-manager-settings:5774): GLib-GObject-CRITICAL **: g_object_unref: assertion 'G_IS_OBJECT (object)' failed

(xfce4-power-manager-settings:5774): Gtk-CRITICAL **: IA__gtk_widget_hide: assertion 'GTK_IS_WIDGET (widget)' failed

(Looking at systray with no xfpm, yet, it's running.)
Comment 7 Samuli Suominen 2014-06-02 21:28:30 CEST
ftr, git version from 2014-05-27 still gives me an systray icon, but 1.3.0 doesn't, i can try to pinpoint this futher

also, it's not about --enable/--disable-deprecated because, for example:

up_client_get_can_suspend it's complaining about is not behind any ifdef, like not really:

in libupower-glib/up-client.h:

#ifdef UPOWER_ENABLE_DEPRECATED
gboolean         up_client_get_can_suspend              (UpClient               *client);
#endif

in libupower-glib/Makefile.am:
AM_CPPFLAGS = -DUPOWER_ENABLE_DEPRECATED

so -DUPOWER_ENABLE_DEPRECATED is always enabled by the Makefile.am, making the line starting with 'gboolean up_client_get_can_suspend ...' always available

I can fix the implicit declarations by adding this problem by exporting
CPPFLAGS="-DUPOWER_ENABLE_DEPRECATED" before ./configure of xfce4-power-manager

as in, looks like xfce4-power-manager-1.3.0 is using functions from libupower-glib headers that are only exposed when you use that macro
Comment 8 Samuli Suominen 2014-06-02 22:02:50 CEST
`pkg-config --cflags libupower-glib` from upower-0.9.23 with ./configure --enable-deprecated -build doesn't give that -DUPOWER_ENABLE_DEPRECATED either.  should it?

it just seems silly that clients should be exporting (internal?) upower macro if to expose part of the headers.

so either that, or the code is not meant the used like this?
Comment 9 Samuli Suominen 2014-06-02 22:14:24 CEST
I should have investigated better before even opening the bug, and then, avoid all these typing errors.

So this bug is caused by nothing setting -DUPOWER_ENABLE_DEPRECATED, and the question is, should it be upower-glib.pc that returns it with --cflags,
or should it be xfce4-power-manager itself from build system adding it,
or should the code inside those #ifdef's be used outside of UPower itself at all
Comment 10 Samuli Suominen 2014-06-02 23:21:11 CEST
https://bugs.freedesktop.org/show_bug.cgi?id=79565
Comment 11 Samuli Suominen 2014-06-02 23:41:46 CEST
added a workaround like...

sed -i -e 's|Cflags: |&-DUPOWER_ENABLE_DEPRECATED |' upower-glib.pc.in || die

...that runs in upower source tree after ./configure --enable-deprecated

but other distributions will need to fix the same then if this is the way to go :/

before...

suominen@null /tmp/upower-0.9.23 $ pkg-config --cflags upower-glib
-pthread -I/usr/include/libupower-glib -I/usr/include/dbus-1.0 -I/usr/lib64/dbus-1.0/include -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include 

after...

ssuominen@null /tmp/upower-0.9.23 $ pkg-config --cflags upower-glib
-DUPOWER_ENABLE_DEPRECATED -pthread -I/usr/include/libupower-glib -I/usr/include/dbus-1.0 -I/usr/lib64/dbus-1.0/include -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include
Comment 12 Eric Koegel editbugs 2014-06-03 18:56:46 CEST
Thanks for tracking this issue down. For now, I've added -DUPOWER_ENABLE_DEPRECATED to the makefile, which was pushed in http://git.xfce.org/xfce/xfce4-power-manager/commit/?id=c0d9ea83083058379a83fd96d407479247f06d74
Comment 13 Samuli Suominen 2014-06-04 17:09:57 CEST
Based on:

1. https://bugs.freedesktop.org/show_bug.cgi?id=79565#c1
2. http://git.xfce.org/xfce/xfce4-power-manager/commit/?id=c0d9ea83083058379a83fd96d407479247f06d74

I believe this bug can now be closed. The git commit was right, according to UPower upstream.

Bug #10931

Reported by:
Samuli Suominen
Reported on: 2014-06-02
Last modified on: 2014-06-04

People

Assignee:
Ali Abdallah
CC List:
1 user

Version

Version:
Unspecified

Attachments

complete compile log (./configure and make) (114.08 KB, text/plain)
2014-06-02 18:16 CEST , Samuli Suominen
no flags

Additional information