Source: python3.8
Version: 3.8.0~b2-5
Tags: patch
User: debian-cr...@lists.debian.org
Usertags: ftcbfs

python3.8 fails to cross build from source.

The initial failure comes from ./configure which insists that we have a
python3.8 (not any earlier python). A dependency on python3.8:any
<cross> can fix that.

The next failure comes from dtrace as it fails finding sdt headers using
the build architecture compiler. For it to work, CC must be exported.
This could be considered a fault of dtrace. However, exporting CC for
the whole build fixes this aspect.

Some import tests are not conditionalized to DEB_BUILD_OPTIONS=nocheck
and fail.

Finally sysconfigdata-name.diff fails to update one cross
compilation-specific occasion in configure.ac. As a consequence, the
original name is used and the intended file is not created.

After fixing all of these, python3.8 cross builds successfully. Please
consider applying the attached patch.

Helmut
diff --minimal -Nru python3.8-3.8.0~b2/debian/changelog 
python3.8-3.8.0~b2/debian/changelog
--- python3.8-3.8.0~b2/debian/changelog 2019-07-11 11:55:03.000000000 +0200
+++ python3.8-3.8.0~b2/debian/changelog 2019-07-14 12:07:34.000000000 +0200
@@ -1,3 +1,14 @@
+python3.8 (3.8.0~b2-5.1) UNRELEASED; urgency=medium
+
+  * Non-maintainer upload.
+  * Fix FTCBFS: (Closes: #-1)
+    + Build-Depends, when cross compiling we need python3.8.
+    + Export CC, because dtrace needs it.
+    + Honour DEB_BUILD_OPTIONS=nocheck more thoroughly.
+    + Fix up sysconfigdata-name.diff.
+
+ -- Helmut Grohne <hel...@subdivi.de>  Sun, 14 Jul 2019 12:07:34 +0200
+
 python3.8 (3.8.0~b2-5) unstable; urgency=high
 
   * Bump standards version.
diff --minimal -Nru python3.8-3.8.0~b2/debian/control 
python3.8-3.8.0~b2/debian/control
--- python3.8-3.8.0~b2/debian/control   2019-07-11 11:55:03.000000000 +0200
+++ python3.8-3.8.0~b2/debian/control   2019-07-14 12:07:34.000000000 +0200
@@ -14,7 +14,7 @@
   locales-all,
   libsqlite3-dev, libffi-dev (>= 3.0.5) [!or1k !avr32],
   libgpm2 [linux-any],
-  mime-support, netbase, bzip2, time, python3:any,
+  mime-support, netbase, bzip2, time, python3:any, python3.8:any <cross>,
   net-tools, xvfb <!nocheck>, xauth <!nocheck>,
   systemtap-sdt-dev
 Build-Depends-Indep: python3-sphinx, python3-docs-theme, texinfo
diff --minimal -Nru python3.8-3.8.0~b2/debian/patches/sysconfigdata-name.diff 
python3.8-3.8.0~b2/debian/patches/sysconfigdata-name.diff
--- python3.8-3.8.0~b2/debian/patches/sysconfigdata-name.diff   2019-07-11 
11:55:03.000000000 +0200
+++ python3.8-3.8.0~b2/debian/patches/sysconfigdata-name.diff   2019-07-14 
12:07:34.000000000 +0200
@@ -50,3 +50,14 @@
          multiarch=getattr(sys.implementation, '_multiarch', ''),
      ))
      _temp = __import__(name, globals(), locals(), ['build_time_vars'], 0)
+--- python3.8-3.8.0~b2.orig/configure.ac
++++ python3.8-3.8.0~b2/configure.ac
+@@ -75,7 +75,7 @@
+           AC_MSG_ERROR([python$PACKAGE_VERSION interpreter not found])
+       fi
+         AC_MSG_RESULT($interp)
+-      PYTHON_FOR_BUILD='_PYTHON_PROJECT_BASE=$(abs_builddir) 
_PYTHON_HOST_PLATFORM=$(_PYTHON_HOST_PLATFORM) PYTHONPATH=$(shell test -f 
pybuilddir.txt && echo $(abs_builddir)/`cat pybuilddir.txt`:)$(srcdir)/Lib 
_PYTHON_SYSCONFIGDATA_NAME=_sysconfigdata_$(ABIFLAGS)_$(MACHDEP)_$(MULTIARCH) 
'$interp
++      PYTHON_FOR_BUILD='_PYTHON_PROJECT_BASE=$(abs_builddir) 
_PYTHON_HOST_PLATFORM=$(_PYTHON_HOST_PLATFORM) PYTHONPATH=$(shell test -f 
pybuilddir.txt && echo $(abs_builddir)/`cat pybuilddir.txt`:)$(srcdir)/Lib 
_PYTHON_SYSCONFIGDATA_NAME=_sysconfigdata_$(ABIFLAGS)_$(MULTIARCH) '$interp
+     fi
+ elif test "$cross_compiling" = maybe; then
+     AC_MSG_ERROR([Cross compiling required --host=HOST-TUPLE and 
--build=ARCH])
diff --minimal -Nru python3.8-3.8.0~b2/debian/rules 
python3.8-3.8.0~b2/debian/rules
--- python3.8-3.8.0~b2/debian/rules     2019-07-11 11:55:03.000000000 +0200
+++ python3.8-3.8.0~b2/debian/rules     2019-07-14 12:07:34.000000000 +0200
@@ -153,6 +153,9 @@
 AR=$(DEB_HOST_GNU_TYPE)-ar
 RANLIB=$(DEB_HOST_GNU_TYPE)-ranlib
 
+# configure and dtrace consume these
+export CC CXX
+
 DPKG_CPPFLAGS= $(shell $(dpkg_buildflags) --get CPPFLAGS)
 DPKG_CFLAGS  := $(shell $(dpkg_buildflags) --get CFLAGS)
 DPKG_CFLAGS  := $(subst 
-fstack-protector-strong,-fstack-protector,$(DPKG_CFLAGS))
@@ -313,8 +316,8 @@
                CONFIGURE_LDFLAGS="$(DPKG_LDFLAGS) $(LTO_CFLAGS)" \
                PROFILE_TASK='$(PROFILE_TASK)' $(make_build_target)
 
+ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS)))
        : # check that things are correctly built
-ifeq ($(DEB_HOST_GNU_TYPE),$(DEB_BUILD_GNU_TYPE))
   ifneq (,$(filter $(DEB_HOST_ARCH_OS), linux))
        cd $(buildd_static) && ./python -c 'from _multiprocessing import 
SemLock'
   endif
@@ -343,8 +346,10 @@
        $(MAKE) $(NJOBS) -C $(buildd_debug) \
                EXTRA_CFLAGS="$(DEBUG_CFLAGS)"
 
+ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS)))
        cd $(buildd_static) && ./python -c 'import _decimal'
        cd $(buildd_debug) && ./python -c 'import math, cmath'
+endif
 
        touch stamps/stamp-build-debug
 
@@ -388,7 +393,7 @@
        rm -rf $(buildd_shared)
        mkdir -p $(buildd_shared)
        cd $(buildd_shared) && \
-         CC="$(CC)" CXX="$(CXX)" AR="$(AR)" RANLIB="$(RANLIB)" 
CFLAGS="$(OPT_CFLAGS)" \
+         AR="$(AR)" RANLIB="$(RANLIB)" CFLAGS="$(OPT_CFLAGS)" \
          CPPFLAGS="$(DPKG_CPPFLAGS)" LDFLAGS="$(DPKG_LDFLAGS) $(LTO_CFLAGS)" \
            $(config_site) \
            ../configure \
@@ -406,7 +411,7 @@
        rm -rf $(buildd_static)
        mkdir -p $(buildd_static)
        cd $(buildd_static) && \
-         CC="$(CC)" CXX="$(CXX)" AR="$(AR)" RANLIB="$(RANLIB)" 
CFLAGS="$(OPT_CFLAGS)" \
+         AR="$(AR)" RANLIB="$(RANLIB)" CFLAGS="$(OPT_CFLAGS)" \
          CPPFLAGS="$(DPKG_CPPFLAGS)" LDFLAGS="$(DPKG_LDFLAGS) $(LTO_CFLAGS)" \
            $(config_site) \
            ../configure \
@@ -419,7 +424,7 @@
        rm -rf $(buildd_debug)
        mkdir -p $(buildd_debug)
        cd $(buildd_debug) && \
-         CC="$(CC)" CXX="$(CXX)" AR="$(AR)" RANLIB="$(RANLIB)" 
CFLAGS="$(DEBUG_CFLAGS)" \
+         AR="$(AR)" RANLIB="$(RANLIB)" CFLAGS="$(DEBUG_CFLAGS)" \
          CPPFLAGS="$(DPKG_CPPFLAGS)" LDFLAGS="$(DPKG_LDFLAGS)" \
            $(config_site) \
            ../configure \
@@ -433,7 +438,7 @@
        rm -rf $(buildd_shdebug)
        mkdir -p $(buildd_shdebug)
        cd $(buildd_shdebug) && \
-         CC="$(CC)" CXX="$(CXX)" AR="$(AR)" RANLIB="$(RANLIB)" 
CFLAGS="$(DEBUG_CFLAGS)" \
+         AR="$(AR)" RANLIB="$(RANLIB)" CFLAGS="$(DEBUG_CFLAGS)" \
          CPPFLAGS="$(DPKG_CPPFLAGS)" LDFLAGS="$(DPKG_LDFLAGS)" \
            $(config_site) \
            ../configure \

Reply via email to