Skip to contentSkip to conversation

Default to python3

PATCH In review Anthony PERARD 3 participants 14 messages Jan 20, 2020 – Feb 11, 2020

lore
Share & tools
lore
#0 lore raw

cover Default to python3

Patch series available in this git branch:
https://xenbits.xen.org/git-http/people/aperard/xen-unstable.git br.python3-default-v1

Hi,

I think it's time for Xen to build with python3 by default.

The main reason for that is that QEMU upstream don't build with python 2.x anymore, and the python binary selected by Xen build system is the one used when building qemu-xen. So now osstest failed to build QEMU upstream.

Also, python2 is EOL.

FYI, the hypervisor build system already select python3 by default, this change the tools side.

Cheers,

Anthony PERARD (3):
automation: Only build QEMU if Python >= 3.5
automation: updating container to have python3-config binary
tools: Default to python3

 automation/build/debian/stretch-i386.dockerfile  | 1 +
 automation/build/debian/stretch.dockerfile       | 1 +
 automation/build/debian/unstable-i386.dockerfile | 1 +
 automation/build/debian/unstable.dockerfile      | 1 +
 automation/build/fedora/29.dockerfile            | 1 +
 automation/build/suse/opensuse-leap.dockerfile   | 1 +
 automation/build/ubuntu/bionic.dockerfile        | 1 +
 automation/build/ubuntu/trusty.dockerfile        | 1 +
 automation/build/ubuntu/xenial.dockerfile        | 1 +
 automation/scripts/build                         | 4 ++--
 tools/configure.ac                               | 2 +-
 11 files changed, 12 insertions(+), 3 deletions(-)
Signature · 7 lines
Anthony PERARD


_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel
#1 lore raw

PATCH 1/3 automation: Only build QEMU if Python >= 3.5

Recent version of QEMU will not build anymore if Python < 3.5. That is, QEMU 4.3 not released yet.

That check would also prevent the GitLab CI from building QEMU if python3 binary isn't present.

---
 automation/scripts/build | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
automation/scripts/build +2 -2
index 83c44e6ce758..0cd0f3971de5 100755
@@ -28,8 +28,8 @@ if [[ "${CC}" == "clang"* ]]; then
     cfgargs+=("--disable-stubdom")
 fi
 
-# Qemu requires Python 2.7 or later
-if python -c "import sys; res = sys.version_info < (2, 7); exit(not(res))"; then
+# Qemu requires Python 3.5 or later
+if ! type python3 || python3 -c "import sys; res = sys.version_info < (3, 5); exit(not(res))"; then
     cfgargs+=("--with-system-qemu=/bin/false")
 fi
 
Signature · 7 lines
Anthony PERARD


_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel
Acked-by on v1 1/3
#2 lore raw

Re: [Xen-devel] [XEN PATCH 1/3] automation: Only build QEMU if Python >= 3.5

Quoted 7 lines · Anthony PERARD

Recent version of QEMU will not build anymore if Python < 3.5. That is, QEMU 4.3 not released yet.

That check would also prevent the GitLab CI from building QEMU if python3 binary isn't present.

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel

#3 lore raw

PATCH 2/3 automation: updating container to have python3-config binary

In reply to Anthony PERARD

Those containers have already been updated in GitLab:
- debian/stretch
- debian/stretch-i386
- debian/unstable
- debian/unstable-i386
- fedora/29
- suse/opensuse-leap
- ubuntu/bionic
- ubuntu/trusty
- ubuntu/xenial

The container debian:unstable-arm64v8 haven't been changed.

---

I don't know how to update the container for ARM, so it hasn't been changed.

---
 automation/build/debian/stretch-i386.dockerfile  | 1 +
 automation/build/debian/stretch.dockerfile       | 1 +
 automation/build/debian/unstable-i386.dockerfile | 1 +
 automation/build/debian/unstable.dockerfile      | 1 +
 automation/build/fedora/29.dockerfile            | 1 +
 automation/build/suse/opensuse-leap.dockerfile   | 1 +
 automation/build/ubuntu/bionic.dockerfile        | 1 +
 automation/build/ubuntu/trusty.dockerfile        | 1 +
 automation/build/ubuntu/xenial.dockerfile        | 1 +
 9 files changed, 9 insertions(+)
automation/build/debian/stretch-i386.dockerfile +1 -0
index d2e96fafa73e..4797ae344231 100644
@@ -18,6 +18,7 @@ RUN apt-get update && \
         libncurses5-dev \
         libssl-dev \
         python-dev \
+        python3-dev \
         xorg-dev \
         uuid-dev \
         libyajl-dev \
automation/build/debian/stretch.dockerfile +1 -0
index 44e6eee07f5c..cfbb2e9b0b60 100644
@@ -16,6 +16,7 @@ RUN apt-get update && \
         libncurses5-dev \
         libssl-dev \
         python-dev \
+        python3-dev \
         xorg-dev \
         uuid-dev \
         libyajl-dev \
automation/build/debian/unstable-i386.dockerfile +1 -0
index 07df84224029..1a73b3b1eca3 100644
@@ -18,6 +18,7 @@ RUN apt-get update && \
         libncurses5-dev \
         libssl-dev \
         python-dev \
+        python3-dev \
         xorg-dev \
         uuid-dev \
         libyajl-dev \
automation/build/debian/unstable.dockerfile +1 -0
index a1428a3df045..2a834f671912 100644
@@ -16,6 +16,7 @@ RUN apt-get update && \
         libncurses5-dev \
         libssl-dev \
         python-dev \
+        python3-dev \
         xorg-dev \
         uuid-dev \
         libyajl-dev \
automation/build/fedora/29.dockerfile +1 -0
index 8ad0b2baf70c..5be4a9e2294c 100644
@@ -14,6 +14,7 @@ RUN dnf -y install \
         zlib-devel \
         openssl-devel \
         python-devel \
+        python3-devel \
         libuuid-devel \
         pkgconfig \
         gettext \
automation/build/suse/opensuse-leap.dockerfile +1 -0
index b68d5b0efba7..c60c13c943f2 100644
@@ -56,6 +56,7 @@ RUN zypper install -y --no-recommends \
         pkg-config \
         python \
         python-devel \
+        python3-devel \
         systemd-devel \
         tar \
         transfig \
automation/build/ubuntu/bionic.dockerfile +1 -0
index 8e6a5d581f55..712b2e47229c 100644
@@ -16,6 +16,7 @@ RUN apt-get update && \
         libncurses5-dev \
         libssl-dev \
         python-dev \
+        python3-dev \
         xorg-dev \
         uuid-dev \
         libyajl-dev \
automation/build/ubuntu/trusty.dockerfile +1 -0
index d43d60c5f51d..397a28061ddd 100644
@@ -16,6 +16,7 @@ RUN apt-get update && \
         libncurses5-dev \
         libssl-dev \
         python-dev \
+        python3-dev \
         xorg-dev \
         uuid-dev \
         libyajl-dev \
automation/build/ubuntu/xenial.dockerfile +1 -0
index 66ddf15923fc..ce0e84fa2fb8 100644
@@ -16,6 +16,7 @@ RUN apt-get update && \
         libncurses5-dev \
         libssl-dev \
         python-dev \
+        python3-dev \
         xorg-dev \
         uuid-dev \
         libyajl-dev \
Signature · 7 lines
Anthony PERARD


_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel
Acked-by on v1 2/3
#4 lore raw

Re: [Xen-devel] [XEN PATCH 2/3] automation: updating container to have python3-config binary

Quoted 11 lines · Anthony PERARD

Those containers have already been updated in GitLab:
- debian/stretch
- debian/stretch-i386
- debian/unstable
- debian/unstable-i386
- fedora/29
- suse/opensuse-leap
- ubuntu/bionic
- ubuntu/trusty
- ubuntu/xenial

Quoted 3 lines

The container debian:unstable-arm64v8 haven't been changed.

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel

#5 lore raw

PATCH 3/3 tools: Default to python3

In reply to Anthony PERARD

Main reason, newer version of QEMU doesn't support python 2.x anymore. Second main reason, python2 is EOL.

---

Please, rerun ./autogen.sh

---
 tools/configure.ac | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tools/configure.ac +1 -1
index 8d86c42de8e5..f288d2cc3fdd 100644
@@ -337,7 +337,7 @@ case "$host_os" in
   freebsd*) ;;
   *) AX_PATH_PROG_OR_FAIL([BASH], [bash]);;
 esac
