Skip to contentSkip to conversation

Python 3 compatibility followup patches

PATCH In review Wei Liu 2 participants 5 messages Mar 13, 2019

lore
Share & tools
lore

Wei Liu

author
#0 lore raw

cover Python 3 compatibility followup patches

Wei Liu (3):
automation: use python-dev python2.7-dev in Debian and Ubuntu
travis: use python-dev instead of python2.7-dev build/m4: fix python library detection on Ubuntu systems

 .travis.yml                                         | 2 +-
 automation/build/debian/jessie-i386.dockerfile      | 2 +-
 automation/build/debian/jessie.dockerfile           | 2 +-
 automation/build/debian/stretch-i386.dockerfile     | 2 +-
 automation/build/debian/stretch.dockerfile          | 2 +-
 automation/build/debian/unstable-arm64v8.dockerfile | 2 +-
 automation/build/debian/unstable-i386.dockerfile    | 2 +-
 automation/build/debian/unstable.dockerfile         | 2 +-
 automation/build/ubuntu/bionic.dockerfile           | 2 +-
 automation/build/ubuntu/trusty.dockerfile           | 2 +-
 automation/build/ubuntu/xenial.dockerfile           | 2 +-
 m4/python_devel.m4                                  | 7 +++++++
 tools/configure                                     | 7 +++++++
 13 files changed, 25 insertions(+), 11 deletions(-)
Signature · 7 lines
2.11.0


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

PATCH 1/3 automation: use python-dev python2.7-dev in Debian and Ubuntu

... instead of python2.7-dev.

We installed python2.7-dev because xen only worked with 2.7.

Installing python2.7-dev only gives python2.7-config, which causes configure to fail because it wants python-config by default. Now xen should work with 2.6 and above, we can install python-dev and let distros pick the default python.

---
I already updated all docker images. I intend to commit this even without an ack from Doug.

---
 automation/build/debian/jessie-i386.dockerfile      | 2 +-
 automation/build/debian/jessie.dockerfile           | 2 +-
 automation/build/debian/stretch-i386.dockerfile     | 2 +-
 automation/build/debian/stretch.dockerfile          | 2 +-
 automation/build/debian/unstable-arm64v8.dockerfile | 2 +-
 automation/build/debian/unstable-i386.dockerfile    | 2 +-
 automation/build/debian/unstable.dockerfile         | 2 +-
 automation/build/ubuntu/bionic.dockerfile           | 2 +-
 automation/build/ubuntu/trusty.dockerfile           | 2 +-
 automation/build/ubuntu/xenial.dockerfile           | 2 +-
 10 files changed, 10 insertions(+), 10 deletions(-)
automation/build/debian/jessie-i386.dockerfile +1 -1
index 7a05004511..66a6abb381 100644
@@ -17,7 +17,7 @@ RUN apt-get update && \
         zlib1g-dev \
         libncurses5-dev \
         libssl-dev \
-        python2.7-dev \
+        python-dev \
         xorg-dev \
         uuid-dev \
         libyajl-dev \
automation/build/debian/jessie.dockerfile +1 -1
index bd04209f7f..1232b9e204 100644
@@ -15,7 +15,7 @@ RUN apt-get update && \
         zlib1g-dev \
         libncurses5-dev \
         libssl-dev \
-        python2.7-dev \
+        python-dev \
         xorg-dev \
         uuid-dev \
         libyajl-dev \
automation/build/debian/stretch-i386.dockerfile +1 -1
index 65247a474e..d2e96fafa7 100644
@@ -17,7 +17,7 @@ RUN apt-get update && \
         zlib1g-dev \
         libncurses5-dev \
         libssl-dev \
-        python2.7-dev \
+        python-dev \
         xorg-dev \
         uuid-dev \
         libyajl-dev \
automation/build/debian/stretch.dockerfile +1 -1
index 9be09c5377..daf8c9d384 100644
@@ -15,7 +15,7 @@ RUN apt-get update && \
         zlib1g-dev \
         libncurses5-dev \
         libssl-dev \
-        python2.7-dev \
+        python-dev \
         xorg-dev \
         uuid-dev \
         libyajl-dev \
automation/build/debian/unstable-arm64v8.dockerfile +1 -1
index 57db46a4d1..c701777c8d 100644
@@ -15,7 +15,7 @@ RUN apt-get update && \
         zlib1g-dev \
         libncurses5-dev \
         libssl-dev \
-        python2.7-dev \
+        python-dev \
         xorg-dev \
         uuid-dev \
         libyajl-dev \
automation/build/debian/unstable-i386.dockerfile +1 -1
index ffb9f11daa..07df842240 100644
@@ -17,7 +17,7 @@ RUN apt-get update && \
         zlib1g-dev \
         libncurses5-dev \
         libssl-dev \
-        python2.7-dev \
+        python-dev \
         xorg-dev \
         uuid-dev \
         libyajl-dev \
automation/build/debian/unstable.dockerfile +1 -1
index 0ba0c056d8..7762cf97ab 100644
@@ -15,7 +15,7 @@ RUN apt-get update && \
         zlib1g-dev \
         libncurses5-dev \
         libssl-dev \
-        python2.7-dev \
+        python-dev \
         xorg-dev \
         uuid-dev \
         libyajl-dev \
automation/build/ubuntu/bionic.dockerfile +1 -1
index 8de67ef14e..8e6a5d581f 100644
@@ -15,7 +15,7 @@ RUN apt-get update && \
         zlib1g-dev \
         libncurses5-dev \
         libssl-dev \
