All of lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH v2 1/1] qemu: add support for python3
@ 2018-09-04 18:39 Adam Duskett
  2018-09-04 18:47 ` Baruch Siach
                   ` (2 more replies)
  0 siblings, 3 replies; 10+ messages in thread
From: Adam Duskett @ 2018-09-04 18:39 UTC (permalink / raw)
  To: buildroot

qemu 2.12.0 now supports building against python3.
see: https://wiki.qemu.org/ChangeLog/2.12#Build_Dependencies

Signed-off-by: Adam Duskett <aduskett@gmail.com>
---
Changes v1 -> v2:
  - Split the python version check into two seperate checks for
    readability, one for the target, one for the host.
  - Fix location of the python version check for target and host.

 package/qemu/qemu.mk | 27 ++++++++++++++++++++++-----
 1 file changed, 22 insertions(+), 5 deletions(-)

diff --git a/package/qemu/qemu.mk b/package/qemu/qemu.mk
index afb2aa92f6..6dd9ce4a62 100644
--- a/package/qemu/qemu.mk
+++ b/package/qemu/qemu.mk
@@ -16,7 +16,7 @@ QEMU_LICENSE_FILES = COPYING COPYING.LIB
 #-------------------------------------------------------------
 # Target-qemu
 
-QEMU_DEPENDENCIES = host-pkgconf host-python libglib2 zlib pixman
+QEMU_DEPENDENCIES = host-pkgconf libglib2 zlib pixman
 
 # Need the LIBS variable because librt and libm are
 # not automatically pulled. :-(
@@ -25,9 +25,19 @@ QEMU_LIBS = -lrt -lm
 QEMU_OPTS =
 
 QEMU_VARS = \
-	LIBTOOL=$(HOST_DIR)/bin/libtool \
-	PYTHON=$(HOST_DIR)/bin/python2 \
+	LIBTOOL=$(HOST_DIR)/bin/libtool
+
+ifeq ($(BR2_PACKAGE_PYTHON3),y)
+QEMU_DEPENDENCIES += host-python3
+QEMU_VARS += \
+	PYTHON=$(HOST_DIR)/bin/python3 \
+	PYTHONPATH=$(TARGET_DIR)/usr/lib/python$(PYTHON3_VERSION_MAJOR)/site-packages
+else
+QEMU_DEPENDENCIES += host-python
+QEMU_VARS += \
+	PYTHON=$(HOST_DIR)/bin/python \
 	PYTHONPATH=$(TARGET_DIR)/usr/lib/python$(PYTHON_VERSION_MAJOR)/site-packages
+endif
 
 # If we want to specify only a subset of targets, we must still enable all
 # of them, so that QEMU properly builds its list of default targets, from
@@ -150,7 +160,7 @@ $(eval $(generic-package))
 #-------------------------------------------------------------
 # Host-qemu
 
-HOST_QEMU_DEPENDENCIES = host-pkgconf host-python host-zlib host-libglib2 host-pixman
+HOST_QEMU_DEPENDENCIES = host-pkgconf host-zlib host-libglib2 host-pixman
 
 #       BR ARCH         qemu
 #       -------         ----
@@ -263,12 +273,19 @@ define HOST_QEMU_CONFIGURE_CMDS
 		--interp-prefix=$(STAGING_DIR) \
 		--cc="$(HOSTCC)" \
 		--host-cc="$(HOSTCC)" \
-		--python=$(HOST_DIR)/bin/python2 \
 		--extra-cflags="$(HOST_CFLAGS)" \
 		--extra-ldflags="$(HOST_LDFLAGS)" \
 		$(HOST_QEMU_OPTS)
 endef
 
+ifeq ($(BR2_PACKAGE_PYTHON3),y)
+HOST_QEMU_DEPENDENCIES += host-python3
+HOST_QEMU_CONFIGURE_CMDS += --python=$(HOST_DIR)/bin/python3
+else
+HOST_QEMU_DEPENDENCIES += host-python
+HOST_QEMU_CONFIGURE_CMDS += --python=$(HOST_DIR)/bin/python2
+endif
+
 define HOST_QEMU_BUILD_CMDS
 	$(HOST_MAKE_ENV) $(MAKE) -C $(@D)
 endef
-- 
2.17.1

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

* [Buildroot] [PATCH v2 1/1] qemu: add support for python3
  2018-09-04 18:39 [Buildroot] [PATCH v2 1/1] qemu: add support for python3 Adam Duskett
@ 2018-09-04 18:47 ` Baruch Siach
  2018-09-04 19:09   ` Adam Duskett
  2018-09-06 19:32 ` Thomas Petazzoni
  2018-09-10 18:35 ` Trent Piepho
  2 siblings, 1 reply; 10+ messages in thread
From: Baruch Siach @ 2018-09-04 18:47 UTC (permalink / raw)
  To: buildroot

Hi Adam,

Adam Duskett writes:
> qemu 2.12.0 now supports building against python3.
> see: https://wiki.qemu.org/ChangeLog/2.12#Build_Dependencies
>
> Signed-off-by: Adam Duskett <aduskett@gmail.com>
> ---
> Changes v1 -> v2:
>   - Split the python version check into two seperate checks for
>     readability, one for the target, one for the host.
>   - Fix location of the python version check for target and host.
>
>  package/qemu/qemu.mk | 27 ++++++++++++++++++++++-----
>  1 file changed, 22 insertions(+), 5 deletions(-)
>
> diff --git a/package/qemu/qemu.mk b/package/qemu/qemu.mk
> index afb2aa92f6..6dd9ce4a62 100644
> --- a/package/qemu/qemu.mk
> +++ b/package/qemu/qemu.mk
> @@ -16,7 +16,7 @@ QEMU_LICENSE_FILES = COPYING COPYING.LIB
>  #-------------------------------------------------------------
>  # Target-qemu
>  
> -QEMU_DEPENDENCIES = host-pkgconf host-python libglib2 zlib pixman
> +QEMU_DEPENDENCIES = host-pkgconf libglib2 zlib pixman
>  
>  # Need the LIBS variable because librt and libm are
>  # not automatically pulled. :-(
> @@ -25,9 +25,19 @@ QEMU_LIBS = -lrt -lm
>  QEMU_OPTS =
>  
>  QEMU_VARS = \
> -	LIBTOOL=$(HOST_DIR)/bin/libtool \
> -	PYTHON=$(HOST_DIR)/bin/python2 \
> +	LIBTOOL=$(HOST_DIR)/bin/libtool
> +
> +ifeq ($(BR2_PACKAGE_PYTHON3),y)
> +QEMU_DEPENDENCIES += host-python3
> +QEMU_VARS += \
> +	PYTHON=$(HOST_DIR)/bin/python3 \
> +	PYTHONPATH=$(TARGET_DIR)/usr/lib/python$(PYTHON3_VERSION_MAJOR)/site-packages
> +else
> +QEMU_DEPENDENCIES += host-python
> +QEMU_VARS += \
> +	PYTHON=$(HOST_DIR)/bin/python \
>  	PYTHONPATH=$(TARGET_DIR)/usr/lib/python$(PYTHON_VERSION_MAJOR)/site-packages
> +endif

Can't we use the host installed python? Python is already a dependency
of Buildroot.

baruch

>  # If we want to specify only a subset of targets, we must still enable all
>  # of them, so that QEMU properly builds its list of default targets, from
> @@ -150,7 +160,7 @@ $(eval $(generic-package))
>  #-------------------------------------------------------------
>  # Host-qemu
>  
> -HOST_QEMU_DEPENDENCIES = host-pkgconf host-python host-zlib host-libglib2 host-pixman
> +HOST_QEMU_DEPENDENCIES = host-pkgconf host-zlib host-libglib2 host-pixman
>  
>  #       BR ARCH         qemu
>  #       -------         ----
> @@ -263,12 +273,19 @@ define HOST_QEMU_CONFIGURE_CMDS
>  		--interp-prefix=$(STAGING_DIR) \
>  		--cc="$(HOSTCC)" \
>  		--host-cc="$(HOSTCC)" \
> -		--python=$(HOST_DIR)/bin/python2 \
>  		--extra-cflags="$(HOST_CFLAGS)" \
>  		--extra-ldflags="$(HOST_LDFLAGS)" \
>  		$(HOST_QEMU_OPTS)
>  endef
>  
> +ifeq ($(BR2_PACKAGE_PYTHON3),y)
> +HOST_QEMU_DEPENDENCIES += host-python3
> +HOST_QEMU_CONFIGURE_CMDS += --python=$(HOST_DIR)/bin/python3
> +else
> +HOST_QEMU_DEPENDENCIES += host-python
> +HOST_QEMU_CONFIGURE_CMDS += --python=$(HOST_DIR)/bin/python2
> +endif
> +
>  define HOST_QEMU_BUILD_CMDS
>  	$(HOST_MAKE_ENV) $(MAKE) -C $(@D)
>  endef

-- 
     http://baruch.siach.name/blog/                  ~. .~   Tk Open Systems
=}------------------------------------------------ooO--U--Ooo------------{=
   - baruch at tkos.co.il - tel: +972.52.368.4656, http://www.tkos.co.il -

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

* [Buildroot] [PATCH v2 1/1] qemu: add support for python3
  2018-09-04 18:47 ` Baruch Siach
@ 2018-09-04 19:09   ` Adam Duskett
  2018-09-05  3:59     ` Baruch Siach
  0 siblings, 1 reply; 10+ messages in thread
From: Adam Duskett @ 2018-09-04 19:09 UTC (permalink / raw)
  To: buildroot

I'm not sure;

We support Distributions as old as CentOS6, which have very very old
versions of Python...
On Tue, Sep 4, 2018 at 2:47 PM Baruch Siach <baruch@tkos.co.il> wrote:
>
> Hi Adam,
>
> Adam Duskett writes:
> > qemu 2.12.0 now supports building against python3.
> > see: https://wiki.qemu.org/ChangeLog/2.12#Build_Dependencies
> >
> > Signed-off-by: Adam Duskett <aduskett@gmail.com>
> > ---
> > Changes v1 -> v2:
> >   - Split the python version check into two seperate checks for
> >     readability, one for the target, one for the host.
> >   - Fix location of the python version check for target and host.
> >
> >  package/qemu/qemu.mk | 27 ++++++++++++++++++++++-----
> >  1 file changed, 22 insertions(+), 5 deletions(-)
> >
> > diff --git a/package/qemu/qemu.mk b/package/qemu/qemu.mk
> > index afb2aa92f6..6dd9ce4a62 100644
> > --- a/package/qemu/qemu.mk
> > +++ b/package/qemu/qemu.mk
> > @@ -16,7 +16,7 @@ QEMU_LICENSE_FILES = COPYING COPYING.LIB
> >  #-------------------------------------------------------------
> >  # Target-qemu
> >
> > -QEMU_DEPENDENCIES = host-pkgconf host-python libglib2 zlib pixman
> > +QEMU_DEPENDENCIES = host-pkgconf libglib2 zlib pixman
> >
> >  # Need the LIBS variable because librt and libm are
> >  # not automatically pulled. :-(
> > @@ -25,9 +25,19 @@ QEMU_LIBS = -lrt -lm
> >  QEMU_OPTS =
> >
> >  QEMU_VARS = \
> > -     LIBTOOL=$(HOST_DIR)/bin/libtool \
> > -     PYTHON=$(HOST_DIR)/bin/python2 \
> > +     LIBTOOL=$(HOST_DIR)/bin/libtool
> > +
> > +ifeq ($(BR2_PACKAGE_PYTHON3),y)
> > +QEMU_DEPENDENCIES += host-python3
> > +QEMU_VARS += \
> > +     PYTHON=$(HOST_DIR)/bin/python3 \
> > +     PYTHONPATH=$(TARGET_DIR)/usr/lib/python$(PYTHON3_VERSION_MAJOR)/site-packages
> > +else
> > +QEMU_DEPENDENCIES += host-python
> > +QEMU_VARS += \
> > +     PYTHON=$(HOST_DIR)/bin/python \
> >       PYTHONPATH=$(TARGET_DIR)/usr/lib/python$(PYTHON_VERSION_MAJOR)/site-packages
> > +endif
>
> Can't we use the host installed python? Python is already a dependency
> of Buildroot.
>
> baruch
>
> >  # If we want to specify only a subset of targets, we must still enable all
> >  # of them, so that QEMU properly builds its list of default targets, from
> > @@ -150,7 +160,7 @@ $(eval $(generic-package))
> >  #-------------------------------------------------------------
> >  # Host-qemu
> >
> > -HOST_QEMU_DEPENDENCIES = host-pkgconf host-python host-zlib host-libglib2 host-pixman
> > +HOST_QEMU_DEPENDENCIES = host-pkgconf host-zlib host-libglib2 host-pixman
> >
> >  #       BR ARCH         qemu
> >  #       -------         ----
> > @@ -263,12 +273,19 @@ define HOST_QEMU_CONFIGURE_CMDS
> >               --interp-prefix=$(STAGING_DIR) \
> >               --cc="$(HOSTCC)" \
> >               --host-cc="$(HOSTCC)" \
> > -             --python=$(HOST_DIR)/bin/python2 \
> >               --extra-cflags="$(HOST_CFLAGS)" \
> >               --extra-ldflags="$(HOST_LDFLAGS)" \
> >               $(HOST_QEMU_OPTS)
> >  endef
> >
> > +ifeq ($(BR2_PACKAGE_PYTHON3),y)
> > +HOST_QEMU_DEPENDENCIES += host-python3
> > +HOST_QEMU_CONFIGURE_CMDS += --python=$(HOST_DIR)/bin/python3
> > +else
> > +HOST_QEMU_DEPENDENCIES += host-python
> > +HOST_QEMU_CONFIGURE_CMDS += --python=$(HOST_DIR)/bin/python2
> > +endif
> > +
> >  define HOST_QEMU_BUILD_CMDS
> >       $(HOST_MAKE_ENV) $(MAKE) -C $(@D)
> >  endef
>
> --
>      http://baruch.siach.name/blog/                  ~. .~   Tk Open Systems
> =}------------------------------------------------ooO--U--Ooo------------{=
>    - baruch at tkos.co.il - tel: +972.52.368.4656, http://www.tkos.co.il -

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

* [Buildroot] [PATCH v2 1/1] qemu: add support for python3
  2018-09-04 19:09   ` Adam Duskett
@ 2018-09-05  3:59     ` Baruch Siach
  2018-09-05 16:43       ` Adam Duskett
  0 siblings, 1 reply; 10+ messages in thread
From: Baruch Siach @ 2018-09-05  3:59 UTC (permalink / raw)
  To: buildroot

Hi Adam,

On Tue, Sep 04, 2018 at 03:09:26PM -0400, Adam Duskett wrote:
> I'm not sure;
> 
> We support Distributions as old as CentOS6, which have very very old
> versions of Python...

Buildroot requires Python version 2.6 or newer:

  https://buildroot.org/downloads/manual/manual.html#requirement-mandatory

Can Python 2.6 build qemu?

baruch

> On Tue, Sep 4, 2018 at 2:47 PM Baruch Siach <baruch@tkos.co.il> wrote:
> > Adam Duskett writes:
> > > qemu 2.12.0 now supports building against python3.
> > > see: https://wiki.qemu.org/ChangeLog/2.12#Build_Dependencies
> > >
> > > Signed-off-by: Adam Duskett <aduskett@gmail.com>
> > > ---
> > > Changes v1 -> v2:
> > >   - Split the python version check into two seperate checks for
> > >     readability, one for the target, one for the host.
> > >   - Fix location of the python version check for target and host.
> > >
> > >  package/qemu/qemu.mk | 27 ++++++++++++++++++++++-----
> > >  1 file changed, 22 insertions(+), 5 deletions(-)
> > >
> > > diff --git a/package/qemu/qemu.mk b/package/qemu/qemu.mk
> > > index afb2aa92f6..6dd9ce4a62 100644
> > > --- a/package/qemu/qemu.mk
> > > +++ b/package/qemu/qemu.mk
> > > @@ -16,7 +16,7 @@ QEMU_LICENSE_FILES = COPYING COPYING.LIB
> > >  #-------------------------------------------------------------
> > >  # Target-qemu
> > >
> > > -QEMU_DEPENDENCIES = host-pkgconf host-python libglib2 zlib pixman
> > > +QEMU_DEPENDENCIES = host-pkgconf libglib2 zlib pixman
> > >
> > >  # Need the LIBS variable because librt and libm are
> > >  # not automatically pulled. :-(
> > > @@ -25,9 +25,19 @@ QEMU_LIBS = -lrt -lm
> > >  QEMU_OPTS =
> > >
> > >  QEMU_VARS = \
> > > -     LIBTOOL=$(HOST_DIR)/bin/libtool \
> > > -     PYTHON=$(HOST_DIR)/bin/python2 \
> > > +     LIBTOOL=$(HOST_DIR)/bin/libtool
> > > +
> > > +ifeq ($(BR2_PACKAGE_PYTHON3),y)
> > > +QEMU_DEPENDENCIES += host-python3
> > > +QEMU_VARS += \
> > > +     PYTHON=$(HOST_DIR)/bin/python3 \
> > > +     PYTHONPATH=$(TARGET_DIR)/usr/lib/python$(PYTHON3_VERSION_MAJOR)/site-packages
> > > +else
> > > +QEMU_DEPENDENCIES += host-python
> > > +QEMU_VARS += \
> > > +     PYTHON=$(HOST_DIR)/bin/python \
> > >       PYTHONPATH=$(TARGET_DIR)/usr/lib/python$(PYTHON_VERSION_MAJOR)/site-packages
> > > +endif
> >
> > Can't we use the host installed python? Python is already a dependency
> > of Buildroot.
> >
> > baruch
> >
> > >  # If we want to specify only a subset of targets, we must still enable all
> > >  # of them, so that QEMU properly builds its list of default targets, from
> > > @@ -150,7 +160,7 @@ $(eval $(generic-package))
> > >  #-------------------------------------------------------------
> > >  # Host-qemu
> > >
> > > -HOST_QEMU_DEPENDENCIES = host-pkgconf host-python host-zlib host-libglib2 host-pixman
> > > +HOST_QEMU_DEPENDENCIES = host-pkgconf host-zlib host-libglib2 host-pixman
> > >
> > >  #       BR ARCH         qemu
> > >  #       -------         ----
> > > @@ -263,12 +273,19 @@ define HOST_QEMU_CONFIGURE_CMDS
> > >               --interp-prefix=$(STAGING_DIR) \
> > >               --cc="$(HOSTCC)" \
> > >               --host-cc="$(HOSTCC)" \
> > > -             --python=$(HOST_DIR)/bin/python2 \
> > >               --extra-cflags="$(HOST_CFLAGS)" \
> > >               --extra-ldflags="$(HOST_LDFLAGS)" \
> > >               $(HOST_QEMU_OPTS)
> > >  endef
> > >
> > > +ifeq ($(BR2_PACKAGE_PYTHON3),y)
> > > +HOST_QEMU_DEPENDENCIES += host-python3
> > > +HOST_QEMU_CONFIGURE_CMDS += --python=$(HOST_DIR)/bin/python3
> > > +else
> > > +HOST_QEMU_DEPENDENCIES += host-python
> > > +HOST_QEMU_CONFIGURE_CMDS += --python=$(HOST_DIR)/bin/python2
> > > +endif
> > > +
> > >  define HOST_QEMU_BUILD_CMDS
> > >       $(HOST_MAKE_ENV) $(MAKE) -C $(@D)
> > >  endef

-- 
     http://baruch.siach.name/blog/                  ~. .~   Tk Open Systems
=}------------------------------------------------ooO--U--Ooo------------{=
   - baruch at tkos.co.il - tel: +972.2.679.5364, http://www.tkos.co.il -

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

* [Buildroot] [PATCH v2 1/1] qemu: add support for python3
  2018-09-05  3:59     ` Baruch Siach
@ 2018-09-05 16:43       ` Adam Duskett
  2018-09-05 17:47         ` Baruch Siach
  0 siblings, 1 reply; 10+ messages in thread
From: Adam Duskett @ 2018-09-05 16:43 UTC (permalink / raw)
  To: buildroot

Hey Baruch;

How would I test this? I am used to having BuildRoot handle the paths
for such dependencies.

On Tue, Sep 4, 2018 at 11:59 PM Baruch Siach <baruch@tkos.co.il> wrote:
>
> Hi Adam,
>
> On Tue, Sep 04, 2018 at 03:09:26PM -0400, Adam Duskett wrote:
> > I'm not sure;
> >
> > We support Distributions as old as CentOS6, which have very very old
> > versions of Python...
>
> Buildroot requires Python version 2.6 or newer:
>
>   https://buildroot.org/downloads/manual/manual.html#requirement-mandatory
>
> Can Python 2.6 build qemu?
>
> baruch
>
> > On Tue, Sep 4, 2018 at 2:47 PM Baruch Siach <baruch@tkos.co.il> wrote:
> > > Adam Duskett writes:
> > > > qemu 2.12.0 now supports building against python3.
> > > > see: https://wiki.qemu.org/ChangeLog/2.12#Build_Dependencies
> > > >
> > > > Signed-off-by: Adam Duskett <aduskett@gmail.com>
> > > > ---
> > > > Changes v1 -> v2:
> > > >   - Split the python version check into two seperate checks for
> > > >     readability, one for the target, one for the host.
> > > >   - Fix location of the python version check for target and host.
> > > >
> > > >  package/qemu/qemu.mk | 27 ++++++++++++++++++++++-----
> > > >  1 file changed, 22 insertions(+), 5 deletions(-)
> > > >
> > > > diff --git a/package/qemu/qemu.mk b/package/qemu/qemu.mk
> > > > index afb2aa92f6..6dd9ce4a62 100644
> > > > --- a/package/qemu/qemu.mk
> > > > +++ b/package/qemu/qemu.mk
> > > > @@ -16,7 +16,7 @@ QEMU_LICENSE_FILES = COPYING COPYING.LIB
> > > >  #-------------------------------------------------------------
> > > >  # Target-qemu
> > > >
> > > > -QEMU_DEPENDENCIES = host-pkgconf host-python libglib2 zlib pixman
> > > > +QEMU_DEPENDENCIES = host-pkgconf libglib2 zlib pixman
> > > >
> > > >  # Need the LIBS variable because librt and libm are
> > > >  # not automatically pulled. :-(
> > > > @@ -25,9 +25,19 @@ QEMU_LIBS = -lrt -lm
> > > >  QEMU_OPTS =
> > > >
> > > >  QEMU_VARS = \
> > > > -     LIBTOOL=$(HOST_DIR)/bin/libtool \
> > > > -     PYTHON=$(HOST_DIR)/bin/python2 \
> > > > +     LIBTOOL=$(HOST_DIR)/bin/libtool
> > > > +
> > > > +ifeq ($(BR2_PACKAGE_PYTHON3),y)
> > > > +QEMU_DEPENDENCIES += host-python3
> > > > +QEMU_VARS += \
> > > > +     PYTHON=$(HOST_DIR)/bin/python3 \
> > > > +     PYTHONPATH=$(TARGET_DIR)/usr/lib/python$(PYTHON3_VERSION_MAJOR)/site-packages
> > > > +else
> > > > +QEMU_DEPENDENCIES += host-python
> > > > +QEMU_VARS += \
> > > > +     PYTHON=$(HOST_DIR)/bin/python \
> > > >       PYTHONPATH=$(TARGET_DIR)/usr/lib/python$(PYTHON_VERSION_MAJOR)/site-packages
> > > > +endif
> > >
> > > Can't we use the host installed python? Python is already a dependency
> > > of Buildroot.
> > >
> > > baruch
> > >
> > > >  # If we want to specify only a subset of targets, we must still enable all
> > > >  # of them, so that QEMU properly builds its list of default targets, from
> > > > @@ -150,7 +160,7 @@ $(eval $(generic-package))
> > > >  #-------------------------------------------------------------
> > > >  # Host-qemu
> > > >
> > > > -HOST_QEMU_DEPENDENCIES = host-pkgconf host-python host-zlib host-libglib2 host-pixman
> > > > +HOST_QEMU_DEPENDENCIES = host-pkgconf host-zlib host-libglib2 host-pixman
> > > >
> > > >  #       BR ARCH         qemu
> > > >  #       -------         ----
> > > > @@ -263,12 +273,19 @@ define HOST_QEMU_CONFIGURE_CMDS
> > > >               --interp-prefix=$(STAGING_DIR) \
> > > >               --cc="$(HOSTCC)" \
> > > >               --host-cc="$(HOSTCC)" \
> > > > -             --python=$(HOST_DIR)/bin/python2 \
> > > >               --extra-cflags="$(HOST_CFLAGS)" \
> > > >               --extra-ldflags="$(HOST_LDFLAGS)" \
> > > >               $(HOST_QEMU_OPTS)
> > > >  endef
> > > >
> > > > +ifeq ($(BR2_PACKAGE_PYTHON3),y)
> > > > +HOST_QEMU_DEPENDENCIES += host-python3
> > > > +HOST_QEMU_CONFIGURE_CMDS += --python=$(HOST_DIR)/bin/python3
> > > > +else
> > > > +HOST_QEMU_DEPENDENCIES += host-python
> > > > +HOST_QEMU_CONFIGURE_CMDS += --python=$(HOST_DIR)/bin/python2
> > > > +endif
> > > > +
> > > >  define HOST_QEMU_BUILD_CMDS
> > > >       $(HOST_MAKE_ENV) $(MAKE) -C $(@D)
> > > >  endef
>
> --
>      http://baruch.siach.name/blog/                  ~. .~   Tk Open Systems
> =}------------------------------------------------ooO--U--Ooo------------{=
>    - baruch at tkos.co.il - tel: +972.2.679.5364, http://www.tkos.co.il -

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

* [Buildroot] [PATCH v2 1/1] qemu: add support for python3
  2018-09-05 16:43       ` Adam Duskett
@ 2018-09-05 17:47         ` Baruch Siach
  2018-09-06  7:50           ` Thomas Petazzoni
  0 siblings, 1 reply; 10+ messages in thread
From: Baruch Siach @ 2018-09-05 17:47 UTC (permalink / raw)
  To: buildroot

Hi Adam,

Adam Duskett writes:
> How would I test this? I am used to having BuildRoot handle the paths
> for such dependencies.

Just send RFC patch that you tested on your host with whatever Python
version you have installed. There are a number of participants in this
list that have access to hosts running RHEL6 or its derivatives.

With host installed Python being used there might be no need to
explicitly set the path of the Python executable, isn't it?

baruch

> On Tue, Sep 4, 2018 at 11:59 PM Baruch Siach <baruch@tkos.co.il> wrote:
>> Hi Adam,
>>
>> On Tue, Sep 04, 2018 at 03:09:26PM -0400, Adam Duskett wrote:
>> > I'm not sure;
>> >
>> > We support Distributions as old as CentOS6, which have very very old
>> > versions of Python...
>>
>> Buildroot requires Python version 2.6 or newer:
>>
>>   https://buildroot.org/downloads/manual/manual.html#requirement-mandatory
>>
>> Can Python 2.6 build qemu?
>>
>> baruch
>>
>> > On Tue, Sep 4, 2018 at 2:47 PM Baruch Siach <baruch@tkos.co.il> wrote:
>> > > Adam Duskett writes:
>> > > > qemu 2.12.0 now supports building against python3.
>> > > > see: https://wiki.qemu.org/ChangeLog/2.12#Build_Dependencies
>> > > >
>> > > > Signed-off-by: Adam Duskett <aduskett@gmail.com>
>> > > > ---
>> > > > Changes v1 -> v2:
>> > > >   - Split the python version check into two seperate checks for
>> > > >     readability, one for the target, one for the host.
>> > > >   - Fix location of the python version check for target and host.
>> > > >
>> > > >  package/qemu/qemu.mk | 27 ++++++++++++++++++++++-----
>> > > >  1 file changed, 22 insertions(+), 5 deletions(-)
>> > > >
>> > > > diff --git a/package/qemu/qemu.mk b/package/qemu/qemu.mk
>> > > > index afb2aa92f6..6dd9ce4a62 100644
>> > > > --- a/package/qemu/qemu.mk
>> > > > +++ b/package/qemu/qemu.mk
>> > > > @@ -16,7 +16,7 @@ QEMU_LICENSE_FILES = COPYING COPYING.LIB
>> > > >  #-------------------------------------------------------------
>> > > >  # Target-qemu
>> > > >
>> > > > -QEMU_DEPENDENCIES = host-pkgconf host-python libglib2 zlib pixman
>> > > > +QEMU_DEPENDENCIES = host-pkgconf libglib2 zlib pixman
>> > > >
>> > > >  # Need the LIBS variable because librt and libm are
>> > > >  # not automatically pulled. :-(
>> > > > @@ -25,9 +25,19 @@ QEMU_LIBS = -lrt -lm
>> > > >  QEMU_OPTS =
>> > > >
>> > > >  QEMU_VARS = \
>> > > > -     LIBTOOL=$(HOST_DIR)/bin/libtool \
>> > > > -     PYTHON=$(HOST_DIR)/bin/python2 \
>> > > > +     LIBTOOL=$(HOST_DIR)/bin/libtool
>> > > > +
>> > > > +ifeq ($(BR2_PACKAGE_PYTHON3),y)
>> > > > +QEMU_DEPENDENCIES += host-python3
>> > > > +QEMU_VARS += \
>> > > > +     PYTHON=$(HOST_DIR)/bin/python3 \
>> > > > +     PYTHONPATH=$(TARGET_DIR)/usr/lib/python$(PYTHON3_VERSION_MAJOR)/site-packages
>> > > > +else
>> > > > +QEMU_DEPENDENCIES += host-python
>> > > > +QEMU_VARS += \
>> > > > +     PYTHON=$(HOST_DIR)/bin/python \
>> > > >       PYTHONPATH=$(TARGET_DIR)/usr/lib/python$(PYTHON_VERSION_MAJOR)/site-packages
>> > > > +endif
>> > >
>> > > Can't we use the host installed python? Python is already a dependency
>> > > of Buildroot.
>> > >
>> > > baruch
>> > >
>> > > >  # If we want to specify only a subset of targets, we must still enable all
>> > > >  # of them, so that QEMU properly builds its list of default targets, from
>> > > > @@ -150,7 +160,7 @@ $(eval $(generic-package))
>> > > >  #-------------------------------------------------------------
>> > > >  # Host-qemu
>> > > >
>> > > > -HOST_QEMU_DEPENDENCIES = host-pkgconf host-python host-zlib host-libglib2 host-pixman
>> > > > +HOST_QEMU_DEPENDENCIES = host-pkgconf host-zlib host-libglib2 host-pixman
>> > > >
>> > > >  #       BR ARCH         qemu
>> > > >  #       -------         ----
>> > > > @@ -263,12 +273,19 @@ define HOST_QEMU_CONFIGURE_CMDS
>> > > >               --interp-prefix=$(STAGING_DIR) \
>> > > >               --cc="$(HOSTCC)" \
>> > > >               --host-cc="$(HOSTCC)" \
>> > > > -             --python=$(HOST_DIR)/bin/python2 \
>> > > >               --extra-cflags="$(HOST_CFLAGS)" \
>> > > >               --extra-ldflags="$(HOST_LDFLAGS)" \
>> > > >               $(HOST_QEMU_OPTS)
>> > > >  endef
>> > > >
>> > > > +ifeq ($(BR2_PACKAGE_PYTHON3),y)
>> > > > +HOST_QEMU_DEPENDENCIES += host-python3
>> > > > +HOST_QEMU_CONFIGURE_CMDS += --python=$(HOST_DIR)/bin/python3
>> > > > +else
>> > > > +HOST_QEMU_DEPENDENCIES += host-python
>> > > > +HOST_QEMU_CONFIGURE_CMDS += --python=$(HOST_DIR)/bin/python2
>> > > > +endif
>> > > > +
>> > > >  define HOST_QEMU_BUILD_CMDS
>> > > >       $(HOST_MAKE_ENV) $(MAKE) -C $(@D)
>> > > >  endef

--
     http://baruch.siach.name/blog/                  ~. .~   Tk Open Systems
=}------------------------------------------------ooO--U--Ooo------------{=
   - baruch at tkos.co.il - tel: +972.52.368.4656, http://www.tkos.co.il -

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

* [Buildroot] [PATCH v2 1/1] qemu: add support for python3
  2018-09-05 17:47         ` Baruch Siach
@ 2018-09-06  7:50           ` Thomas Petazzoni
  2018-09-06 22:58             ` Hollis Blanchard
  0 siblings, 1 reply; 10+ messages in thread
From: Thomas Petazzoni @ 2018-09-06  7:50 UTC (permalink / raw)
  To: buildroot

Hello,

+Hollis, Matt.

On Wed, 05 Sep 2018 20:47:08 +0300, Baruch Siach wrote:

> Adam Duskett writes:
> > How would I test this? I am used to having BuildRoot handle the paths
> > for such dependencies.  
> 
> Just send RFC patch that you tested on your host with whatever Python
> version you have installed. There are a number of participants in this
> list that have access to hosts running RHEL6 or its derivatives.

It would actually be useful if Hollis (or Matt ?) could provide a
Docker container to easily access a RHEL6.5 system, so that people can
try out what happens on such an old system. I guess RHEL6.5 itself is
not easy to access because it's only for Redhat customers, but perhaps
there is an equivalent version of CentOS that would do the job ?

https://hub.docker.com/_/centos/ has a CentOS 6.6 docker image, but not
CentOS 6.5. However, CentOS 6.6 also has Python 2.6 by default:

$ sudo docker run -i -t centos:6.6 /bin/bash
[...]
[root at f7e0f2f6d7af /]# python
Python 2.6.6 (r266:84292, Jan 22 2014, 09:42:36) 
[GCC 4.4.7 20120313 (Red Hat 4.4.7-4)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> 

Best regards,

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

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

* [Buildroot] [PATCH v2 1/1] qemu: add support for python3
  2018-09-04 18:39 [Buildroot] [PATCH v2 1/1] qemu: add support for python3 Adam Duskett
  2018-09-04 18:47 ` Baruch Siach
@ 2018-09-06 19:32 ` Thomas Petazzoni
  2018-09-10 18:35 ` Trent Piepho
  2 siblings, 0 replies; 10+ messages in thread
From: Thomas Petazzoni @ 2018-09-06 19:32 UTC (permalink / raw)
  To: buildroot

Hello,

On Tue,  4 Sep 2018 14:39:34 -0400, Adam Duskett wrote:
> qemu 2.12.0 now supports building against python3.
> see: https://wiki.qemu.org/ChangeLog/2.12#Build_Dependencies
> 
> Signed-off-by: Adam Duskett <aduskett@gmail.com>
> ---
> Changes v1 -> v2:
>   - Split the python version check into two seperate checks for
>     readability, one for the target, one for the host.
>   - Fix location of the python version check for target and host.

I've marked as Changes Requested following the request from Baruch to
test if the system-provided Python can be used instead of building our
own.

Thanks,

Thomas
-- 
Thomas Petazzoni, CTO, Bootlin (formerly Free Electrons)
Embedded Linux and Kernel engineering
https://bootlin.com

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

* [Buildroot] [PATCH v2 1/1] qemu: add support for python3
  2018-09-06  7:50           ` Thomas Petazzoni
@ 2018-09-06 22:58             ` Hollis Blanchard
  0 siblings, 0 replies; 10+ messages in thread
From: Hollis Blanchard @ 2018-09-06 22:58 UTC (permalink / raw)
  To: buildroot

On 09/06/2018 12:50 AM, Thomas Petazzoni wrote:
> Hello,
>
> +Hollis, Matt.
>
> On Wed, 05 Sep 2018 20:47:08 +0300, Baruch Siach wrote:
>
>> Adam Duskett writes:
>>> How would I test this? I am used to having BuildRoot handle the paths
>>> for such dependencies.
>> Just send RFC patch that you tested on your host with whatever Python
>> version you have installed. There are a number of participants in this
>> list that have access to hosts running RHEL6 or its derivatives.
> It would actually be useful if Hollis (or Matt ?) could provide a
> Docker container to easily access a RHEL6.5 system, so that people can
> try out what happens on such an old system. I guess RHEL6.5 itself is
> not easy to access because it's only for Redhat customers, but perhaps
> there is an equivalent version of CentOS that would do the job ?
>
> https://hub.docker.com/_/centos/ has a CentOS 6.6 docker image, but not
> CentOS 6.5. However, CentOS 6.6 also has Python 2.6 by default:
>
> $ sudo docker run -i -t centos:6.6 /bin/bash
> [...]
> [root at f7e0f2f6d7af /]# python
> Python 2.6.6 (r266:84292, Jan 22 2014, 09:42:36)
> [GCC 4.4.7 20120313 (Red Hat 4.4.7-4)] on linux2
> Type "help", "copyright", "credits" or "license" for more information.

Right, I can't distribute any Docker images.

I'm sure there are some differences from 6.5, but CentOS 6.6 would be a 
good testing ground.

Hollis Blanchard
Mentor Graphics Emulation Division

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

* [Buildroot] [PATCH v2 1/1] qemu: add support for python3
  2018-09-04 18:39 [Buildroot] [PATCH v2 1/1] qemu: add support for python3 Adam Duskett
  2018-09-04 18:47 ` Baruch Siach
  2018-09-06 19:32 ` Thomas Petazzoni
@ 2018-09-10 18:35 ` Trent Piepho
  2 siblings, 0 replies; 10+ messages in thread
From: Trent Piepho @ 2018-09-10 18:35 UTC (permalink / raw)
  To: buildroot

On Tue, 2018-09-04 at 14:39 -0400, Adam Duskett wrote:
> qemu 2.12.0 now supports building against python3.
> see: https://wiki.qemu.org/ChangeLog/2.12#Build_Dependencies
> 
> Signed-off-by: Adam Duskett <aduskett@gmail.com>
> ---
> Changes v1 -> v2:
>   - Split the python version check into two seperate checks for
>     readability, one for the target, one for the host.
>   - Fix location of the python version check for target and host.


>  
> +ifeq ($(BR2_PACKAGE_PYTHON3),y)
> +HOST_QEMU_DEPENDENCIES += host-python3
> +HOST_QEMU_CONFIGURE_CMDS += --python=$(HOST_DIR)/bin/python3
> +else
> +HOST_QEMU_DEPENDENCIES += host-python
> +HOST_QEMU_CONFIGURE_CMDS += --python=$(HOST_DIR)/bin/python2
> +endif

This will mean that if the target system does not have python at all,
then one is forced to use host python 2.

Which is an existing buildroot problem.  But I wish it could be fixed
instead of further ingraining the concept of "host python version is
target python version or python 2 if no target python."  Because that
concept just isn't right.

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

end of thread, other threads:[~2018-09-10 18:35 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-09-04 18:39 [Buildroot] [PATCH v2 1/1] qemu: add support for python3 Adam Duskett
2018-09-04 18:47 ` Baruch Siach
2018-09-04 19:09   ` Adam Duskett
2018-09-05  3:59     ` Baruch Siach
2018-09-05 16:43       ` Adam Duskett
2018-09-05 17:47         ` Baruch Siach
2018-09-06  7:50           ` Thomas Petazzoni
2018-09-06 22:58             ` Hollis Blanchard
2018-09-06 19:32 ` Thomas Petazzoni
2018-09-10 18:35 ` Trent Piepho

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.