Package: casacore
Version: 2.3.0-3
Severity: important
Tags: patch
User: ubuntu-de...@lists.ubuntu.com
Usertags: origin-ubuntu artful ubuntu-patch

In Ubuntu, we discovered that python-casacore was failing to build from
source on i386 after casacore had been rebuilt for the python3.6 transition. 
Surprisingly, the reason for this was that casacore's python3 detection - on
all architectures - had failed against python3.6 and instead linked
everything against libpython2.7.  Things nevertheless continued to work,
except on i386 where python-casacore loading libpython2.7 into a running
python3.6 process caused a segfault.

The amazing thing was that this managed to work anywhere else.

I've applied the attached patch to casacore in Ubuntu to add python3.6 to
the search path, fixing the misbuild.  Of course, the problem will recur
when python3.7 comes out, so a better upstream fix would be nice.

Filing this bug as important, but please note that python3.6 is coming soon
in Debian at which point this should be considered serious.

Thanks,
-- 
Steve Langasek                   Give me a lever long enough and a Free OS
Debian Developer                   to set it on, and I can move the world.
Ubuntu Developer                                    http://www.debian.org/
slanga...@ubuntu.com                                     vor...@debian.org
diff -Nru casacore-2.3.0/debian/patches/fix-python3.6-detection.patch 
casacore-2.3.0/debian/patches/fix-python3.6-detection.patch
--- casacore-2.3.0/debian/patches/fix-python3.6-detection.patch 1969-12-31 
16:00:00.000000000 -0800
+++ casacore-2.3.0/debian/patches/fix-python3.6-detection.patch 2017-08-29 
14:58:08.000000000 -0700
@@ -0,0 +1,20 @@
+Description: add support for python3.6
+ The python3 detection code only correctly picks up listed versions of
+ python3 on Debian/Ubuntu.  Otherwise it incorrectly falls back to
+ /usr/bin/python and python2.7!
+Author: Steve Langasek <steve.langa...@ubuntu.com>
+Bug-Ubuntu: https://bugs.launchpad.net/bugs/1710532
+
+Index: casacore-2.3.0/python3/CMakeLists.txt
+===================================================================
+--- casacore-2.3.0.orig/python3/CMakeLists.txt
++++ casacore-2.3.0/python3/CMakeLists.txt
+@@ -18,7 +18,7 @@
+ endif()
+ 
+ # Detect the python properties
+-set(Python_ADDITIONAL_VERSIONS 3.5 3.4)
++set(Python_ADDITIONAL_VERSIONS 3.6 3.5 3.4)
+ 
+ find_package(Python REQUIRED)
+ 
diff -Nru casacore-2.3.0/debian/patches/series 
casacore-2.3.0/debian/patches/series
--- casacore-2.3.0/debian/patches/series        2017-07-04 03:09:42.000000000 
-0700
+++ casacore-2.3.0/debian/patches/series        2017-08-29 14:54:46.000000000 
-0700
@@ -9,3 +9,4 @@
 Fix-compilation-for-GNU-Hurd.patch
 Fix-too-small-int-type-for-memory-on-32-bit-machines.patch
 Fix-FTBFS-tStatisticsUtilities-tLatticeStatistics-and-tLC.patch
+fix-python3.6-detection.patch

Reply via email to