Bug 70458

Summary: connectivity monitor depends on now-removed upower API
Product: Telepathy Reporter: Colin Walters <walters>
Component: mission-controlAssignee: Telepathy bugs list <telepathy-bugs>
Status: RESOLVED FIXED QA Contact: Telepathy bugs list <telepathy-bugs>
Severity: normal    
Priority: medium CC: bugzilla, gkiagia, walters
Version: unspecifiedKeywords: patch
Hardware: Other   
OS: All   
Whiteboard:
i915 platform: i915 features:
Attachments: Remove support for UPower

Comment 1 Simon McVittie 2013-10-14 17:13:51 UTC
Am I right in thinking that taking the --disable-upower code path "does the right thing", because we already listen for login1's PrepareForSleep signal? If so, we could just delete that code (and you could --disable-upower on autobuilders in the meantime).
Comment 3 Simon McVittie 2013-10-15 10:38:24 UTC
Created attachment 87662 [details] [review]
Remove support for UPower

As of git master, it no longer has the API we use. On Linux, the
recommended way to be notified about suspend this week appears to
be logind, for which support was added in 5.15.1. Elsewhere, this
is a regression, but if UPower is deleting this functionality
we don't have much choice.
Comment 4 Bastien Nocera 2013-10-15 10:40:31 UTC
fwiw, UPower master isn't targetted for GNOME 3.10, but for GNOME 3.12.
Comment 5 Simon McVittie 2013-10-15 11:05:31 UTC
(In reply to comment #4)
> fwiw, UPower master isn't targetted for GNOME 3.10, but for GNOME 3.12.

Mission Control 5.16.x has both UPower and logind suspend-detection, and is recommended for use with GNOME 3.10. 5.17.x (where I suggest this change) targets GNOME 3.12.

However, we do try to avoid being tied to particular GNOME releases: Telepathy is a cross-desktop project (also used in KDE, for a start), and we aim for it to be safe for distros to upgrade Telepathy while using the previous GNOME release.

If the UPower release that deletes this API will have a known version number, we could change the pkg-config check from [upower-glib] to [upower-glib < 0.10] or [upower-glib < 0.9.23] or something, resulting in our UPower support being disabled for newer upower-glib?

(That would be better for the 5.16.x branch, anyway - I'm not going to remove features from a stable-branch, but I wouldn't mind tightening the condition under which that feature is available.)

I'd rather not get into AC_CHECK_FUNC([up_client_suspend_sync]) or similar, since it doesn't combine well with pkg-config.
Comment 6 Colin Walters 2013-10-15 11:06:02 UTC
Comment on attachment 87662 [details] [review]
Remove support for UPower

Review of attachment 87662 [details] [review]:
-----------------------------------------------------------------

Not a tp-mission-control reviewer, but it does look to me like you've correctly deleted the code.

For what it's worth regarding non-systemd platforms, I think several projects like Upstart and OpenRC are looking at reimplementing the logind API.
Comment 7 Guillaume Desmottes 2013-10-15 14:12:59 UTC
Comment on attachment 87662 [details] [review]
Remove support for UPower

Review of attachment 87662 [details] [review]:
-----------------------------------------------------------------

Yep, looks good.
Comment 8 Simon McVittie 2013-10-29 16:18:56 UTC
Fixed in git for 5.17.0.

I'm not going to remove this feature from 5.16.0. Please compile with --disable-upower to avoid the deprecated UPower functions.

If someone tells me the right "threshold" UPower version number for the branch that deleted these functions, I'd be OK with changing the PKG_CHECK_MODULES from

    PKG_CHECK_MODULES([UPOWER_GLIB], [upower-glib],

to something like

    PKG_CHECK_MODULES([UPOWER_GLIB], [upower-glib < 0.99],

for the 5.16 branch.
Comment 9 Bastien Nocera 2013-10-29 16:34:46 UTC
(In reply to comment #8)
> Fixed in git for 5.17.0.
> 
> I'm not going to remove this feature from 5.16.0. Please compile with
> --disable-upower to avoid the deprecated UPower functions.
> 
> If someone tells me the right "threshold" UPower version number for the
> branch that deleted these functions, I'd be OK with changing the
> PKG_CHECK_MODULES from
> 
>     PKG_CHECK_MODULES([UPOWER_GLIB], [upower-glib],
> 
> to something like
> 
>     PKG_CHECK_MODULES([UPOWER_GLIB], [upower-glib < 0.99],
> 
> for the 5.16 branch.

0.99.0 is the first release with the new API, so that should work.
Comment 10 George Kiagiadakis 2016-07-13 14:37:05 UTC
*** Bug 96779 has been marked as a duplicate of this bug. ***
Comment 11 George Kiagiadakis 2016-07-13 14:37:49 UTC
commit cbe4ec1a4e1167ce8231849bcbbdec44d48422f2
Author: George Kiagiadakis <gkiagia@tolabaki.gr>
Date:   Wed Jul 13 17:34:39 2016 +0300

    configure: do not enable upower support if upower is >=0.99
    
    The code doesn't compile anymore, the features used have been removed.
    The replacement is logind, for which support exists in MC since 5.15.1.
    
    https://bugs.freedesktop.org/show_bug.cgi?id=70458

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.