Your message dated Mon, 16 Oct 2017 19:33:55 +0000
with message-id <[email protected]>
and subject line Bug#841761: fixed in cdbs 0.4.156
has caused the Debian Bug report #841761,
regarding cdbs: improve cross compilation with makefile and cmake classes
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact [email protected]
immediately.)


-- 
841761: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=841761
Debian Bug Tracking System
Contact [email protected] with problems
--- Begin Message ---
Package: cdbs
Version: 0.4.148
Severity: wishlist
Tags: patch
User: [email protected]
Usertags: rebootstrap
Control: affects -1 + src:cmt src:duma src:freerdp src:hydrogen

Cross building debian packages that use cdbs does not work as well as it
could work. Recent improvements in debhelper have made a significant
chunk of packages cross build without modification. Maybe we can
replicate that for cdbs? I have a number of small and larger issues:

In 1/class/cmake.mk, the DEB_BUILDDIR variable uses DEB_BUILD_GNU_TYPE.
That sounds wrong as building things for the build architecture is not a
common thing to do. I suggest to change this to DEB_HOST_GNU_TYPE and
note that in the vast majority of uses, this is only an aesthetic
change.

When using cmake for cross compilation, one needs to pass a number of
variables such as CMAKE_SYSTEM_NAME or CMAKE_SYSTEM_PROCESSOR. I think
that cdbs is the right place to add them (as did debhelper) and propose
adding a new variables DEB_CMAKE_CROSS_ARGS to 1/class/cmake.mk to hold
these.

The cmake class defaults to passing $(CC) as CMAKE_C_COMPILER.
Unfortunately, CC defaults to cc and cdbs does nothing to fix that. I
propose that 1/class/langcore.mk changes CC and CXX such that if they
are still at their default values, it will go and substitute
triplet-prefixed versions. Note that for doing so, it should in
principle include 1/rules/buildvars.mk which sets up DEB_HOST_GNU_TYPE
(not done in patch). I wasn't sure whether that is ok, and didn't add
it in my patch. If it is, add the include and drop the "ifneq
($(DEB_HOST_GNU_TYPE),)".

When using the makefile class, it only sets up CC for cross compilation,
but CXX (and PKG_CONFIG) is often needed as well. It also doesn't honour
a user preference for CC.

I note that debhelper's makefile buildsystem doesn't pass CC and friends
via environment but via the make command line, because many Makefiles
set broken defaults (not covered in patch).

I also note that 1/rules/buildvars.mk wonders when to stop setting
DEB_{BUILD,HOST}_* variables. The correct answer is never, because we do
not mandate the use of dpkg-buildpackage. Building a package should
remain possible by invoking "./debian/rules binary". It would be far
better to just include /usr/share/dpkg/architecture.mk though (not
covered in patch).

Most of the issues listed above are addressed in the attached patch.
Aspects messing with includes aren't. Please consider it as a basis for
discussing cross improvements for cdbs and taking the parts that look
like immediate improvements.

Helmut
diff --minimal -Nru cdbs-0.4.148/1/class/cmake.mk.in 
cdbs-0.4.148+nmu1/1/class/cmake.mk.in
--- cdbs-0.4.148/1/class/cmake.mk.in    2016-06-10 12:36:00.000000000 +0200
+++ cdbs-0.4.148+nmu1/1/class/cmake.mk.in       2016-10-23 11:34:31.000000000 
+0200
@@ -29,9 +29,9 @@
 
 # FIXME: Restructure to allow early override (or lowercase the variable!)
 ifdef _cdbs_tarball_dir
-DEB_BUILDDIR = $(_cdbs_tarball_dir)/obj-$(DEB_BUILD_GNU_TYPE)
+DEB_BUILDDIR = $(_cdbs_tarball_dir)/obj-$(DEB_HOST_GNU_TYPE)
 else
-DEB_BUILDDIR = obj-$(DEB_BUILD_GNU_TYPE)
+DEB_BUILDDIR = obj-$(DEB_HOST_GNU_TYPE)
 endif
 
 # Overriden from makefile-vars.mk
@@ -41,6 +41,18 @@
 
 DEB_MAKE_INSTALL_TARGET ?= install DESTDIR=$(DEB_DESTDIR)
 
+ifneq (,$(cdbs_crossbuild))
+_system_name_map_linux = Linux
+_system_name_map_kfreebsd = FreeBSD
+_system_name_map_hurd = GNU
+ifneq (,$(_system_name_map_$(DEB_HOST_ARCH_OS)))
+DEB_CMAKE_CROSS_ARGS ?= \
+       -DCMAKE_SYSTEM_NAME=$(_system_name_map_$(DEB_HOST_ARCH_OS)) \
+       -DCMAKE_SYSTEM_PROCESSOR=$(DEB_HOST_GNU_CPU) \
+       -DPKG_CONFIG_EXECUTABLE=/usr/bin/$(DEB_HOST_GNU_TYPE)-pkg-config
+endif
+endif
+
 CMAKE ?= cmake
 DEB_CMAKE_INSTALL_PREFIX ?= /usr
 DEB_CMAKE_CFLAGS ?= $(CFLAGS) $(CPPFLAGS)
@@ -64,6 +76,7 @@
        $(strip cd $(DEB_BUILDDIR) && \
        $(CMAKE) $(CURDIR)/$(DEB_SRCDIR) \
                $(DEB_CMAKE_NORMAL_ARGS) \
+               $(DEB_CMAKE_CROSS_ARGS) \
                $(DEB_CMAKE_EXTRA_FLAGS))
 
 cleanbuilddir::
diff --minimal -Nru cdbs-0.4.148/1/class/langcore.mk.in 
cdbs-0.4.148+nmu1/1/class/langcore.mk.in
--- cdbs-0.4.148/1/class/langcore.mk.in 2016-06-10 12:36:00.000000000 +0200
+++ cdbs-0.4.148+nmu1/1/class/langcore.mk.in    2016-10-23 11:24:56.000000000 
+0200
@@ -43,6 +43,15 @@
 -include debian/_cdbs_buildflags.mk
 $(shell rm -f debian/_cdbs_buildflags.mk)
 
+ifneq ($(DEB_HOST_GNU_TYPE),)
+ifeq ($(origin CC),default)
+CC := $(DEB_HOST_GNU_TYPE)-gcc
+endif
+ifeq ($(origin CXX),default)
+CXX := $(DEB_HOST_GNU_TYPE)-g++
+endif
+endif
+
 ifneq (,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))
        DEB_PARALLEL_JOBS ?= $(patsubst parallel=%,%,$(filter 
parallel=%,$(DEB_BUILD_OPTIONS)))
 endif
diff --minimal -Nru cdbs-0.4.148/1/class/makefile-vars.mk.in 
cdbs-0.4.148+nmu1/1/class/makefile-vars.mk.in
--- cdbs-0.4.148/1/class/makefile-vars.mk.in    2016-06-10 12:36:00.000000000 
+0200
+++ cdbs-0.4.148+nmu1/1/class/makefile-vars.mk.in       2016-10-23 
11:19:43.000000000 +0200
@@ -25,7 +25,7 @@
 
 #DEB_MAKE_MAKEFILE =
 DEB_MAKE_ENVVARS ?= $(if $(cdbs_crossbuild),\
-       CC="$(DEB_HOST_GNU_TYPE)-gcc")
+       CC="$(CC)" CXX="$(CXX)" PKG_CONFIG="$(DEB_HOST_GNU_TYPE)-pkg-config")
 DEB_MAKE_PARALLEL ?= $(and $(DEB_BUILD_PARALLEL),$(DEB_PARALLEL_JOBS),\
        -j$(DEB_PARALLEL_JOBS))
 
diff --minimal -Nru cdbs-0.4.148/debian/changelog 
cdbs-0.4.148+nmu1/debian/changelog
--- cdbs-0.4.148/debian/changelog       2016-09-16 10:40:37.000000000 +0200
+++ cdbs-0.4.148+nmu1/debian/changelog  2016-10-23 11:13:08.000000000 +0200
@@ -1,3 +1,10 @@
+cdbs (0.4.148+nmu1) UNRELEASED; urgency=medium
+
+  * Non-maintainer upload.
+  * Improve cross compilation cmake and makefile classes. Closes: #-1.
+
+ -- Helmut Grohne <[email protected]>  Sun, 23 Oct 2016 11:00:44 +0200
+
 cdbs (0.4.148) unstable; urgency=medium
 
   * Fix license-miner.

--- End Message ---
--- Begin Message ---
Source: cdbs
Source-Version: 0.4.156

We believe that the bug you reported is fixed in the latest version of
cdbs, which is due to be installed in the Debian FTP archive.

A summary of the changes between this version and the previous one is
attached.

Thank you for reporting the bug, which will now be closed.  If you
have further comments please address them to [email protected],
and the maintainer will reopen the bug report if appropriate.

Debian distribution maintenance software
pp.
Jonas Smedegaard <[email protected]> (supplier of updated cdbs package)

(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing [email protected])


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA512

Format: 1.8
Date: Mon, 16 Oct 2017 21:25:50 +0200
Source: cdbs
Binary: cdbs
Architecture: source all
Version: 0.4.156
Distribution: unstable
Urgency: medium
Maintainer: CDBS Hackers <[email protected]>
Changed-By: Jonas Smedegaard <[email protected]>
Description:
 cdbs       - common build system for Debian packages
Closes: 841761
Changes:
 cdbs (0.4.156) unstable; urgency=medium
 .
   * Really fix conditionally set crossbuild compiler.
     Closes: Bug#841761. Thanks (again) to Helmut Grohne.
Checksums-Sha1:
 bdaeeab866a9ad2edfb4d4f7e5cf96c092d96576 1867 cdbs_0.4.156.dsc
 1352c87d48c9e654e98a16aa748a47878b39db40 204972 cdbs_0.4.156.tar.xz
 c327ef373daa6c193a0fa4965fec3480700a8c5d 83130 cdbs_0.4.156_all.deb
 3f4a1d85869ded50b37bd8c84bd95dca46806ae0 8060 cdbs_0.4.156_amd64.buildinfo
Checksums-Sha256:
 9675742656ad6cb6cce0ced0143ed644467332379f76d26319693f41d5663d0a 1867 
cdbs_0.4.156.dsc
 c4ff51234519a93feebeabd2069378a7f42506e477d278a4c079b270d39c0940 204972 
cdbs_0.4.156.tar.xz
 0b225b32679a6fc742c955193be67a16f292b1b05237eefc16040007ea5bc395 83130 
cdbs_0.4.156_all.deb
 d0359423e8a0ec356de0df420cf8459ee6d554331e8717ff895a4331788f9287 8060 
cdbs_0.4.156_amd64.buildinfo
Files:
 7d9416075dd15b531962011f842dc52c 1867 devel optional cdbs_0.4.156.dsc
 22a18e43763b4d705ba64b93d99da1d8 204972 devel optional cdbs_0.4.156.tar.xz
 a95a143a707ea9f558e5a0a13c39836e 83130 devel optional cdbs_0.4.156_all.deb
 1478950049d0d8f6972a6b5a23b37803 8060 devel optional 
cdbs_0.4.156_amd64.buildinfo

-----BEGIN PGP SIGNATURE-----

iQIzBAEBCgAdFiEEn+Ppw2aRpp/1PMaELHwxRsGgASEFAlnlCJoACgkQLHwxRsGg
ASFzLQ/9Ej6x0jQVFv4etdjLS6Iq45mDqtf1rLPv6+EzPmej7BWfUxLu3B8mzkWh
LHrxNXGOKl0cE39YNSojg4+J0CW7KzvX/MfSzLnOMBRqdY155fdlr7nJPM4uDINF
1C7GDFILkwxj7aZ94HeYyvs2R88CoFp0WF9+ncA3paM9tSMfzcLROkVG6WQpZY1N
8/vPQC50lUSLZ9Nw6Qo9iYUI8UxhBuL0mYrrQspmUJtgqrJ9yYdO/AbEWgA5B6Zy
XMAwSH7Muj7ym3J1NoVLFOHgkuRCjOrBclrHuk+UYFVAlqPelJSBXOi/HKuXmUct
QC/Am8PknuKRL2Fgz/+fFoWCTQ3VnMG0juCRbn+H8/EgbMfmDSUf5rR2hTWmLObY
kXwrF/UqhyB1tyll1XvuOUAzMLWFAqT9AF+Vo6SfpXDnpyblEYG9ZlG525U7b08T
5eWEj0KrksNwsUSKVHaAXk107PkOt5fPHs29A5SuXe1SAa560taoP4EvXtRfkjfk
Kj1GjhOmpNX1u6NtbMekq4cibNPuqLtNd0o4B4DWhRDpgTlC6x+vz2vz411Fbjpn
qOuPMmdBeyS5vdbU4/SHbb3GPF0IzkdfeKpOZNpjwdLWTpPjv2qr8oSZH4Sqi040
V8FgRV/5wOo+K7siQ7GUYgDn9aJOXkNf1vikcKLxILAhAirL3xE=
=WiCn
-----END PGP SIGNATURE-----

--- End Message ---

Reply via email to