Skip to contentSkip to conversation

About python2 and python3

Buildroot Marco Trapanese 2 participants 4 messages May 9, 2016

lore
Share & tools
lore
#0 lore raw

Hi,
if python2 is selected is not possible to add python3.
But python2 and python3 are quite different and sometimes is useful to have both. i cannot deselect python2 because is selected by another package.

I tried to force the compilation of python3 (removing the dependency from python2) but the dbus module is not found.
Instead python2 finds the dbus module, but complains about the missing of xml.parsers.expat module.

I checked and BR2_PACKAGE_PYTHON*_PYEXPAT are selected.

Just for info I need this to run the ofono tests.

#1 lore raw

Hello,

Quoted 3 lines · Marco Trapanese

if python2 is selected is not possible to add python3.
But python2 and python3 are quite different and sometimes is useful to have both. i cannot deselect python2 because is selected by another package.

We currently do not support building both Python 2 and Python 3.

The main reason is that we allow building external Python modules, and it would be very annoying with Kconfig to allow the user to tell which modules should be built/installed for Python 2, which modules should be built/installed for Python 3, and which modules should be built/installed for both.

One possibility would be to install all of them for both Python 2 and Python 3, but that's very inefficient.

So, I think we'll stick with just supporting the installation of either Python 2 or Python 3. I'd rather recommend you to see why you need Python 2 at all, and try to see if you can make that part work with Python 3.

Best regards,

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
#2 lore raw

Il 09/05/2016 22:26, Thomas Petazzoni ha scritto:

Quoted 4 lines

So, I think we'll stick with just supporting the installation of either Python 2 or Python 3. I'd rather recommend you to see why you need Python 2 at all, and try to see if you can make that part work with Python 3.

Ok, it's reasonable.
Is there an easy way to find out which package(s) is selecting another? I had to copy & paste several times the loooong "selected by" line:

Quoted 19 lines

Selected by:

BR2_PACKAGE_KODI [=n] &&
BR2_INSTALL_LIBSTDCPP [=y] &&
BR2_HOST_GCC_AT_LEAST_4_6 [=y] &&
BR2_TOOLCHAIN_GCC_AT_LEAST_4_7 [=y] &&
BR2_TOOLCHAIN_HAS_THREADS [=y] &&
!BR2_TOOLCHAIN_USES_MUSL [=n] &&
(BR2_PACKAGE_KODI_EGL_GLES [=y] ||
BR2_PACKAGE_KODI_GL [=n]) &&
BR2_USE_MMU [=y] &&
BR2_USE_WCHAR [=y] &&
!BR2_STATIC_LIBS [=n] &&
BR2_PACKAGE_KODI_ARCH_SUPPORTS [=y] ||
BR2_PACKAGE_DSTAT [=n] &&
BR2_USE_WCHAR [=y] &&
BR2_USE_MMU [=y] &&
BR2_TOOLCHAIN_HAS_THREADS [=y] &&
!BR2_STATIC_LIBS [=n] ||

Quoted 8 lines

BR2_PACKAGE_SAMBA4 [=y] &&
BR2_USE_MMU [=y] &&
BR2_USE_WCHAR [=y] &&
BR2_TOOLCHAIN_HAS_NATIVE_RPC [=y] &&
BR2_TOOLCHAIN_HAS_THREADS [=y] &&
!BR2_STATIC_LIBS [=n] &&
!BR2_nios2 [=n] &&
BR2_TOOLCHAIN_HAS_SYNC_4 [=y]

I guess the && operator has the precedence. So this should be read like:

(BR2_PACKAGE_KODI [=n] && BR2_INSTALL_LIBSTDCPP [=y] && BR2_HOST_GCC_AT_LEAST_4_6 [=y] && BR2_TOOLCHAIN_GCC_AT_LEAST_4_7 [=y] && BR2_TOOLCHAIN_HAS_THREADS [=y] && !BR2_TOOLCHAIN_USES_MUSL [=n] && (BR2_PACKAGE_KODI_EGL_GLES [=y])

||

(BR2_PACKAGE_KODI_GL [=n]) && BR2_USE_MMU [=y] && BR2_USE_WCHAR [=y] && !BR2_STATIC_LIBS [=n] && BR2_PACKAGE_KODI_ARCH_SUPPORTS [=y])

||

(BR2_PACKAGE_DSTAT [=n] && BR2_USE_WCHAR [=y] && BR2_USE_MMU [=y] && BR2_TOOLCHAIN_HAS_THREADS [=y] && !BR2_STATIC_LIBS [=n])

||

(BR2_PACKAGE_SAMBA4 [=y] && BR2_USE_MMU [=y] && BR2_USE_WCHAR [=y] && BR2_TOOLCHAIN_HAS_NATIVE_RPC [=y] && BR2_TOOLCHAIN_HAS_THREADS [=y] && !BR2_STATIC_LIBS [=n] && !BR2_nios2 [=n] && BR2_TOOLCHAIN_HAS_SYNC_4[=y])

so it's the last group which selects python2: samba4. Right now I've deselected it. Then I will try to understand if it can live with python3.

Best regards
Marco

#3 lore raw

Hello,

Quoted 3 lines · Marco Trapanese

Ok, it's reasonable.
Is there an easy way to find out which package(s) is selecting another? I had to copy & paste several times the loooong "selected by" line:

Run "make graph-depends" and look into output/graphs/.

Quoted 3 lines

so it's the last group which selects python2: samba4. Right now I've deselected it. Then I will try to understand if it can live with python3.

Most likely not. Samba is a big thing, and making it work with Python 3 is going to be a huge amount of work if it's not done by upstream.

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com