-        python2.7-dev \
+        python-dev \
         xorg-dev \
         uuid-dev \
         libyajl-dev \
automation/build/ubuntu/trusty.dockerfile +1 -1
index 1d04bccbdf..d43d60c5f5 100644
@@ -15,7 +15,7 @@ RUN apt-get update && \
         zlib1g-dev \
         libncurses5-dev \
         libssl-dev \
-        python2.7-dev \
+        python-dev \
         xorg-dev \
         uuid-dev \
         libyajl-dev \
automation/build/ubuntu/xenial.dockerfile +1 -1
index 37869e39ed..66ddf15923 100644
@@ -15,7 +15,7 @@ RUN apt-get update && \
         zlib1g-dev \
         libncurses5-dev \
         libssl-dev \
-        python2.7-dev \
+        python-dev \
         xorg-dev \
         uuid-dev \
         libyajl-dev \
Signature · 7 lines
2.11.0


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

PATCH 2/3 travis: use python-dev instead of python2.7-dev

In reply to Wei Liu

Xen build should be using default python now.

---
 .travis.yml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
.travis.yml +1 -1
index 2266b4d22f..15ca9e9047 100644
@@ -44,7 +44,7 @@ addons:
             - zlib1g-dev
             - libncurses5-dev
             - libssl-dev
-            - python2.7-dev
+            - python-dev
             - xorg-dev
             - uuid-dev
             - libyajl-dev
Signature · 7 lines
2.11.0


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

PATCH 3/3 build/m4: fix python library detection on Ubuntu systems

In reply to Wei Liu

16cc3362aed doesn't work on Ubuntu with gcc (but it does work with clang). Work around it by manipulating LIBS.

---
 m4/python_devel.m4 | 7 +++++++
 tools/configure    | 7 +++++++
 2 files changed, 14 insertions(+)
m4/python_devel.m4 +7 -0
index f9cb23aee1..7f26381376 100644
@@ -1,6 +1,7 @@
 AC_DEFUN([AX_CHECK_PYTHON_DEVEL], [
 ac_previous_cppflags=$CPPFLAGS
 ac_previous_ldflags=$LDFLAGS
+ac_previous_libs=$LIBS
 AC_PATH_PROG([pyconfig], [$PYTHON-config], [no])
 AS_IF([test x"$pyconfig" = x"no"], [
     dnl For those that don't have python-config
@@ -15,10 +16,15 @@ AS_IF([test x"$pyconfig" = x"no"], [
         print(distutils.sysconfig.get_config_var("LINKFORSHARED"))'`"
     LDFLAGS="$LDFLAGS `$PYTHON -c 'import distutils.sysconfig; \
         print(distutils.sysconfig.get_config_var("LDFLAGS"))'`"
+    LIBS="$LIBS `$PYTHON -c 'import distutils.sysconfig; \
+        print(distutils.sysconfig.get_config_var("LIBS"))'`"
+    LIBS="$LIBS `$PYTHON -c 'import distutils.sysconfig; \
+        print(distutils.sysconfig.get_config_var("SYSLIBS"))'`"
 ], [
     dnl If python-config is found use it
     CPPFLAGS="$CFLAGS `$PYTHON-config --cflags`"
     LDFLAGS="$LDFLAGS `$PYTHON-config --ldflags`"
+    LIBS="$LIBS `$PYTHON-config --libs`"
 ])
 
 AC_CHECK_HEADER([Python.h], [],
@@ -28,4 +34,5 @@ AC_CHECK_FUNC([PyArg_ParseTuple], [],
 
 CPPFLAGS=$ac_previous_cppflags
 LDFLAGS=$ac_previous_ldflags
+LIBS=$ac_previous_libs
 ])
tools/configure +7 -0
index 9ff879548a..b66d3f6fba 100755
@@ -7418,6 +7418,7 @@ if test "$cross_compiling" != yes; then :
 
 ac_previous_cppflags=$CPPFLAGS
 ac_previous_ldflags=$LDFLAGS
+ac_previous_libs=$LIBS
 # Extract the first word of "$PYTHON-config", so it can be a program name with args.
 set dummy $PYTHON-config; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
@@ -7472,11 +7473,16 @@ if test x"$pyconfig" = x"no"; then :
         print(distutils.sysconfig.get_config_var("LINKFORSHARED"))'`"
     LDFLAGS="$LDFLAGS `$PYTHON -c 'import distutils.sysconfig; \
         print(distutils.sysconfig.get_config_var("LDFLAGS"))'`"
+    LIBS="$LIBS `$PYTHON -c 'import distutils.sysconfig; \
+        print(distutils.sysconfig.get_config_var("LIBS"))'`"
+    LIBS="$LIBS `$PYTHON -c 'import distutils.sysconfig; \
+        print(distutils.sysconfig.get_config_var("SYSLIBS"))'`"
 
 else
 
         CPPFLAGS="$CFLAGS `$PYTHON-config --cflags`"
     LDFLAGS="$LDFLAGS `$PYTHON-config --ldflags`"
+    LIBS="$LIBS `$PYTHON-config --libs`"
 
 fi
 
@@ -7498,6 +7504,7 @@ fi
 
 CPPFLAGS=$ac_previous_cppflags
 LDFLAGS=$ac_previous_ldflags
+LIBS=$ac_previous_libs
 
 
     { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether Python setup.py brokenly enables -D_FORTIFY_SOURCE" >&5
Signature · 7 lines
2.11.0


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