Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] socket.AF_BLUETOOTH in python3 and circular dependencies
@ 2018-08-30 19:21 Grzegorz Blach
  2018-08-31 22:10 ` Thomas Petazzoni
  0 siblings, 1 reply; 3+ messages in thread
From: Grzegorz Blach @ 2018-08-30 19:21 UTC (permalink / raw)
  To: buildroot

Hi,

I need support for socket.AF_BLUETOOTH in python3. Python3 is compiled 
with bluetooth support when bluez5_utils is installed on target, so I 
created a simple patch:

--- a/package/python3/python3.mk
+++ b/package/python3/python3.mk
@@ -256,6 +256,11 @@ endif
  # Provided to other packages
  PYTHON3_PATH = $(TARGET_DIR)/usr/lib/python$(PYTHON3_VERSION_MAJOR)/

+# Support for socket.AF_BLUETOOTH
+ifeq ($(BR2_PACKAGE_BLUEZ5_UTILS),y)
+    PYTHON3_DEPENDENCIES += bluez5_utils
+endif
+

But unfortunately this patch makes a circular dependencies:

$ make python3-graph-depends
Recursion detected for  : bluez5_utils
which is a dependency of: python3
which is a dependency of: util-linux
which is a dependency of: libglib2
which is a dependency of: bluez5_utils

To temporary solve this problem I must python support in util-linux package:

--- a/package/util-linux/util-linux.mk
+++ b/package/util-linux/util-linux.mk
@@ -203,9 +203,9 @@ HOST_UTIL_LINUX_CONF_OPTS += --disable-all-programs
  endif

  # Install libmount Python bindings
-ifeq ($(BR2_PACKAGE_PYTHON)$(BR2_PACKAGE_PYTHON3),y)
+ifeq ($(BR2_PACKAGE_PYTHON),y)
  UTIL_LINUX_CONF_OPTS += --with-python
-UTIL_LINUX_DEPENDENCIES += $(if $(BR2_PACKAGE_PYTHON),python,python3)
+UTIL_LINUX_DEPENDENCIES += python
  ifeq ($(BR2_PACKAGE_UTIL_LINUX_LIBMOUNT),y)
  UTIL_LINUX_CONF_OPTS += --enable-pylibmount
  else


Can someone point me how to fix circular dependencies without disabling 
python support in util-linux?

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [Buildroot] socket.AF_BLUETOOTH in python3 and circular dependencies
  2018-08-30 19:21 [Buildroot] socket.AF_BLUETOOTH in python3 and circular dependencies Grzegorz Blach
@ 2018-08-31 22:10 ` Thomas Petazzoni
  2018-09-01  7:05   ` Yann E. MORIN
  0 siblings, 1 reply; 3+ messages in thread
From: Thomas Petazzoni @ 2018-08-31 22:10 UTC (permalink / raw)
  To: buildroot

Hello,

On Thu, 30 Aug 2018 21:21:23 +0200, Grzegorz Blach wrote:

> But unfortunately this patch makes a circular dependencies:
> 
> $ make python3-graph-depends
> Recursion detected for  : bluez5_utils
> which is a dependency of: python3
> which is a dependency of: util-linux
> which is a dependency of: libglib2
> which is a dependency of: bluez5_utils

[...]

> Can someone point me how to fix circular dependencies without disabling 
> python support in util-linux?

Arghh, this is annoying :-/

I don't see a good solution here. Possible options that I see at this
point:

 (1) Change Python in Modules/socketmodule.c to not require
     bluetooth.h. It doesn't seem to link with any Bluetooth library,
     only to need bluetooth.h, so perhaps just like they do for
     FreeBSD/NetBSD, we could add the necessary definitions directly in
     socketmodule.c to avoid the bluetooth.h dependency ?

 (2) Create a python-util-linux package that would be responsible for
     building the util-linux Python bindings. This would remove Python
     from being a dependency of util-linux, and break the circular
     dependency.

     However, it is not clear that it will be easy to tell
     python-util-linux to *only* build the Python bindings and use the
     existing libraries built by the util-linux package, rather than
     rebuilding them again.

 (3) Add an explicit Config.in option for util-linux Python support,
     and make it conflict with Bluetooth support in Python.

For the record, OpenEmbedded doesn't support Bluetooth in Python socket
module, they pass:

  ac_cv_header_bluetooth_bluetooth_h=no ac_cv_header_bluetooth_h=no

to the Python configure script.

Best regards,

Thomas
-- 
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [Buildroot] socket.AF_BLUETOOTH in python3 and circular dependencies
  2018-08-31 22:10 ` Thomas Petazzoni
@ 2018-09-01  7:05   ` Yann E. MORIN
  0 siblings, 0 replies; 3+ messages in thread
From: Yann E. MORIN @ 2018-09-01  7:05 UTC (permalink / raw)
  To: buildroot

Thomas, Grzegorz, All,

On 2018-09-01 00:10 +0200, Thomas Petazzoni spake thusly:
> On Thu, 30 Aug 2018 21:21:23 +0200, Grzegorz Blach wrote:
> > But unfortunately this patch makes a circular dependencies:
> > $ make python3-graph-depends
> > Recursion detected for  : bluez5_utils
> > which is a dependency of: python3
> > which is a dependency of: util-linux
> > which is a dependency of: libglib2
> > which is a dependency of: bluez5_utils
> Arghh, this is annoying :-/
> I don't see a good solution here. Possible options that I see at this
> point:
> 
>  (1) Change Python in Modules/socketmodule.c to not require
>      bluetooth.h. It doesn't seem to link with any Bluetooth library,
>      only to need bluetooth.h, so perhaps just like they do for
>      FreeBSD/NetBSD, we could add the necessary definitions directly in
>      socketmodule.c to avoid the bluetooth.h dependency ?
> 
>  (2) Create a python-util-linux package that would be responsible for
>      building the util-linux Python bindings. This would remove Python
>      from being a dependency of util-linux, and break the circular
>      dependency.
> 
>      However, it is not clear that it will be easy to tell
>      python-util-linux to *only* build the Python bindings and use the
>      existing libraries built by the util-linux package, rather than
>      rebuilding them again.
> 
>  (3) Add an explicit Config.in option for util-linux Python support,
>      and make it conflict with Bluetooth support in Python.

 (4) Create libutil-linux that just install the required libs, like
     libmount needed by libglib2, thus breaking the loop. I think this
     might be the simplest solution.

 (5) Create libbluez5_utils, which only installs the development files,
     so that python{,3} can depend on it. This would work, only if the
     libbluetooth.so is not itself linked to libglib2 (but only the
     bluetooth utils are). On my Ubuntu 17.10, it is not.

> For the record, OpenEmbedded doesn't support Bluetooth in Python socket
> module, they pass:
>   ac_cv_header_bluetooth_bluetooth_h=no ac_cv_header_bluetooth_h=no
> to the Python configure script.

Maybe we can do better? ;-)

Regards,
Yann E. MORIN.

-- 
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 223 225 172 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2018-09-01  7:05 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-08-30 19:21 [Buildroot] socket.AF_BLUETOOTH in python3 and circular dependencies Grzegorz Blach
2018-08-31 22:10 ` Thomas Petazzoni
2018-09-01  7:05   ` Yann E. MORIN

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox