diff mbox

efl: remove 'upower' ecore module.

Message ID 20161229145650.4013-1-barbieri@profusion.mobi
State Superseded
Headers show

Commit Message

Gustavo Sverzut Barbieri Dec. 29, 2016, 2:56 p.m. UTC
Ecore will reach 'upower' using D-Bus in order to detect if the system
state changes. This is optional, but done by default and if D-Bus
itself fails, then an error message will be presented.

Since we do not ship upower target package, just remove that from
target. Since it's useless for host, remove it as well.

Signed-off-by: Gustavo Sverzut Barbieri <barbieri@profusion.mobi>
---
 package/efl/efl.mk | 10 ++++++++++
 1 file changed, 10 insertions(+)

Comments

Romain Naour Dec. 29, 2016, 4:20 p.m. UTC | #1
Hi Gustavo,

Le 29/12/2016 à 15:56, Gustavo Sverzut Barbieri a écrit :
> Ecore will reach 'upower' using D-Bus in order to detect if the system
> state changes. This is optional, but done by default and if D-Bus
> itself fails, then an error message will be presented.

What's the error message ?
I don't see any dbus message related to upower.

> 
> Since we do not ship upower target package, just remove that from
> target. Since it's useless for host, remove it as well.

The efl upower module is used by the enlightenment battery module.
It's started here but I'm not sure it's really working (100% Battery).

Also, the efl package install several build tools and files on the target.
It would be difficult to update all of these hooks between release.
I recommend to use a post-build script in this case.

I admit, I didn't noticed this module until now :p

Maybe it easier to package upower and add it to efl dependencies ?

Best regards,
Romain

> 
> Signed-off-by: Gustavo Sverzut Barbieri <barbieri@profusion.mobi>
> ---
>  package/efl/efl.mk | 10 ++++++++++
>  1 file changed, 10 insertions(+)
> 
> diff --git a/package/efl/efl.mk b/package/efl/efl.mk
> index 7a8e47f4c..f7c99a965 100644
> --- a/package/efl/efl.mk
> +++ b/package/efl/efl.mk
> @@ -272,6 +272,11 @@ else
>  EFL_CONF_OPTS += --disable-librsvg
>  endif
>  
> +define EFL_HOOK_REMOVE_UPOWER
> +	rm -fr $(TARGET_DIR)/usr/lib/ecore/system/upower
> +endef
> +EFL_POST_INSTALL_TARGET_HOOKS = EFL_HOOK_REMOVE_UPOWER
> +
>  $(eval $(autotools-package))
>  
>  ################################################################################
> @@ -352,4 +357,9 @@ else
>  HOST_EFL_CONF_OPTS += --disable-cxx-bindings
>  endif
>  
> +define HOST_EFL_HOOK_REMOVE_UPOWER
> +	rm -fr $(HOST_DIR)/usr/lib/ecore/system/upower
> +endef
> +HOST_EFL_POST_INSTALL_HOOKS = HOST_EFL_HOOK_REMOVE_UPOWER
> +
>  $(eval $(host-autotools-package))
>
Romain Naour Dec. 29, 2016, 8:37 p.m. UTC | #2
Le 29/12/2016 à 17:20, Romain Naour a écrit :
> Hi Gustavo,
> 
> Le 29/12/2016 à 15:56, Gustavo Sverzut Barbieri a écrit :
>> Ecore will reach 'upower' using D-Bus in order to detect if the system
>> state changes. This is optional, but done by default and if D-Bus
>> itself fails, then an error message will be presented.
> 
> What's the error message ?
> I don't see any dbus message related to upower.

Which efl version did you use ?

Some warning related to upower has been removed in efl 1.18 [1].

[1]
https://git.enlightenment.org/core/efl.git/commit/?id=f54a2eb5703381f9e80604cdca84f91b72ae0090

> 
>>
>> Since we do not ship upower target package, just remove that from
>> target. Since it's useless for host, remove it as well.
> 
> The efl upower module is used by the enlightenment battery module.
> It's started here but I'm not sure it's really working (100% Battery).
> 
> Also, the efl package install several build tools and files on the target.
> It would be difficult to update all of these hooks between release.
> I recommend to use a post-build script in this case.
> 
> I admit, I didn't noticed this module until now :p
> 
> Maybe it easier to package upower and add it to efl dependencies ?

Can you try upower added with this patch ?

http://patchwork.ozlabs.org/patch/709564/

Best regards,
Romain

> 
> Best regards,
> Romain
>
Gustavo Sverzut Barbieri Dec. 30, 2016, 2:57 a.m. UTC | #3
On Thu, Dec 29, 2016 at 2:20 PM, Romain Naour <romain.naour@gmail.com> wrote:
> Hi Gustavo,
>
> Le 29/12/2016 à 15:56, Gustavo Sverzut Barbieri a écrit :
>> Ecore will reach 'upower' using D-Bus in order to detect if the system
>> state changes. This is optional, but done by default and if D-Bus
>> itself fails, then an error message will be presented.
>
> What's the error message ?
> I don't see any dbus message related to upower.

It's something along these lines:

ERR<pid>:eina_safety lib/eldbus/eldbus_core.c:1392
eldbus_name_owner_changed_callback_del() safety check failed: conn  ==
NULL

ERR<pid>:eldbus lib/eldbus/eldbus_core.c:1021 _connection_get() Error
connecting to bus of type 2. error name:
org.freedesktop.DBus.Error.FileNotFound error message: Failed to
connect to socket
/path/to/buildroot/output/host/var/run/dbus/system_bus_socket

that is, some apps will try to use eldbus to reach *host* system DBus,
but it can't as it's trying to reach the socket inside the
/path/to/buildroot/output/host/, not outside.

At first I was thinking this was related to edje_cc and would add
ecore_app_no_system_modules() to it in order to skip such modules as
upower... but it's already there. So maybe it's another binary used
during my build.



>> Since we do not ship upower target package, just remove that from
>> target. Since it's useless for host, remove it as well.
>
> The efl upower module is used by the enlightenment battery module.
> It's started here but I'm not sure it's really working (100% Battery).

well, enlightenment + upower works on my desktop :-)

but E ships with alternative method to check battery if there's no upower.

also, that ecore module is not used by Enlightenment as the WM needs
more information. That ecore module will only emit main loop events
such as "battery low" so apps can save their state and start to save
power (that was my intent when I added it, not sure any app uses that
for real).


> Also, the efl package install several build tools and files on the target.
> It would be difficult to update all of these hooks between release.

But the list of modules is pretty small. Usually they would reflect
--enable-XXX, but since dbus is mandatory we always generate the
upower module.


> I recommend to use a post-build script in this case.

that's what I'm doing atm.


> I admit, I didn't noticed this module until now :p

;-)


> Maybe it easier to package upower and add it to efl dependencies ?

I saw that patch and IMO it's a nice addition. However the error I'm
noticing also happens on my build system as per above log.
Romain Naour Dec. 30, 2016, 12:27 p.m. UTC | #4
Hi Gustavo,

Le 30/12/2016 à 03:57, Gustavo Sverzut Barbieri a écrit :
> On Thu, Dec 29, 2016 at 2:20 PM, Romain Naour <romain.naour@gmail.com> wrote:
>> Hi Gustavo,
>>
>> Le 29/12/2016 à 15:56, Gustavo Sverzut Barbieri a écrit :
>>> Ecore will reach 'upower' using D-Bus in order to detect if the system
>>> state changes. This is optional, but done by default and if D-Bus
>>> itself fails, then an error message will be presented.
>>
>> What's the error message ?
>> I don't see any dbus message related to upower.
> 
> It's something along these lines:
> 
> ERR<pid>:eina_safety lib/eldbus/eldbus_core.c:1392
> eldbus_name_owner_changed_callback_del() safety check failed: conn  ==
> NULL
> 
> ERR<pid>:eldbus lib/eldbus/eldbus_core.c:1021 _connection_get() Error
> connecting to bus of type 2. error name:
> org.freedesktop.DBus.Error.FileNotFound error message: Failed to
> connect to socket
> /path/to/buildroot/output/host/var/run/dbus/system_bus_socket
> 
> that is, some apps will try to use eldbus to reach *host* system DBus,
> but it can't as it's trying to reach the socket inside the
> /path/to/buildroot/output/host/, not outside.
> 
> At first I was thinking this was related to edje_cc and would add
> ecore_app_no_system_modules() to it in order to skip such modules as
> upower... but it's already there. So maybe it's another binary used
> during my build.

Yes, I know these noisy one...

Indeed, there is no error messages after removing
$(HOST_DIR)/usr/lib/ecore/system/upower :)
It would be great to add these explanation in the commit log.

I don't use E on my build machine so no other efl binary can be used.

Tested with efl, terminology and enlightenment package.

> 
>>> Since we do not ship upower target package, just remove that from
>>> target. Since it's useless for host, remove it as well.
>>
>> The efl upower module is used by the enlightenment battery module.
>> It's started here but I'm not sure it's really working (100% Battery).
> 
> well, enlightenment + upower works on my desktop :-)
> 
> but E ships with alternative method to check battery if there's no upower.
> 
> also, that ecore module is not used by Enlightenment as the WM needs
> more information. That ecore module will only emit main loop events
> such as "battery low" so apps can save their state and start to save
> power (that was my intent when I added it, not sure any app uses that
> for real).
> 
> 
>> Also, the efl package install several build tools and files on the target.
>> It would be difficult to update all of these hooks between release.
> 
> But the list of modules is pretty small. Usually they would reflect
> --enable-XXX, but since dbus is mandatory we always generate the
> upower module.
> 
> 
>> I recommend to use a post-build script in this case.
> 
> that's what I'm doing atm.
> 
> 
>> I admit, I didn't noticed this module until now :p
> 
> ;-)
> 
> 
>> Maybe it easier to package upower and add it to efl dependencies ?
> 
> I saw that patch and IMO it's a nice addition. However the error I'm
> noticing also happens on my build system as per above log.
> 

I don't think we want to remove $(TARGET_DIR)/usr/lib/ecore/system/upower if
upower is selected. Maybe add a condition on upower package ?

Best regards,
Romain
Gustavo Sverzut Barbieri Dec. 30, 2016, 2:02 p.m. UTC | #5
On Fri, Dec 30, 2016 at 10:27 AM, Romain Naour <romain.naour@gmail.com> wrote:
> Hi Gustavo,
>
> Le 30/12/2016 à 03:57, Gustavo Sverzut Barbieri a écrit :
>> On Thu, Dec 29, 2016 at 2:20 PM, Romain Naour <romain.naour@gmail.com> wrote:
>>> Hi Gustavo,
>>>
>>> Le 29/12/2016 à 15:56, Gustavo Sverzut Barbieri a écrit :
>>>> Ecore will reach 'upower' using D-Bus in order to detect if the system
>>>> state changes. This is optional, but done by default and if D-Bus
>>>> itself fails, then an error message will be presented.
>>>
>>> What's the error message ?
>>> I don't see any dbus message related to upower.
>>
>> It's something along these lines:
>>
>> ERR<pid>:eina_safety lib/eldbus/eldbus_core.c:1392
>> eldbus_name_owner_changed_callback_del() safety check failed: conn  ==
>> NULL
>>
>> ERR<pid>:eldbus lib/eldbus/eldbus_core.c:1021 _connection_get() Error
>> connecting to bus of type 2. error name:
>> org.freedesktop.DBus.Error.FileNotFound error message: Failed to
>> connect to socket
>> /path/to/buildroot/output/host/var/run/dbus/system_bus_socket
>>
>> that is, some apps will try to use eldbus to reach *host* system DBus,
>> but it can't as it's trying to reach the socket inside the
>> /path/to/buildroot/output/host/, not outside.
>>
>> At first I was thinking this was related to edje_cc and would add
>> ecore_app_no_system_modules() to it in order to skip such modules as
>> upower... but it's already there. So maybe it's another binary used
>> during my build.
>
> Yes, I know these noisy one...
>
> Indeed, there is no error messages after removing
> $(HOST_DIR)/usr/lib/ecore/system/upower :)
> It would be great to add these explanation in the commit log.

ok, will rework the message.


> I don't use E on my build machine so no other efl binary can be used.

what you mean with "no other efl can be used"?  EFL can be used
regardless of the window manager. I suppose you meant "needs to be
used"?



> I don't think we want to remove $(TARGET_DIR)/usr/lib/ecore/system/upower if
> upower is selected. Maybe add a condition on upower package ?

fair enough now that we have the upower package. will add that to the new patch.
Romain Naour Dec. 30, 2016, 2:31 p.m. UTC | #6
Le 30/12/2016 à 15:02, Gustavo Sverzut Barbieri a écrit :
> On Fri, Dec 30, 2016 at 10:27 AM, Romain Naour <romain.naour@gmail.com> wrote:
>> Hi Gustavo,
>>
>> Le 30/12/2016 à 03:57, Gustavo Sverzut Barbieri a écrit :
>>> On Thu, Dec 29, 2016 at 2:20 PM, Romain Naour <romain.naour@gmail.com> wrote:
>>>> Hi Gustavo,
>>>>
>>>> Le 29/12/2016 à 15:56, Gustavo Sverzut Barbieri a écrit :
>>>>> Ecore will reach 'upower' using D-Bus in order to detect if the system
>>>>> state changes. This is optional, but done by default and if D-Bus
>>>>> itself fails, then an error message will be presented.
>>>>
>>>> What's the error message ?
>>>> I don't see any dbus message related to upower.
>>>
>>> It's something along these lines:
>>>
>>> ERR<pid>:eina_safety lib/eldbus/eldbus_core.c:1392
>>> eldbus_name_owner_changed_callback_del() safety check failed: conn  ==
>>> NULL
>>>
>>> ERR<pid>:eldbus lib/eldbus/eldbus_core.c:1021 _connection_get() Error
>>> connecting to bus of type 2. error name:
>>> org.freedesktop.DBus.Error.FileNotFound error message: Failed to
>>> connect to socket
>>> /path/to/buildroot/output/host/var/run/dbus/system_bus_socket
>>>
>>> that is, some apps will try to use eldbus to reach *host* system DBus,
>>> but it can't as it's trying to reach the socket inside the
>>> /path/to/buildroot/output/host/, not outside.
>>>
>>> At first I was thinking this was related to edje_cc and would add
>>> ecore_app_no_system_modules() to it in order to skip such modules as
>>> upower... but it's already there. So maybe it's another binary used
>>> during my build.
>>
>> Yes, I know these noisy one...
>>
>> Indeed, there is no error messages after removing
>> $(HOST_DIR)/usr/lib/ecore/system/upower :)
>> It would be great to add these explanation in the commit log.
> 
> ok, will rework the message.
> 
> 
>> I don't use E on my build machine so no other efl binary can be used.
> 
> what you mean with "no other efl can be used"?  EFL can be used
> regardless of the window manager. I suppose you meant "needs to be
> used"?

I mean, no efl binary installed on the build machine can "leak" (be used) during
the build.
But it shouldn't happen since we use these options in EFL_CONF_OPTS:
	--with-edje-cc=$(HOST_DIR)/usr/bin/edje_cc \
	--with-eet-eet=$(HOST_DIR)/usr/bin/eet \
	--with-eldbus_codegen=$(HOST_DIR)/usr/bin/eldbus-codegen \
	--with-elementary-codegen=$(HOST_DIR)/usr/bin/elementary_codegen \
	--with-elm-prefs-cc=$(HOST_DIR)/usr/bin/elm_prefs_cc \
	--with-elua=$(HOST_DIR)/usr/bin/elua \
	--with-eolian-gen=$(HOST_DIR)/usr/bin/eolian_gen \

> 
> 
>> I don't think we want to remove $(TARGET_DIR)/usr/lib/ecore/system/upower if
>> upower is selected. Maybe add a condition on upower package ?
> 
> fair enough now that we have the upower package. will add that to the new patch.
> 

Ok thanks.

Best regards,
Romain
diff mbox

Patch

diff --git a/package/efl/efl.mk b/package/efl/efl.mk
index 7a8e47f4c..f7c99a965 100644
--- a/package/efl/efl.mk
+++ b/package/efl/efl.mk
@@ -272,6 +272,11 @@  else
 EFL_CONF_OPTS += --disable-librsvg
 endif
 
+define EFL_HOOK_REMOVE_UPOWER
+	rm -fr $(TARGET_DIR)/usr/lib/ecore/system/upower
+endef
+EFL_POST_INSTALL_TARGET_HOOKS = EFL_HOOK_REMOVE_UPOWER
+
 $(eval $(autotools-package))
 
 ################################################################################
@@ -352,4 +357,9 @@  else
 HOST_EFL_CONF_OPTS += --disable-cxx-bindings
 endif
 
+define HOST_EFL_HOOK_REMOVE_UPOWER
+	rm -fr $(HOST_DIR)/usr/lib/ecore/system/upower
+endef
+HOST_EFL_POST_INSTALL_HOOKS = HOST_EFL_HOOK_REMOVE_UPOWER
+
 $(eval $(host-autotools-package))