Bug#915595: duc FTCBFS: configures for the wrong architecture

2018-12-05 Thread Helmut Grohne
On Wed, Dec 05, 2018 at 08:33:09AM +, Jonathan Dowland wrote:
> I've done so, thank you. The upload should close this bug. But, since
> the cross build failure remains, I think it would be nice to have a bug
> open to track that. I could clone this one for that purpose, but I don't
> know whether you would like the cloned bug to be usertagged (as this one
> is) or not.

You can as well reuse this bug. I've taken note that you've applied my
patch exceptionally quickly, so I don't need the closure of the bug to
retrigger a build anymore.

Let me summarize the options for making the documentation work for
cross:
 * Remove documentation from the package. That may sound ridiculous, but
   Arch:all packages are irrelevant for cross building, so splitting it
   out would fix it. Adding a binary package for a single manual page
   seems like a bad trade-off to me though.

 * Add a nodoc build profile and say that duc can only be cross built
   with nodoc.

 * Build duc twice^Wfour times. Another build pass could be added for
   the documentation:

ifneq ($(DEB_BUILD_ARCH),$(DEB_HOST_ARCH))
dpkg-architecture -a$(DEB_BUILD_ARCH) -f -c dh_auto_configure ...
endif

 * Generate the documentation at release time rather than build time.

 * Somehow generate the documentation without running duc during build.

 * Add "duc:native " to Build-Depends and build the documentation
   from the system copy of duc during cross compilation only.

None of these looks particularly attractive. I'm not sure whether it is
worth the effort. Using dh_auto_configure has advantages in
maintainability beyond just cross building, but this?

Hope this helps

Helmut



Bug#915595: duc FTCBFS: configures for the wrong architecture

2018-12-05 Thread Jonathan Dowland

Hi Helmut

Thank you for the report and detailed analysis of what's going on.

On Wed, Dec 05, 2018 at 08:05:43AM +0100, Helmut Grohne wrote:

Please consider applying the attached patch anyway
to make that failure more visible and close this bug when doing so.


I've done so, thank you. The upload should close this bug. But, since
the cross build failure remains, I think it would be nice to have a bug
open to track that. I could clone this one for that purpose, but I don't
know whether you would like the cloned bug to be usertagged (as this one
is) or not.


--

⢀⣴⠾⠻⢶⣦⠀
⣾⠁⢠⠒⠀⣿⡁ Jonathan Dowland
⢿⡄⠘⠷⠚⠋⠀ https://jmtd.net
⠈⠳⣄



Bug#915595: duc FTCBFS: configures for the wrong architecture

2018-12-04 Thread Helmut Grohne
Source: duc
Version: 1.4.3-4
Tags: patch
User: helm...@debian.org
Usertags: rebootstrap

duc fails to cross build from source, because it does not pass --host to
./configure. The easiest way of doing so is using dh_auto_configure. In
this case it is not entirely trivial, because dh_auto_configure also
passes --disable-dependency-tracking and the override_dh_auto_build
depends on ./configure recreating the directory structure in the build
folder, which happens when we pass --enable-dependency-tracking. So the
attached patch fixes that part, but it doesn't make duc cross buildable,
because it generates its documentation by running its own binary. That's
non-trivial to fix. Please consider applying the attached patch anyway
to make that failure more visible and close this bug when doing so.

Helmut
diff --minimal -Nru duc-1.4.3/debian/changelog duc-1.4.3/debian/changelog
--- duc-1.4.3/debian/changelog  2018-07-05 22:58:21.0 +0200
+++ duc-1.4.3/debian/changelog  2018-12-05 06:24:22.0 +0100
@@ -1,3 +1,11 @@
+duc (1.4.3-4.1) UNRELEASED; urgency=medium
+
+  * Non-maintainer upload.
+  * Address FTCBFS: Let dh_auto_configure pass --host to ./configure.
+(Closes: #-1)
+
+ -- Helmut Grohne   Wed, 05 Dec 2018 06:24:22 +0100
+
 duc (1.4.3-4) unstable; urgency=medium
 
   * Update Vcs-* headers to reflect migration from Alioth to Salsa.
diff --minimal -Nru duc-1.4.3/debian/rules duc-1.4.3/debian/rules
--- duc-1.4.3/debian/rules  2018-01-02 15:00:31.0 +0100
+++ duc-1.4.3/debian/rules  2018-12-05 06:24:22.0 +0100
@@ -5,8 +5,8 @@
 export DEB_BUILD_MAINT_OPTIONS = hardening=+all
 export DEB_LDFLAGS_MAINT_APPEND = -Wl,--as-needed
 
-FLAGS_duc:=--prefix=/usr
-FLAGS_duc-nox:=--prefix=/usr
+FLAGS_duc:=--enable-dependency-tracking
+FLAGS_duc-nox:=--enable-dependency-tracking
 FLAGS_duc-nox+=--disable-cairo
 FLAGS_duc-nox+=--disable-x11
 
@@ -17,10 +17,8 @@
dh $@ --with autoreconf
 
 override_dh_auto_configure: 
-   mkdir -p $(BUILDDIR)
-   cd $(BUILDDIR); ../../configure $(FLAGS_duc) CFLAGS="$(CFLAGS) -fPIE" 
LDFLAGS="$(LDFLAGS) -fPIE -pie"
-   mkdir -p $(BUILDDIR_NOX)
-   cd $(BUILDDIR_NOX); ../../configure $(FLAGS_duc-nox) CFLAGS="$(CFLAGS) 
-fPIE" LDFLAGS="$(LDFLAGS) -fPIE -pie"
+   dh_auto_configure --builddirectory=$(BUILDDIR) -- $(FLAGS_duc) 
CFLAGS="$(CFLAGS) -fPIE" LDFLAGS="$(LDFLAGS) -fPIE -pie"
+   dh_auto_configure --builddirectory=$(BUILDDIR_NOX) -- $(FLAGS_duc-nox) 
CFLAGS="$(CFLAGS) -fPIE" LDFLAGS="$(LDFLAGS) -fPIE -pie"
 
 override_dh_auto_build:
cp -r src/glad/* $(BUILDDIR)/src/glad/