-AS_IF([test -z "$PYTHON"], [AC_CHECK_PROGS([PYTHON], [python python3 python2], err)])
+AS_IF([test -z "$PYTHON"], [AC_CHECK_PROGS([PYTHON], [python3 python python2], err)])
 AS_IF([test "$PYTHON" = "err"], [AC_MSG_ERROR([No python interpreter found])])
 AS_IF([echo "$PYTHON" | grep -q "^/"], [], [AC_PATH_PROG([PYTHON], [$PYTHON])])
 PYTHONPATH=$PYTHON
Signature · 7 lines
Anthony PERARD


_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel
#7 lore raw
In reply to Anthony PERARD
Quoted 7 lines · Anthony PERARD

Patch series available in this git branch:
https://xenbits.xen.org/git-http/people/aperard/xen-unstable.git br.python3-default-v1

Hi,

I think it's time for Xen to build with python3 by default.

Quoted 8 lines

The main reason for that is that QEMU upstream don't build with python 2.x anymore, and the python binary selected by Xen build system is the one used when building qemu-xen. So now osstest failed to build QEMU upstream.

Also, python2 is EOL.

FYI, the hypervisor build system already select python3 by default, this change the tools side.

I forgot to say that there's a osstest patch as well:
[OSSTEST PATCH] ts-xen-build-prep: Install python3-dev

Signature · 6 lines
Anthony PERARD

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel
#8 lore raw
Quoted 12 lines · Anthony PERARD
Quoted 11 lines · Anthony PERARD

Patch series available in this git branch:
https://xenbits.xen.org/git-http/people/aperard/xen-unstable.git br.python3-default-v1

Hi,

I think it's time for Xen to build with python3 by default.

The main reason for that is that QEMU upstream don't build with python 2.x anymore, and the python binary selected by Xen build system is the one used when building qemu-xen. So now osstest failed to build QEMU upstream.

Quoted 7 lines
Quoted 4 lines

Also, python2 is EOL.

FYI, the hypervisor build system already select python3 by default, this change the tools side.

I forgot to say that there's a osstest patch as well:
[OSSTEST PATCH] ts-xen-build-prep: Install python3-dev

AIUI I don't need to wait for that patch to be applied before applying this series. Let me know if I'm wrong.

Wei.

Quoted 3 lines
Signature · 2 lines
-- 
Anthony PERARD

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel

#9 lore raw
Quoted 15 lines · Wei Liu
Quoted 14 lines · Anthony PERARD
Quoted 13 lines · Anthony PERARD

Patch series available in this git branch:
https://xenbits.xen.org/git-http/people/aperard/xen-unstable.git br.python3-default-v1

Hi,

I think it's time for Xen to build with python3 by default.

The main reason for that is that QEMU upstream don't build with python 2.x anymore, and the python binary selected by Xen build system is the one used when building qemu-xen. So now osstest failed to build QEMU upstream.

Also, python2 is EOL.

Quoted 8 lines
Quoted 5 lines
Quoted 2 lines

FYI, the hypervisor build system already select python3 by default, this change the tools side.

I forgot to say that there's a osstest patch as well:
[OSSTEST PATCH] ts-xen-build-prep: Install python3-dev

AIUI I don't need to wait for that patch to be applied before applying this series. Let me know if I'm wrong.

It just going to prevent a push :-). All build of staging will fail. So, the osstest patch is needed before applying the patch 3/3.

Cheers,

Signature · 6 lines
Anthony PERARD

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel
#10 lore raw
Quoted 19 lines · Anthony PERARD
Quoted 18 lines · Wei Liu
Quoted 17 lines · Anthony PERARD
Quoted 15 lines · Anthony PERARD

Patch series available in this git branch:
https://xenbits.xen.org/git-http/people/aperard/xen-unstable.git br.python3-default-v1

Hi,

I think it's time for Xen to build with python3 by default.

The main reason for that is that QEMU upstream don't build with python 2.x anymore, and the python binary selected by Xen build system is the one used when building qemu-xen. So now osstest failed to build QEMU upstream.

Also, python2 is EOL.

FYI, the hypervisor build system already select python3 by default, this change the tools side.

Quoted 8 lines
Quoted 5 lines
Quoted 2 lines

I forgot to say that there's a osstest patch as well:
[OSSTEST PATCH] ts-xen-build-prep: Install python3-dev

AIUI I don't need to wait for that patch to be applied before applying this series. Let me know if I'm wrong.

It just going to prevent a push :-). All build of staging will fail. So, the osstest patch is needed before applying the patch 3/3.

Ack. I will push the first two patches first.

BTW, have you updated the docker images in Gitlab CI?

Wei.

Quoted 5 lines

Cheers,

Signature · 1 line
Anthony PERARD

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel

#11 lore raw
Quoted 26 lines · Wei Liu
Quoted 25 lines · Anthony PERARD
Quoted 23 lines · Wei Liu
Quoted 12 lines · Anthony PERARD
Quoted 11 lines · Anthony PERARD

Patch series available in this git branch:
https://xenbits.xen.org/git-http/people/aperard/xen-unstable.git br.python3-default-v1

Hi,

I think it's time for Xen to build with python3 by default.

The main reason for that is that QEMU upstream don't build with python 2.x anymore, and the python binary selected by Xen build system is the one used when building qemu-xen. So now osstest failed to build QEMU upstream.

Quoted 7 lines
Quoted 4 lines

Also, python2 is EOL.

FYI, the hypervisor build system already select python3 by default, this change the tools side.

I forgot to say that there's a osstest patch as well:
[OSSTEST PATCH] ts-xen-build-prep: Install python3-dev

AIUI I don't need to wait for that patch to be applied before applying this series. Let me know if I'm wrong.

Quoted 6 lines
Quoted 2 lines

It just going to prevent a push :-). All build of staging will fail. So, the osstest patch is needed before applying the patch 3/3.

Ack. I will push the first two patches first.

BTW, have you updated the docker images in Gitlab CI?

Never mind. You said that in the commit message already.

Wei.

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel

#12 lore raw
In reply to Wei Liu
Quoted 23 lines · Wei Liu
Quoted 22 lines · Anthony PERARD
Quoted 21 lines · Wei Liu
Quoted 19 lines · Anthony PERARD
Quoted 7 lines · Anthony PERARD

Patch series available in this git branch:
https://xenbits.xen.org/git-http/people/aperard/xen-unstable.git br.python3-default-v1

Hi,

I think it's time for Xen to build with python3 by default.

Quoted 8 lines

The main reason for that is that QEMU upstream don't build with python 2.x anymore, and the python binary selected by Xen build system is the one used when building qemu-xen. So now osstest failed to build QEMU upstream.

Also, python2 is EOL.

FYI, the hypervisor build system already select python3 by default, this change the tools side.

I forgot to say that there's a osstest patch as well:
[OSSTEST PATCH] ts-xen-build-prep: Install python3-dev

Quoted 7 lines
Quoted 5 lines
Quoted 2 lines

AIUI I don't need to wait for that patch to be applied before applying this series. Let me know if I'm wrong.

It just going to prevent a push :-). All build of staging will fail. So, the osstest patch is needed before applying the patch 3/3.

Ack. I will push the first two patches first.

osstest should be ready, could you push that last patch?

Thanks,

Signature · 6 lines
Anthony PERARD

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel
#13 lore raw
Quoted 27 lines · Anthony PERARD
Quoted 26 lines · Wei Liu
Quoted 25 lines · Anthony PERARD
Quoted 23 lines · Wei Liu
Quoted 12 lines · Anthony PERARD
Quoted 11 lines · Anthony PERARD

Patch series available in this git branch:
https://xenbits.xen.org/git-http/people/aperard/xen-unstable.git br.python3-default-v1

Hi,

I think it's time for Xen to build with python3 by default.

The main reason for that is that QEMU upstream don't build with python 2.x anymore, and the python binary selected by Xen build system is the one used when building qemu-xen. So now osstest failed to build QEMU upstream.

Quoted 7 lines
Quoted 4 lines

Also, python2 is EOL.

FYI, the hypervisor build system already select python3 by default, this change the tools side.

I forgot to say that there's a osstest patch as well:
[OSSTEST PATCH] ts-xen-build-prep: Install python3-dev

AIUI I don't need to wait for that patch to be applied before applying this series. Let me know if I'm wrong.

Quoted 6 lines
Quoted 4 lines
Quoted 2 lines

It just going to prevent a push :-). All build of staging will fail. So, the osstest patch is needed before applying the patch 3/3.

Ack. I will push the first two patches first.

osstest should be ready, could you push that last patch?

Pushed.

Wei.

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel