Debian Bug report logs - #599206
"dpkg-cross: document file removal process

version graph

Package: dpkg-cross; Maintainer for dpkg-cross is Debian Embedded Group <debian-embedded@lists.debian.org>; Source for dpkg-cross is src:dpkg-cross.

Reported by: Marcin Juszkiewicz <marcin.juszkiewicz@linaro.org>

Date: Tue, 5 Oct 2010 16:15:02 UTC

Severity: wishlist

Found in version dpkg-cross/2.5.8

Fixed in version dpkg-cross/2.6.0

Done: Neil Williams <codehelp@debian.org>

Bug is archived. No further changes may be made.

Toggle useless messages

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to debian-bugs-dist@lists.debian.org, marcin.juszkiewicz@linaro.org, Debian Embedded Group <debian-embedded@lists.debian.org>:
Bug#599206; Package dpkg-cross. (Tue, 05 Oct 2010 16:15:05 GMT) Full text and rfc822 format available.

Acknowledgement sent to Marcin Juszkiewicz <marcin.juszkiewicz@linaro.org>:
New Bug report received and forwarded. Copy sent to marcin.juszkiewicz@linaro.org, Debian Embedded Group <debian-embedded@lists.debian.org>. (Tue, 05 Oct 2010 16:15:05 GMT) Full text and rfc822 format available.

Message #5 received at submit@bugs.debian.org (full text, mbox):

From: Marcin Juszkiewicz <marcin.juszkiewicz@linaro.org>
To: Debian Bug Tracking System <submit@bugs.debian.org>
Subject: dpkg-cross should leave files in converted package
Date: Tue, 05 Oct 2010 18:10:32 +0200
Package: dpkg-cross
Version: 2.5.8ubuntu2
Severity: important

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

dpkg-cross by default removes lot of files from converted packages.
Effect it that sqlite3 can not be cross built because
tcl8.5-dev-armel-cross package does not contain tclConfig.sh (which was
present in tcl8.5-dev_armel.deb).


- -- Package-specific info:

- -- /etc/dpkg-cross/cross-compile --

#
# /etc/dpkg-cross/cross-compile: configuration for dpkg-cross
#

# default architecture for dpkg-cross (to avoid always typing the -a option
# if you do cross installations only for one architecture)
# Note: default_arch is managed by debconf - it can be overridden
# if ~/.dpkg-cross/cross-compile exists or by specifying an
# architecture on the command line.
# Use '[sudo] dpkg-reconfigure dpkg-cross' to change this value.
#default_arch = 

# All subsequent variables may be removed (and/or become
# unsupported) at any time.

#
# general section: paths of cross compiling environment
#
# you can set the following variables here:
#  crossprefix: prefix for cross compiling binaries; default: $(DEB_HOST_GNU_SYSTEM)-
#  crossbase  : base prefix for the following; default: /usr
#  crossdir   : base directory for architecture; default:
#               $(CROSSBASE)/$(DEB_HOST_GNU_TYPE)
#  crossbin   : dir for binaries; default: $(CROSSDIR)/bin
#  crosslib   : dir for libraries; default: $(CROSSDIR)/lib
#  crossinc   : dir for headers; default: $(CROSSDIR)/include
#  maintainer : maintainer name to pass to original dpkg-buildpackage
#               in -m option. If not set at all, don't pass a -m, thus
#               dpkg-buildpackage will use the name from the changelog
#               file. If set to the special string CURRENTUSER,
#               dpkg-buildpackage will use the name from the
#               changelog, too, but signing the .changes will be done
#               as the current user (default key).
#  removedeps : comma-separated list of package names that should be removed
#               from depends/conflicts/etc fields
#  keepdeps   : comma-separated list of package names that should be kept
#               in depends/conflicts/etc fields as is, without adding
#               -arch-cross.
#
# In preparation for merging dpkg-cross into dpkg, the previous
# defaults have been removed.

- -- System Information:
Debian Release: squeeze/sid
  APT prefers maverick
  APT policy: (650, 'maverick')
Architecture: amd64 (x86_64)

Kernel: Linux 2.6.35-22-generic (SMP w/4 CPU cores)
Locale: LANG=pl_PL.UTF-8, LC_CTYPE=pl_PL.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/bash

Versions of packages dpkg-cross depends on:
ii  debconf [debconf-2.0]   1.5.32ubuntu3    Debian configuration management sy
ii  dpkg-dev                1.15.8.4ubuntu3  Debian package development tools
ii  libconfig-auto-perl     0.20-2           Magical config file parser
ii  libdebian-dpkgcross-per 2.5.8ubuntu2     functions to aid cross-compiling D
ii  perl                    5.10.1-12ubuntu2 Larry Wall's Practical Extraction 

Versions of packages dpkg-cross recommends:
ii  binutils-multi 2.20.51.20100908-0ubuntu2 Binary utilities that support mult
ii  fakeroot       1.14.4-1ubuntu1           Gives a fake root environment

dpkg-cross suggests no packages.

- -- debconf information:
  dpkg-cross/default-arch: None

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)

iEYEARECAAYFAkyrTfUACgkQeQ6MlGH/2qtrkgCfXZmV/jscTrL3rHKx43OVIBKR
rjgAnjizstIzWWN32uKFShY5z53A0y0m
=5xDq
-----END PGP SIGNATURE-----




Information forwarded to debian-bugs-dist@lists.debian.org, Debian Embedded Group <debian-embedded@lists.debian.org>:
Bug#599206; Package dpkg-cross. (Tue, 05 Oct 2010 16:45:03 GMT) Full text and rfc822 format available.

Acknowledgement sent to Neil Williams <codehelp@debian.org>:
Extra info received and forwarded to list. Copy sent to Debian Embedded Group <debian-embedded@lists.debian.org>. (Tue, 05 Oct 2010 16:45:03 GMT) Full text and rfc822 format available.

Message #10 received at 599206@bugs.debian.org (full text, mbox):

From: Neil Williams <codehelp@debian.org>
To: Marcin Juszkiewicz <marcin.juszkiewicz@linaro.org>, 599206@bugs.debian.org
Cc: control@bugs.debian.org
Subject: Re: Bug#599206: dpkg-cross should leave files in converted package
Date: Tue, 5 Oct 2010 17:41:30 +0100
[Message part 1 (text/plain, inline)]
notfound 599206 2.5.8ubuntu2
found 599206 2.5.8
severity 599206 wishlist
retitle 599206 "dpkg-cross: document file removal process
quit

On Tue, 05 Oct 2010 18:10:32 +0200
Marcin Juszkiewicz <marcin.juszkiewicz@linaro.org> wrote:

> Package: dpkg-cross
> Version: 2.5.8ubuntu2

Wrong version - please report this in Launchpad only or reproduce in
Debian before filing the bug.

However, the "bug" as described is a result of how the code is
designed to work in both Debian and Ubuntu.

> dpkg-cross by default removes lot of files from converted packages.

This is to prevent file conflicts with the original package.

i.e. if you need files from a package which are removed from the cross
package by dpkg-cross, you need to ensure that the native version of
that package is installed.

dpkg-cross only cares about specific files types in the -cross package
- typically files which are architecture-dependent and which are
easily identifiable as such.

> Effect it that sqlite3 can not be cross built because
> tcl8.5-dev-armel-cross package does not contain tclConfig.sh (which was
> present in tcl8.5-dev_armel.deb).

So install tcl8.5-dev_amd64.deb and tcl8.5-dev-armel-cross.

This script is a "build-tool", it is not a "cross-build-dependency" in
that it is not a header file, it is not a pkg-config file and it is not
used when linking the cross built application. The file is therefore
not architecture-dependent and cannot be handled by dpkg-cross.

Retitling this as a documentation bug so that the manpage is clearer on
what dpkg-cross can and cannot be expected to perform.

If having the amd64 package around causes trouble, discuss with the tcl
maintainers whether the script can be put into a -dev-common package
or whether some more standard tool like pkg-config can be used instead.

This is a recurring problem in cross-building. dpkg-cross cannot leave
these files in place or the -cross package won't install. In an ideal
world, it would be nice if cross builds had a completely clean build
environment without native build-deps but that is not reality. Many
packages have architecture-independent support scripts which behave no
differently whether the build is native or cross. There is nothing
dpkg-cross can do about this except explain it in the manpage.

If the script doesn't generate the correct config when cross-building,
file a bug with Tcl to get the script to accept a parameter which can
be handled in the cross build. Simply moving the script to somewhere
under /usr/lib/arm-linux-gnueabi/ is not going to help you.

-- 


Neil Williams
=============
http://www.data-freedom.org/
http://www.linux.codehelp.co.uk/
http://e-mail.is-not-s.ms/

[Message part 2 (application/pgp-signature, inline)]

Bug No longer marked as found in versions 2.5.8ubuntu2. Request was from Neil Williams <codehelp@debian.org> to control@bugs.debian.org. (Tue, 05 Oct 2010 16:45:04 GMT) Full text and rfc822 format available.

Bug Marked as found in versions dpkg-cross/2.5.8. Request was from Neil Williams <codehelp@debian.org> to control@bugs.debian.org. (Tue, 05 Oct 2010 16:45:05 GMT) Full text and rfc822 format available.

Severity set to 'wishlist' from 'important' Request was from Neil Williams <codehelp@debian.org> to control@bugs.debian.org. (Tue, 05 Oct 2010 16:45:06 GMT) Full text and rfc822 format available.

Changed Bug title to '"dpkg-cross: document file removal process' from 'dpkg-cross should leave files in converted package' Request was from Neil Williams <codehelp@debian.org> to control@bugs.debian.org. (Tue, 05 Oct 2010 16:45:06 GMT) Full text and rfc822 format available.

Information forwarded to debian-bugs-dist@lists.debian.org, Debian Embedded Group <debian-embedded@lists.debian.org>:
Bug#599206; Package dpkg-cross. (Wed, 06 Oct 2010 07:18:03 GMT) Full text and rfc822 format available.

Acknowledgement sent to Goswin von Brederlow <goswin-v-b@web.de>:
Extra info received and forwarded to list. Copy sent to Debian Embedded Group <debian-embedded@lists.debian.org>. (Wed, 06 Oct 2010 07:18:03 GMT) Full text and rfc822 format available.

Message #23 received at 599206@bugs.debian.org (full text, mbox):

From: Goswin von Brederlow <goswin-v-b@web.de>
To: Neil Williams <codehelp@debian.org>
Cc: 599206@bugs.debian.org
Subject: Re: Bug#599206: dpkg-cross should leave files in converted package
Date: Wed, 06 Oct 2010 09:14:28 +0200
Neil Williams <codehelp@debian.org> writes:

> notfound 599206 2.5.8ubuntu2
> found 599206 2.5.8
> severity 599206 wishlist
> retitle 599206 "dpkg-cross: document file removal process
> quit
>
> On Tue, 05 Oct 2010 18:10:32 +0200
> Marcin Juszkiewicz <marcin.juszkiewicz@linaro.org> wrote:
>
>> Package: dpkg-cross
>> Version: 2.5.8ubuntu2
>
> Wrong version - please report this in Launchpad only or reproduce in
> Debian before filing the bug.
>
> However, the "bug" as described is a result of how the code is
> designed to work in both Debian and Ubuntu.
>
>> dpkg-cross by default removes lot of files from converted packages.
>
> This is to prevent file conflicts with the original package.
>
> i.e. if you need files from a package which are removed from the cross
> package by dpkg-cross, you need to ensure that the native version of
> that package is installed.
>
> dpkg-cross only cares about specific files types in the -cross package
> - typically files which are architecture-dependent and which are
> easily identifiable as such.

I should care about the copyright and changelogs though. A dpkg-cross
converted package is undistributable because of that.

MfG
        Goswin




Information forwarded to debian-bugs-dist@lists.debian.org, Debian Embedded Group <debian-embedded@lists.debian.org>:
Bug#599206; Package dpkg-cross. (Wed, 06 Oct 2010 09:12:47 GMT) Full text and rfc822 format available.

Acknowledgement sent to Neil Williams <codehelp@debian.org>:
Extra info received and forwarded to list. Copy sent to Debian Embedded Group <debian-embedded@lists.debian.org>. (Wed, 06 Oct 2010 09:12:47 GMT) Full text and rfc822 format available.

Message #28 received at 599206@bugs.debian.org (full text, mbox):

From: Neil Williams <codehelp@debian.org>
To: Goswin von Brederlow <goswin-v-b@web.de>
Cc: 599206@bugs.debian.org
Subject: Re: Bug#599206: dpkg-cross should leave files in converted package
Date: Wed, 6 Oct 2010 09:04:48 +0100
[Message part 1 (text/plain, inline)]
On Wed, 06 Oct 2010 09:14:28 +0200
Goswin von Brederlow <goswin-v-b@web.de> wrote:

> > dpkg-cross only cares about specific files types in the -cross package
> > - typically files which are architecture-dependent and which are
> > easily identifiable as such.
> 
> I should care about the copyright and changelogs though. A dpkg-cross
> converted package is undistributable because of that.

-cross packages are not meant to be distributed - they are local
conversions of standard packages. Emdebian Grip packages retain
copyright but not changelog.

-- 


Neil Williams
=============
http://www.data-freedom.org/
http://www.linux.codehelp.co.uk/
http://e-mail.is-not-s.ms/

[Message part 2 (application/pgp-signature, inline)]

Information forwarded to debian-bugs-dist@lists.debian.org, Debian Embedded Group <debian-embedded@lists.debian.org>:
Bug#599206; Package dpkg-cross. (Wed, 06 Oct 2010 11:24:04 GMT) Full text and rfc822 format available.

Acknowledgement sent to Loïc Minier <loic.minier@linaro.org>:
Extra info received and forwarded to list. Copy sent to Debian Embedded Group <debian-embedded@lists.debian.org>. (Wed, 06 Oct 2010 11:24:04 GMT) Full text and rfc822 format available.

Message #33 received at 599206@bugs.debian.org (full text, mbox):

From: Loïc Minier <loic.minier@linaro.org>
To: Neil Williams <codehelp@debian.org>, 599206@bugs.debian.org
Cc: Marcin Juszkiewicz <marcin.juszkiewicz@linaro.org>, control@bugs.debian.org
Subject: Re: Bug#599206: dpkg-cross should leave files in converted package
Date: Wed, 6 Oct 2010 13:22:08 +0200
On Tue, Oct 05, 2010, Neil Williams wrote:
> This script is a "build-tool", it is not a "cross-build-dependency" in
> that it is not a header file, it is not a pkg-config file and it is not
> used when linking the cross built application. The file is therefore
> not architecture-dependent and cannot be handled by dpkg-cross.

 It is a build tool, but it's specific to the target architecture

 The fact that it's not a header, not a pkg-config file, and not used
 when linking cross built applications doesn't imply that it is
 architecture independent.

 I diffed tclConfig.sh on armel and amd64:
@@ -18,10 +18,10 @@ TCL_MINOR_VERSION='5'
        TCL_PATCH_LEVEL='.8'
        
        # C compiler to use for compilation.
-       TCL_CC='x86_64-linux-gnu-gcc'
+       TCL_CC='arm-linux-gnueabi-gcc'
        
        # -D flags for use with the C compiler.
-       TCL_DEFS='-DPACKAGE_NAME=\"tcl\" -DPACKAGE_TARNAME=\"tcl\" -DPACKAGE_VERSION=\"8.5\" -DPACKAGE_STRING=\"tcl\ 8.5\" -DPACKAGE_BUGREPORT=\"\" -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DHAVE_LIMITS_H=1 -DHAVE_SYS_PARAM_H=1 -DUSE_THREAD_ALLOC=1 -D_REENTRANT=1 -D_THREAD_SAFE=1 -DHAVE_PTHREAD_ATTR_SETSTACKSIZE=1 -DHAVE_PTHREAD_GETATTR_NP=1 -DGETATTRNP_NOT_DECLARED=1 -DTCL_THREADS=1 -DTCL_CFGVAL_ENCODING=\"iso8859-1\" -DMODULE_SCOPE=extern\ __attribute__\(\(__visibility__\(\"hidden\"\)\)\) -DTCL_SHLIB_EXT=\".so\" -DTCL_CFG_OPTIMIZED=1 -DTCL_CFG_DEBUG=1 -DTCL_TOMMATH=1 -DMP_PREC=4 -D_LARGEFILE64_SOURCE=1 -DTCL_WIDE_INT_IS_LONG=1 -DHAVE_GETCWD=1 -DHAVE_OPENDIR=1 -DHAVE_STRTOL=1 -DHAVE_WAITPID=1 -DHAVE_GETADDRINFO=1 -DHAVE_GETPWUID_R_5=1 -DHAVE_GETPWUID_R=1 -DHAVE_GETPWNAM_R_5=1 -DHAVE_GETPWNAM_R=1 -DHAVE_GETGRGID_R_5=1 -DHAVE_GETGRGID_R=1 -DHAVE_GETGRNAM_R_5=1 -DHAVE_GETGRNAM_R=1 -DHAVE_GETHOSTBYNAME_R_6=1 -DHAVE_GETHOSTBYNAME_R=1 -DHAVE_GETHOSTBYADDR_R_8=1 -DHAVE_GETHOSTBYADDR_R=1 -DUSE_TERMIOS=1 -DHAVE_SYS_TIME_H=1 -DTIME_WITH_SYS_TIME=1 -DHAVE_STRUCT_TM_TM_ZONE=1 -DHAVE_TM_ZONE=1 -DHAVE_GMTIME_R=1 -DHAVE_LOCALTIME_R=1 -DHAVE_MKTIME=1 -DHAVE_TM_GMTOFF=1 -DHAVE_TIMEZONE_VAR=1 -DHAVE_STRUCT_STAT_ST_BLKSIZE=1 -DHAVE_ST_BLKSIZE=1 -DHAVE_INTPTR_T=1 -DHAVE_UINTPTR_T=1 -DHAVE_SIGNED_CHAR=1 -DHAVE_LANGINFO=1 -DHAVE_SYS_IOCTL_H=1 -DTCL_UNLOAD_DLLS=1 '
+       TCL_DEFS='-DPACKAGE_NAME=\"tcl\" -DPACKAGE_TARNAME=\"tcl\" -DPACKAGE_VERSION=\"8.5\" -DPACKAGE_STRING=\"tcl\ 8.5\" -DPACKAGE_BUGREPORT=\"\" -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DHAVE_LIMITS_H=1 -DHAVE_SYS_PARAM_H=1 -DUSE_THREAD_ALLOC=1 -D_REENTRANT=1 -D_THREAD_SAFE=1 -DHAVE_PTHREAD_ATTR_SETSTACKSIZE=1 -DHAVE_PTHREAD_GETATTR_NP=1 -DGETATTRNP_NOT_DECLARED=1 -DTCL_THREADS=1 -DTCL_CFGVAL_ENCODING=\"iso8859-1\" -DMODULE_SCOPE=extern\ __attribute__\(\(__visibility__\(\"hidden\"\)\)\) -DTCL_SHLIB_EXT=\".so\" -DTCL_CFG_OPTIMIZED=1 -DTCL_CFG_DEBUG=1 -DTCL_TOMMATH=1 -DMP_PREC=4 -D_LARGEFILE64_SOURCE=1 -DTCL_WIDE_INT_TYPE=long\ long -DHAVE_STRUCT_STAT64=1 -DHAVE_OPEN64=1 -DHAVE_LSEEK64=1 -DHAVE_TYPE_OFF64_T=1 -DHAVE_GETCWD=1 -DHAVE_OPENDIR=1 -DHAVE_STRTOL=1 -DHAVE_WAITPID=1 -DHAVE_GETADDRINFO=1 -DHAVE_GETPWUID_R_5=1 -DHAVE_GETPWUID_R=1 -DHAVE_GETPWNAM_R_5=1 -DHAVE_GETPWNAM_R=1 -DHAVE_GETGRGID_R_5=1 -DHAVE_GETGRGID_R=1 -DHAVE_GETGRNAM_R_5=1 -DHAVE_GETGRNAM_R=1 -DHAVE_GETHOSTBYNAME_R_6=1 -DHAVE_GETHOSTBYNAME_R=1 -DHAVE_GETHOSTBYADDR_R_8=1 -DHAVE_GETHOSTBYADDR_R=1 -DUSE_TERMIOS=1 -DHAVE_SYS_TIME_H=1 -DTIME_WITH_SYS_TIME=1 -DHAVE_STRUCT_TM_TM_ZONE=1 -DHAVE_TM_ZONE=1 -DHAVE_GMTIME_R=1 -DHAVE_LOCALTIME_R=1 -DHAVE_MKTIME=1 -DHAVE_TM_GMTOFF=1 -DHAVE_TIMEZONE_VAR=1 -DHAVE_STRUCT_STAT_ST_BLKSIZE=1 -DHAVE_ST_BLKSIZE=1 -DHAVE_INTPTR_T=1 -DHAVE_UINTPTR_T=1 -DHAVE_SIGNED_CHAR=1 -DHAVE_LANGINFO=1 -DHAVE_SYS_IOCTL_H=1 -DTCL_UNLOAD_DLLS=1 '
        
        # TCL_DBGX used to be used to distinguish debug vs. non-debug builds.
        # This was a righteous pain so the core doesn't do that any more.

 BTW in /usr/lib is actually a good indication that it might be
 arch-specific IMHO (by opposition to /usr/share where it must be
 arch-independent).

 Being in a subdir of usr/lib (usr/lib/tcl8.5) makes it less obvious
 that it's relevant for the crossed package since it might look like a
 plugin directory.

> If having the amd64 package around causes trouble, discuss with the tcl
> maintainers whether the script can be put into a -dev-common package
> or whether some more standard tool like pkg-config can be used instead.

 Not an option here since the script does differ across architectures.

> This is a recurring problem in cross-building. dpkg-cross cannot leave
> these files in place or the -cross package won't install. In an ideal
> world, it would be nice if cross builds had a completely clean build
> environment without native build-deps but that is not reality. Many
> packages have architecture-independent support scripts which behave no
> differently whether the build is native or cross. There is nothing
> dpkg-cross can do about this except explain it in the manpage.

 Not an architecture-independent support script here.

 Being a shell script also doesn't make it a native script; it can be
 used for both cross and native builds.

> If the script doesn't generate the correct config when cross-building,
> file a bug with Tcl to get the script to accept a parameter which can
> be handled in the cross build. Simply moving the script to somewhere
> under /usr/lib/arm-linux-gnueabi/ is not going to help you.

 The data will be different depending on the output of tcl's
 configuration script, so it would be a maintenance nightmare to try to
 maintain the output of the configuration script in a single tool
 supporting all possible arches.

 The two ways I see this getting fixed:
a) (preferred) get dpkg-cross to output a
   /usr/share/arm-linux-gnueabi/tcl8.5/tclConfig.sh and change tcl-based
   builds to look for that one when cross-building
b) change tcl to output a tcl-cross-config-armel or similar package
   containing just the above (very ugly IMHO); this would essentially be
   like providing a cross-compiler except it's a cross-tcl-configuration
   tool; it's very intrusive for the tcl packaging though


 Now I bet Neil would be unhappy to have some specific tcl bits
 hardcoded in dpkg-cross, which would be fair enough.
   @Neil: what would you think of providing some kind of extension
 mechanism for these files in packages?  e.g. dpkg-cross would run
 /etc/dpkg-cross/hooks.d/*.pl and tcl8.5-dev would provide one, or
 something similar?

   Cheers
-- 
Loïc Minier




Information forwarded to debian-bugs-dist@lists.debian.org, Debian Embedded Group <debian-embedded@lists.debian.org>:
Bug#599206; Package dpkg-cross. (Wed, 06 Oct 2010 11:45:03 GMT) Full text and rfc822 format available.

Acknowledgement sent to Goswin von Brederlow <goswin-v-b@web.de>:
Extra info received and forwarded to list. Copy sent to Debian Embedded Group <debian-embedded@lists.debian.org>. (Wed, 06 Oct 2010 11:45:03 GMT) Full text and rfc822 format available.

Message #38 received at 599206@bugs.debian.org (full text, mbox):

From: Goswin von Brederlow <goswin-v-b@web.de>
To: Loïc Minier <loic.minier@linaro.org>
Cc: 599206@bugs.debian.org, Neil Williams <codehelp@debian.org>, Marcin Juszkiewicz <marcin.juszkiewicz@linaro.org>, control@bugs.debian.org
Subject: Re: Bug#599206: dpkg-cross should leave files in converted package
Date: Wed, 06 Oct 2010 13:43:56 +0200
Loïc Minier <loic.minier@linaro.org> writes:

> On Tue, Oct 05, 2010, Neil Williams wrote:
>> This script is a "build-tool", it is not a "cross-build-dependency" in
>> that it is not a header file, it is not a pkg-config file and it is not
>> used when linking the cross built application. The file is therefore
>> not architecture-dependent and cannot be handled by dpkg-cross.
>
>  It is a build tool, but it's specific to the target architecture
>
>  The fact that it's not a header, not a pkg-config file, and not used
>  when linking cross built applications doesn't imply that it is
>  architecture independent.
>
>  I diffed tclConfig.sh on armel and amd64:
> @@ -18,10 +18,10 @@ TCL_MINOR_VERSION='5'
>         TCL_PATCH_LEVEL='.8'
>         
>         # C compiler to use for compilation.
> -       TCL_CC='x86_64-linux-gnu-gcc'
> +       TCL_CC='arm-linux-gnueabi-gcc'
>         
>         # -D flags for use with the C compiler.
> -       TCL_DEFS='-DPACKAGE_NAME=\"tcl\" -DPACKAGE_TARNAME=\"tcl\" -DPACKAGE_VERSION=\"8.5\" -DPACKAGE_STRING=\"tcl\ 8.5\" -DPACKAGE_BUGREPORT=\"\" -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DHAVE_LIMITS_H=1 -DHAVE_SYS_PARAM_H=1 -DUSE_THREAD_ALLOC=1 -D_REENTRANT=1 -D_THREAD_SAFE=1 -DHAVE_PTHREAD_ATTR_SETSTACKSIZE=1 -DHAVE_PTHREAD_GETATTR_NP=1 -DGETATTRNP_NOT_DECLARED=1 -DTCL_THREADS=1 -DTCL_CFGVAL_ENCODING=\"iso8859-1\" -DMODULE_SCOPE=extern\ __attribute__\(\(__visibility__\(\"hidden\"\)\)\) -DTCL_SHLIB_EXT=\".so\" -DTCL_CFG_OPTIMIZED=1 -DTCL_CFG_DEBUG=1 -DTCL_TOMMATH=1 -DMP_PREC=4 -D_LARGEFILE64_SOURCE=1 -DTCL_WIDE_INT_IS_LONG=1 -DHAVE_GETCWD=1 -DHAVE_OPENDIR=1 -DHAVE_STRTOL=1 -DHAVE_WAITPID=1 -DHAVE_GETADDRINFO=1 -DHAVE_GETPWUID_R_5=1 -DHAVE_GETPWUID_R=1 -DHAVE_GETPWNAM_R_5=1 -DHAVE_GETPWNAM_R=1 -DHAVE_GETGRGID_R_5=1 -DHAVE_GETGRGID_R=1 -DHAVE_GETGRNAM_R_5=1 -DHAVE_GETGRNAM_R=1 -DHAVE_GETHOSTBYNAME_R_6=1 -DHAVE_GETHOSTBYNAME_R=1 -DHAVE_GETHOSTBYADDR_R_8=1 -DHAVE_GETHOSTBYADDR_R=1 -DUSE_TERMIOS=1 -DHAVE_SYS_TIME_H=1 -DTIME_WITH_SYS_TIME=1 -DHAVE_STRUCT_TM_TM_ZONE=1 -DHAVE_TM_ZONE=1 -DHAVE_GMTIME_R=1 -DHAVE_LOCALTIME_R=1 -DHAVE_MKTIME=1 -DHAVE_TM_GMTOFF=1 -DHAVE_TIMEZONE_VAR=1 -DHAVE_STRUCT_STAT_ST_BLKSIZE=1 -DHAVE_ST_BLKSIZE=1 -DHAVE_INTPTR_T=1 -DHAVE_UINTPTR_T=1 -DHAVE_SIGNED_CHAR=1 -DHAVE_LANGINFO=1 -DHAVE_SYS_IOCTL_H=1 -DTCL_UNLOAD_DLLS=1 '
> +       TCL_DEFS='-DPACKAGE_NAME=\"tcl\" -DPACKAGE_TARNAME=\"tcl\" -DPACKAGE_VERSION=\"8.5\" -DPACKAGE_STRING=\"tcl\ 8.5\" -DPACKAGE_BUGREPORT=\"\" -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DHAVE_LIMITS_H=1 -DHAVE_SYS_PARAM_H=1 -DUSE_THREAD_ALLOC=1 -D_REENTRANT=1 -D_THREAD_SAFE=1 -DHAVE_PTHREAD_ATTR_SETSTACKSIZE=1 -DHAVE_PTHREAD_GETATTR_NP=1 -DGETATTRNP_NOT_DECLARED=1 -DTCL_THREADS=1 -DTCL_CFGVAL_ENCODING=\"iso8859-1\" -DMODULE_SCOPE=extern\ __attribute__\(\(__visibility__\(\"hidden\"\)\)\) -DTCL_SHLIB_EXT=\".so\" -DTCL_CFG_OPTIMIZED=1 -DTCL_CFG_DEBUG=1 -DTCL_TOMMATH=1 -DMP_PREC=4 -D_LARGEFILE64_SOURCE=1 -DTCL_WIDE_INT_TYPE=long\ long -DHAVE_STRUCT_STAT64=1 -DHAVE_OPEN64=1 -DHAVE_LSEEK64=1 -DHAVE_TYPE_OFF64_T=1 -DHAVE_GETCWD=1 -DHAVE_OPENDIR=1 -DHAVE_STRTOL=1 -DHAVE_WAITPID=1 -DHAVE_GETADDRINFO=1 -DHAVE_GETPWUID_R_5=1 -DHAVE_GETPWUID_R=1 -DHAVE_GETPWNAM_R_5=1 -DHAVE_GETPWNAM_R=1 -DHAVE_GETGRGID_R_5=1 -DHAVE_GETGRGID_R=1 -DHAVE_GETGRNAM_R_5=1 -DHAVE_GETGRNAM_R=1 -DHAVE_GETHOSTBYNAME_R_6=1 -DHAVE_GETHOSTBYNAME_R=1 -DHAVE_GETHOSTBYADDR_R_8=1 -DHAVE_GETHOSTBYADDR_R=1 -DUSE_TERMIOS=1 -DHAVE_SYS_TIME_H=1 -DTIME_WITH_SYS_TIME=1 -DHAVE_STRUCT_TM_TM_ZONE=1 -DHAVE_TM_ZONE=1 -DHAVE_GMTIME_R=1 -DHAVE_LOCALTIME_R=1 -DHAVE_MKTIME=1 -DHAVE_TM_GMTOFF=1 -DHAVE_TIMEZONE_VAR=1 -DHAVE_STRUCT_STAT_ST_BLKSIZE=1 -DHAVE_ST_BLKSIZE=1 -DHAVE_INTPTR_T=1 -DHAVE_UINTPTR_T=1 -DHAVE_SIGNED_CHAR=1 -DHAVE_LANGINFO=1 -DHAVE_SYS_IOCTL_H=1 -DTCL_UNLOAD_DLLS=1 '
>         
>         # TCL_DBGX used to be used to distinguish debug vs. non-debug builds.
>         # This was a righteous pain so the core doesn't do that any more.
>
>  BTW in /usr/lib is actually a good indication that it might be
>  arch-specific IMHO (by opposition to /usr/share where it must be
>  arch-independent).
>
>  Being in a subdir of usr/lib (usr/lib/tcl8.5) makes it less obvious
>  that it's relevant for the crossed package since it might look like a
>  plugin directory.
>
>> If having the amd64 package around causes trouble, discuss with the tcl
>> maintainers whether the script can be put into a -dev-common package
>> or whether some more standard tool like pkg-config can be used instead.
>
>  Not an option here since the script does differ across architectures.
>
>> This is a recurring problem in cross-building. dpkg-cross cannot leave
>> these files in place or the -cross package won't install. In an ideal
>> world, it would be nice if cross builds had a completely clean build
>> environment without native build-deps but that is not reality. Many
>> packages have architecture-independent support scripts which behave no
>> differently whether the build is native or cross. There is nothing
>> dpkg-cross can do about this except explain it in the manpage.
>
>  Not an architecture-independent support script here.
>
>  Being a shell script also doesn't make it a native script; it can be
>  used for both cross and native builds.
>
>> If the script doesn't generate the correct config when cross-building,
>> file a bug with Tcl to get the script to accept a parameter which can
>> be handled in the cross build. Simply moving the script to somewhere
>> under /usr/lib/arm-linux-gnueabi/ is not going to help you.
>
>  The data will be different depending on the output of tcl's
>  configuration script, so it would be a maintenance nightmare to try to
>  maintain the output of the configuration script in a single tool
>  supporting all possible arches.

Create a wrapper script that defaults to the natgive arch but accepts an
arch triplet as argumen, like:

cat >tclConfig.sh <<EOF
#!/bin/sh

ARCH=${1:$(DEB_HOST_GNU_TYPE)}

exec /usr/lib/$ARCH/tcl8.5/$0
EOF

and move the real script(s) to the multiarch dir.

>  The two ways I see this getting fixed:
> a) (preferred) get dpkg-cross to output a
>    /usr/share/arm-linux-gnueabi/tcl8.5/tclConfig.sh and change tcl-based
>    builds to look for that one when cross-building
> b) change tcl to output a tcl-cross-config-armel or similar package
>    containing just the above (very ugly IMHO); this would essentially be
>    like providing a cross-compiler except it's a cross-tcl-configuration
>    tool; it's very intrusive for the tcl packaging though
>
>
>  Now I bet Neil would be unhappy to have some specific tcl bits
>  hardcoded in dpkg-cross, which would be fair enough.
>    @Neil: what would you think of providing some kind of extension
>  mechanism for these files in packages?  e.g. dpkg-cross would run
>  /etc/dpkg-cross/hooks.d/*.pl and tcl8.5-dev would provide one, or
>  something similar?
>
>    Cheers

MfG
        Goswin




Information forwarded to debian-bugs-dist@lists.debian.org, Debian Embedded Group <debian-embedded@lists.debian.org>:
Bug#599206; Package dpkg-cross. (Wed, 06 Oct 2010 12:33:07 GMT) Full text and rfc822 format available.

Acknowledgement sent to Loïc Minier <loic.minier@linaro.org>:
Extra info received and forwarded to list. Copy sent to Debian Embedded Group <debian-embedded@lists.debian.org>. (Wed, 06 Oct 2010 12:33:07 GMT) Full text and rfc822 format available.

Message #43 received at 599206@bugs.debian.org (full text, mbox):

From: Loïc Minier <loic.minier@linaro.org>
To: Goswin von Brederlow <goswin-v-b@web.de>
Cc: 599206@bugs.debian.org, Neil Williams <codehelp@debian.org>, Marcin Juszkiewicz <marcin.juszkiewicz@linaro.org>, control@bugs.debian.org
Subject: Re: Bug#599206: dpkg-cross should leave files in converted package
Date: Wed, 6 Oct 2010 14:31:13 +0200
On Wed, Oct 06, 2010, Goswin von Brederlow wrote:
> Create a wrapper script that defaults to the natgive arch but accepts an
> arch triplet as argumen, like:
> 
> cat >tclConfig.sh <<EOF
> #!/bin/sh
> 
> ARCH=${1:$(DEB_HOST_GNU_TYPE)}
> 
> exec /usr/lib/$ARCH/tcl8.5/$0
> EOF

 Yup, that's fair; I would use /usr/share/$triplet, but it's alright.

 Does dpkg-cross preserve pathnames below /usr/share/$triplet or
 /usr/lib/$triplet though?  Since we don't have multiarch, we do need to
 dpkg-cross this, and that's why Marcin is trying to dpkg-cross
 tcl8.5-dev.

-- 
Loïc Minier




Information forwarded to debian-bugs-dist@lists.debian.org, Debian Embedded Group <debian-embedded@lists.debian.org>:
Bug#599206; Package dpkg-cross. (Wed, 06 Oct 2010 12:45:03 GMT) Full text and rfc822 format available.

Acknowledgement sent to Neil Williams <codehelp@debian.org>:
Extra info received and forwarded to list. Copy sent to Debian Embedded Group <debian-embedded@lists.debian.org>. (Wed, 06 Oct 2010 12:45:03 GMT) Full text and rfc822 format available.

Message #48 received at 599206@bugs.debian.org (full text, mbox):

From: Neil Williams <codehelp@debian.org>
To: Loïc Minier <loic.minier@linaro.org>
Cc: 599206@bugs.debian.org
Subject: Re: Bug#599206: dpkg-cross should leave files in converted package
Date: Wed, 6 Oct 2010 13:42:42 +0100
[Message part 1 (text/plain, inline)]
On Wed, 6 Oct 2010 14:31:13 +0200
Loïc Minier <loic.minier@linaro.org> wrote:

> On Wed, Oct 06, 2010, Goswin von Brederlow wrote:
> > Create a wrapper script that defaults to the natgive arch but accepts an
> > arch triplet as argumen, like:
> > 
> > cat >tclConfig.sh <<EOF
> > #!/bin/sh
> > 
> > ARCH=${1:$(DEB_HOST_GNU_TYPE)}
> > 
> > exec /usr/lib/$ARCH/tcl8.5/$0
> > EOF
> 
>  Yup, that's fair; I would use /usr/share/$triplet, but it's alright.

First you have to check whether the script itself uses relative or
absolute paths, otherwise you will actually need a whole new script.
Scripts in /usr/share/ are usually not aware of the changes needed to
allow for cross-configuration.
 
>  Does dpkg-cross preserve pathnames below /usr/share/$triplet or
>  /usr/lib/$triplet though? 

No. /usr/lib/ and /usr/include only. /usr/share/ is *meant* to be
architecture-independent.

> Since we don't have multiarch, we do need to
>  dpkg-cross this, and that's why Marcin is trying to dpkg-cross
>  tcl8.5-dev.

dpkg-cross is not a one-stop solution for the support of cross-building
for all packages in Debian. Some packages simply need specialised
wrappers and/or upstream changes/patches. dpkg-cross exists for
common-case solutions based around cross-compilation, not every single
broken package.

-- 


Neil Williams
=============
http://www.data-freedom.org/
http://www.linux.codehelp.co.uk/
http://e-mail.is-not-s.ms/

[Message part 2 (application/pgp-signature, inline)]

Information forwarded to debian-bugs-dist@lists.debian.org, Debian Embedded Group <debian-embedded@lists.debian.org>:
Bug#599206; Package dpkg-cross. (Wed, 06 Oct 2010 13:03:15 GMT) Full text and rfc822 format available.

Acknowledgement sent to Neil Williams <codehelp@debian.org>:
Extra info received and forwarded to list. Copy sent to Debian Embedded Group <debian-embedded@lists.debian.org>. (Wed, 06 Oct 2010 13:03:15 GMT) Full text and rfc822 format available.

Message #53 received at 599206@bugs.debian.org (full text, mbox):

From: Neil Williams <codehelp@debian.org>
To: Loïc Minier <loic.minier@linaro.org>
Cc: 599206@bugs.debian.org, Marcin Juszkiewicz <marcin.juszkiewicz@linaro.org>
Subject: Re: Bug#599206: dpkg-cross should leave files in converted package
Date: Wed, 6 Oct 2010 14:00:19 +0100
[Message part 1 (text/plain, inline)]
On Wed, 6 Oct 2010 13:22:08 +0200
Loïc Minier <loic.minier@linaro.org> wrote:

> On Tue, Oct 05, 2010, Neil Williams wrote:
> > This script is a "build-tool", it is not a "cross-build-dependency" in
> > that it is not a header file, it is not a pkg-config file and it is not
> > used when linking the cross built application. The file is therefore
> > not architecture-dependent and cannot be handled by dpkg-cross.
> 
>  It is a build tool, but it's specific to the target architecture

Non-standard build configuration - you'll need to discuss with upstream
just how this is meant to support cross-compilation. Probably just have
to patch the source to make this script truly cross-platform by having
all the variables defined and selecting according to the
dpkg-architecture environment variables.

>  The fact that it's not a header, not a pkg-config file, and not used
>  when linking cross built applications doesn't imply that it is
>  architecture independent.

So ask upstream to migrate to pkg-config or adapt their script to be
cross-architecture?
 
>  I diffed tclConfig.sh on armel and amd64:
> @@ -18,10 +18,10 @@ TCL_MINOR_VERSION='5'
>         TCL_PATCH_LEVEL='.8'
>         
>         # C compiler to use for compilation.
> -       TCL_CC='x86_64-linux-gnu-gcc'
> +       TCL_CC='arm-linux-gnueabi-gcc'
>         
>         # -D flags for use with the C compiler.
> -       TCL_DEFS='-DPACKAGE_NAME=\"tcl\" -DPACKAGE_TARNAME=\"tcl\" -

.... a wdiff would have been a lot more helpful here. Exactly what
changed on those long, long lines?

> > If having the amd64 package around causes trouble, discuss with the tcl
> > maintainers whether the script can be put into a -dev-common package
> > or whether some more standard tool like pkg-config can be used instead.
> 
>  Not an option here since the script does differ across architectures.

The discuss with upstream to create one script that handles multiple
architectures internally. Then the script would need to exist in the
native location and be called in that location with appropriate options
to detect the cross build.
 
>  The data will be different depending on the output of tcl's
>  configuration script, so it would be a maintenance nightmare to try to
>  maintain the output of the configuration script in a single tool
>  supporting all possible arches.

Some packages simply cannot be cross-built - dpkg-cross cannot have
special cases for every single one. Other packages with these problems
include ORBit, pango, GTK and anything using GObject marshalling.
 
>  The two ways I see this getting fixed:
> a) (preferred) get dpkg-cross to output a
>    /usr/share/arm-linux-gnueabi/tcl8.5/tclConfig.sh and change tcl-based
>    builds to look for that one when cross-building

Not going to be implemented.

> b) change tcl to output a tcl-cross-config-armel or similar package
>    containing just the above (very ugly IMHO); this would essentially be
>    like providing a cross-compiler except it's a cross-tcl-configuration
>    tool; it's very intrusive for the tcl packaging though

Carrying build meta data inside a package is dumb. It's one thing to
have libtool and Makefile hanging around in the source package, it's
quite another to package something like config.h in the binary -dev
package. That is what this -dev package is trying to do - include
buildd meta-data into a runtime -dev package. That data needs to come
from somewhere else, as with the pkg-config system, not from the -dev
package.

>    @Neil: what would you think of providing some kind of extension
>  mechanism for these files in packages? 

The extension mechanism is called "patching the upstream source" and
has been used for a long time.

> e.g. dpkg-cross would run
>  /etc/dpkg-cross/hooks.d/*.pl and tcl8.5-dev would provide one, or
>  something similar?

Fix the package, not the build system.

-- 


Neil Williams
=============
http://www.data-freedom.org/
http://www.linux.codehelp.co.uk/
http://e-mail.is-not-s.ms/

[Message part 2 (application/pgp-signature, inline)]

Information forwarded to debian-bugs-dist@lists.debian.org, Debian Embedded Group <debian-embedded@lists.debian.org>:
Bug#599206; Package dpkg-cross. (Wed, 06 Oct 2010 13:42:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Loïc Minier <loic.minier@linaro.org>:
Extra info received and forwarded to list. Copy sent to Debian Embedded Group <debian-embedded@lists.debian.org>. (Wed, 06 Oct 2010 13:42:02 GMT) Full text and rfc822 format available.

Message #58 received at 599206@bugs.debian.org (full text, mbox):

From: Loïc Minier <loic.minier@linaro.org>
To: Neil Williams <codehelp@debian.org>
Cc: 599206@bugs.debian.org, Marcin Juszkiewicz <marcin.juszkiewicz@linaro.org>
Subject: Re: Bug#599206: dpkg-cross should leave files in converted package
Date: Wed, 6 Oct 2010 15:38:37 +0200
On Wed, Oct 06, 2010, Neil Williams wrote:
> Non-standard build configuration - you'll need to discuss with upstream
> just how this is meant to support cross-compilation. Probably just have
> to patch the source to make this script truly cross-platform by having
> all the variables defined and selecting according to the
> dpkg-architecture environment variables.

 Telling upstream that the fix is calling a Debian specific utility to
 fix cross-builds is not going to work; but they could check some
 triplet location

> .... a wdiff would have been a lot more helpful here. Exactly what
> changed on those long, long lines?

from amd64 to armel

[--DTCL_WIDE_INT_IS_LONG=1-] {+-DTCL_WIDE_INT_TYPE=long\ long -DHAVE_STRUCT_STAT64=1 -DHAVE_OPEN64=1 -DHAVE_LSEEK64=1 -DHAVE_TYPE_OFF64_T=1+}

> Carrying build meta data inside a package is dumb. It's one thing to
> have libtool and Makefile hanging around in the source package, it's
> quite another to package something like config.h in the binary -dev
> package. That is what this -dev package is trying to do - include
> buildd meta-data into a runtime -dev package. That data needs to come
> from somewhere else, as with the pkg-config system, not from the -dev
> package.

 Uh, pkg-config is exactly the same thing; it's fair enough to say they
 should be using pkg-config, but they could as well dismiss their own
 implementation as superior, or just dislike the pkg-config dep.

-- 
Loïc Minier




Information forwarded to debian-bugs-dist@lists.debian.org, Debian Embedded Group <debian-embedded@lists.debian.org>:
Bug#599206; Package dpkg-cross. (Wed, 06 Oct 2010 16:51:06 GMT) Full text and rfc822 format available.

Acknowledgement sent to Neil Williams <codehelp@debian.org>:
Extra info received and forwarded to list. Copy sent to Debian Embedded Group <debian-embedded@lists.debian.org>. (Wed, 06 Oct 2010 16:51:06 GMT) Full text and rfc822 format available.

Message #63 received at 599206@bugs.debian.org (full text, mbox):

From: Neil Williams <codehelp@debian.org>
To: Loïc Minier <loic.minier@linaro.org>
Cc: 599206@bugs.debian.org, Marcin Juszkiewicz <marcin.juszkiewicz@linaro.org>
Subject: Re: Bug#599206: dpkg-cross should leave files in converted package
Date: Wed, 6 Oct 2010 17:47:05 +0100
[Message part 1 (text/plain, inline)]
On Wed, 6 Oct 2010 15:38:37 +0200
Loïc Minier <loic.minier@linaro.org> wrote:

> On Wed, Oct 06, 2010, Neil Williams wrote:
> > Non-standard build configuration - you'll need to discuss with upstream
> > just how this is meant to support cross-compilation. Probably just have
> > to patch the source to make this script truly cross-platform by having
> > all the variables defined and selecting according to the
> > dpkg-architecture environment variables.
> 
>  Telling upstream that the fix is calling a Debian specific utility to
>  fix cross-builds is not going to work; but they could check some
>  triplet location
> 
> > .... a wdiff would have been a lot more helpful here. Exactly what
> > changed on those long, long lines?
> 
> from amd64 to armel
> 
> [--DTCL_WIDE_INT_IS_LONG=1-] {+-DTCL_WIDE_INT_TYPE=long\ long -DHAVE_STRUCT_STAT64=1 -DHAVE_OPEN64=1 -DHAVE_LSEEK64=1 -DHAVE_TYPE_OFF64_T=1+}

So those need to be picked up from whatever passes as a configure stage
but picked from a standard location - either using m4 tests
like ./configure or from the files that exist courtesy of dpkg-cross,
per architecture.

/etc/dpkg-cross/cross-config.amd64
/etc/dpkg-cross/cross-config.armel

I can put Tcl stuff into those files but those must be picked up *at
build time* as pkg-config and configure would pick them up, not from
the -cross package itself.

> > Carrying build meta data inside a package is dumb. It's one thing to
> > have libtool and Makefile hanging around in the source package, it's
> > quite another to package something like config.h in the binary -dev
> > package. That is what this -dev package is trying to do - include
> > buildd meta-data into a runtime -dev package. That data needs to come
> > from somewhere else, as with the pkg-config system, not from the -dev
> > package.
> 
>  Uh, pkg-config is exactly the same thing;

No. pkg-config specifies architecture-independent metadata which is
static within any single source release, not architecture-dependent
variables deduced at build time.

> it's fair enough to say they
>  should be using pkg-config, but they could as well dismiss their own
>  implementation as superior, or just dislike the pkg-config dep.

The build metadata needs to be determined at build time and that means
cross-build and native builds determining their data during the build,
not reading data arbitrarily read in from some previous build.

The machine preparing the -dev package does not necessarily have the
same configuration as the target device of the cross-build - these
things need to be *calculated* not retrieved from some previous build
somewhere else.

-- 


Neil Williams
=============
http://www.data-freedom.org/
http://www.linux.codehelp.co.uk/
http://e-mail.is-not-s.ms/

[Message part 2 (application/pgp-signature, inline)]

Information forwarded to debian-bugs-dist@lists.debian.org, Debian Embedded Group <debian-embedded@lists.debian.org>:
Bug#599206; Package dpkg-cross. (Wed, 06 Oct 2010 17:30:03 GMT) Full text and rfc822 format available.

Acknowledgement sent to Loïc Minier <loic.minier@linaro.org>:
Extra info received and forwarded to list. Copy sent to Debian Embedded Group <debian-embedded@lists.debian.org>. (Wed, 06 Oct 2010 17:30:03 GMT) Full text and rfc822 format available.

Message #68 received at 599206@bugs.debian.org (full text, mbox):

From: Loïc Minier <loic.minier@linaro.org>
To: Neil Williams <codehelp@debian.org>
Cc: 599206@bugs.debian.org, Marcin Juszkiewicz <marcin.juszkiewicz@linaro.org>
Subject: Re: Bug#599206: dpkg-cross should leave files in converted package
Date: Wed, 6 Oct 2010 19:27:57 +0200
On Wed, Oct 06, 2010, Neil Williams wrote:
> No. pkg-config specifies architecture-independent metadata which is
> static within any single source release, not architecture-dependent
> variables deduced at build time.

 it's not architecture independent at all (which is why it's mostly in
 /usr/lib/pkgconfig rather than /usr/share/pkgconfig)

 The list of libraries might differ, or some random var, or simply the
 version of the file, options or anything.

> > it's fair enough to say they
> >  should be using pkg-config, but they could as well dismiss their own
> >  implementation as superior, or just dislike the pkg-config dep.
> 
> The build metadata needs to be determined at build time and that means
> cross-build and native builds determining their data during the build,
> not reading data arbitrarily read in from some previous build.

 First, there is a difference between what the architecture needs, and
 what tcl was built with.  In some cases, it might actually be important
 that you use the same values as tcl did.  But I think it's not the case
 here; I rather see this as some non-autoconf approach to spreading the
 right build settings.

> The machine preparing the -dev package does not necessarily have the
> same configuration as the target device of the cross-build - these
> things need to be *calculated* not retrieved from some previous build
> somewhere else.

 You're saying just the same thing again; it might be entirely valid to
 use the exact same values as the ones which were used for the tcl
 build; I don't think it's the case here though.  I think tcl is trying
 to provide non-autoconf apps with a way to get the right config.

-- 
Loïc Minier




Information forwarded to debian-bugs-dist@lists.debian.org, Debian Embedded Group <debian-embedded@lists.debian.org>:
Bug#599206; Package dpkg-cross. (Wed, 06 Oct 2010 20:15:03 GMT) Full text and rfc822 format available.

Acknowledgement sent to Neil Williams <codehelp@debian.org>:
Extra info received and forwarded to list. Copy sent to Debian Embedded Group <debian-embedded@lists.debian.org>. (Wed, 06 Oct 2010 20:15:03 GMT) Full text and rfc822 format available.

Message #73 received at 599206@bugs.debian.org (full text, mbox):

From: Neil Williams <codehelp@debian.org>
To: Loïc Minier <loic.minier@linaro.org>, 599206@bugs.debian.org
Cc: Marcin Juszkiewicz <marcin.juszkiewicz@linaro.org>
Subject: Re: Bug#599206: dpkg-cross should leave files in converted package
Date: Wed, 6 Oct 2010 21:13:53 +0100
[Message part 1 (text/plain, inline)]
On Wed, 6 Oct 2010 19:27:57 +0200
Loïc Minier <loic.minier@linaro.org> wrote:

> On Wed, Oct 06, 2010, Neil Williams wrote:
> > No. pkg-config specifies architecture-independent metadata which is
> > static within any single source release, not architecture-dependent
> > variables deduced at build time.
> 
>  it's not architecture independent at all (which is why it's mostly in
>  /usr/lib/pkgconfig rather than /usr/share/pkgconfig)

The data in a .pc file is used to generate the data needed for the
build, it does not circumvent the generation of this data. Also,
pkg-config itself understands how to ensure that this data is available
in a way which understands cross-building.
 
>  The list of libraries might differ, or some random var, or simply the
>  version of the file, options or anything.

.pc files don't contain metadata like -DHAVE_STRING_H=1
-DHAVE_MEMORY_H=1 -DHAVE_STRINGS and the like. That goes in files like
config.h and is *generated* during the build from tests on the actual
system because different systems of the same architecture will change
the results of the calculations.

It is wrong to rely on that data being included in any part of the -dev
package, stuff like endianness and the size of char needs to be
generated / calculated / retrieved from a standard location. Not
included into the -dev package.

That is *system-dependent* data as well as architecture-dependent and
it has no place in a -cross -dev package. dpkg-cross has a mechanism
for retrieving only those pieces of metadata which cannot be calculated
without compiling and then executing a test program. This mechanism
itself is sub-optimal and prone to breakage - it will not bear extending
to data which *can* (and therefore should) be calculated within each
build environment or where merely compiling a test program will
suffice to retrieve the meta data (e.g. whether a particular library
function exists). Shortcuts are no good for anyone. Ubuntu has already
patched dpkg-cross to extend what shortcuts are already available into
territory which is not supportable in Debian.

-DHAVE_STRUCT_TM_TM_ZONE=1 -DHAVE_TM_ZONE=1 

Embedding that in a -dev package is just wrong. It needs to be
calculated according to the libc config in the environment. That is not
architecture-dependent, that is system dependent - e.g. uClibc does not
necessarily include all of the struct_tm data.

>  First, there is a difference between what the architecture needs, and
>  what tcl was built with. 

So the cross build should calculate what the architecture needs, not
what is retained from the build environment of the dependency. Data
from the build environment of tcl has nothing to do with the data which
needs to be calculated from the build environment of the package using
tcl.

Tcl is built on machine foo - the calculations made in that build have
nothing to do with the data needed by the build on machine bar. All
pkg-config lists are the library names, not the definitions of what
size structs are and the rest.

-DTCL_CFGVAL_ENCODING=\"iso8859-1\" -DMODULE_SCOPE=extern\ __attribute__
\(\(__visibility__\(\"hidden\"\)\)\) -DTCL_SHLIB_EXT=\".so\"
-DHAVE_TYPE_OFF64_T=1 -DHAVE_GETCWD=1 -DHAVE_OPENDIR=1 -DHAVE_STRTOL=1
-DHAVE_WAITPID=1 -DHAVE_GETADDRINFO=1 -DHAVE_GETPWUID_R_5=1
-DHAVE_GETPWUID_R=1 -DHAVE_GETPWNAM_R_5=1 -DHAVE_GETPWNAM_R=1

That stuff needs to be tested against the build environment, not
assumed to be present.

Quite apart from the rest, relying on scripts like this prevents
bootstrapping of new architectures. The build system should calculate
and determine these pieces of data, not inherit them from some other
random system which may or may not have the same configuration.

> In some cases, it might actually be
> important that you use the same values as tcl did. 

If those values do not actually match the build or runtime environment
of the package, you're welcome to triage the resulting bugs. I won't be
a party to that particular mess.

> But I think it's
> not the case here; I rather see this as some non-autoconf approach to
> spreading the right build settings.

Cross-building has never supported build systems other than autoconf
particularly well. Nothing dpkg-cross can do about that - outside the
scope of the script. 

> > The machine preparing the -dev package does not necessarily have the
> > same configuration as the target device of the cross-build - these
> > things need to be *calculated* not retrieved from some previous
> > build somewhere else.
> 
>  You're saying just the same thing again; it might be entirely valid
> to use the exact same values as the ones which were used for the tcl
>  build;

It usually is not and removing the ability to determine this is not
helpful. "might be" is not adequate. It is either always valid or
it needs to be calculated.

> I don't think it's the case here though.  I think tcl is
> trying to provide non-autoconf apps with a way to get the right
> config.

It is wrong to have that data in the -dev package and rely upon it in a
different build. There is no safe way of dpkg-cross supporting such
mangling - it does quite enough of that itself without adding special
cases like this.

There are other packages "trying to provide non-autoconf apps with a
way to get the config" but none has so far come up with a *standard* or
even *generalised* way of doing that.

Do you think I'm rejecting this idea just to be awkward? No, it's
because what you request is horrendously fragile, unpredictable and
more likely to break builds than to assist builds. There is no safe way
for dpkg-cross to mangle these files or to determine precisely which of
these non-standard scripts can be parsed and which cannot. Special
cases do not help - dpkg-cross already has too many of those.

I'll document the behaviour but dpkg-cross cannot withstand yet more
special cases and still be usable for the existing packages which it
has to support. Every interpreted language, every GObject marshaller
and every ORM package is going to want specialised support and there is
simply no reliable way of implementing a bespoke solution for each one.
None of the upstream teams, nor most of the Debian maintainers, care
sufficiently about cross-building to maintain such package-specific
support.

Not every package in Debian is ever going to be compatible with
cross-building and dpkg-cross cannot support everything. (I doubt that
Multiarch will be able to support things like this either - there will
always be exceptions.) Cross building already has sufficient
special-cases and exceptions - adding more does not help anyone, least
of all those who actually have to fix either the cross builds or the
cross-building tools.

It is not safe to leave files in the package nor is it safe to move
files into arbitrary locations when there is no reliable and
standardised way to determine the usefulness of a particular kind of
file. Package specific config scripts cannot be supported and even
build-system specific ones are not necessarily going to work without a
lot of ongoing maintenance.

Patch the original package to understand cross-building and how to
calculate the necessary meta data. If there is data which cannot be
calculated without executing a foreign architecture binary, then
dpkg-cross should be able to help and I'll look at how that can be
done but the rest of the data needs to be generated from within the
cross-building environment. Anything else just isn't sufficiently
robust or supportable.

Why cross-build tcl in the first place? What functionality is meant to
be changed or removed? Cross-building packages to end up with a binary
which is almost identical to the natively built package is a waste of
time. Seeking to be able to cross-build every package in Debian is a
pointless exercise and far beyond the scope of what dpkg-cross can
support.

-- 


Neil Williams
=============
http://www.data-freedom.org/
http://www.linux.codehelp.co.uk/
http://e-mail.is-not-s.ms/

[Message part 2 (application/pgp-signature, inline)]

Information forwarded to debian-bugs-dist@lists.debian.org, Debian Embedded Group <debian-embedded@lists.debian.org>:
Bug#599206; Package dpkg-cross. (Wed, 13 Oct 2010 08:45:03 GMT) Full text and rfc822 format available.

Acknowledgement sent to Goswin von Brederlow <goswin-v-b@web.de>:
Extra info received and forwarded to list. Copy sent to Debian Embedded Group <debian-embedded@lists.debian.org>. (Wed, 13 Oct 2010 08:45:03 GMT) Full text and rfc822 format available.

Message #78 received at 599206@bugs.debian.org (full text, mbox):

From: Goswin von Brederlow <goswin-v-b@web.de>
To: Loic Minier <loic.minier@linaro.org>
Cc: Goswin von Brederlow <goswin-v-b@web.de>, 599206@bugs.debian.org, Neil Williams <codehelp@debian.org>, Marcin Juszkiewicz <marcin.juszkiewicz@linaro.org>, control@bugs.debian.org
Subject: Re: Bug#599206: dpkg-cross should leave files in converted package
Date: Wed, 13 Oct 2010 10:42:55 +0200
Loïc Minier <loic.minier@linaro.org> writes:

> On Wed, Oct 06, 2010, Goswin von Brederlow wrote:
>> Create a wrapper script that defaults to the natgive arch but accepts an
>> arch triplet as argumen, like:
>> 
>> cat >tclConfig.sh <<EOF
>> #!/bin/sh
>> 
>> ARCH=${1:$(DEB_HOST_GNU_TYPE)}
>> 
>> exec /usr/lib/$ARCH/tcl8.5/$0
>> EOF
>
>  Yup, that's fair; I would use /usr/share/$triplet, but it's alright.
>
>  Does dpkg-cross preserve pathnames below /usr/share/$triplet or
>  /usr/lib/$triplet though?  Since we don't have multiarch, we do need to
>  dpkg-cross this, and that's why Marcin is trying to dpkg-cross
>  tcl8.5-dev.
>
> -- 
> Loïc Minier

"share" is for things that are architecture independent which this is
obviously not.

MfG
        Goswin




Information forwarded to debian-bugs-dist@lists.debian.org, Debian Embedded Group <debian-embedded@lists.debian.org>:
Bug#599206; Package dpkg-cross. (Wed, 13 Oct 2010 10:03:03 GMT) Full text and rfc822 format available.

Acknowledgement sent to Loïc Minier <loic.minier@linaro.org>:
Extra info received and forwarded to list. Copy sent to Debian Embedded Group <debian-embedded@lists.debian.org>. (Wed, 13 Oct 2010 10:03:03 GMT) Full text and rfc822 format available.

Message #83 received at 599206@bugs.debian.org (full text, mbox):

From: Loïc Minier <loic.minier@linaro.org>
To: Goswin von Brederlow <goswin-v-b@web.de>
Cc: 599206@bugs.debian.org, Neil Williams <codehelp@debian.org>, Marcin Juszkiewicz <marcin.juszkiewicz@linaro.org>, control@bugs.debian.org
Subject: Re: Bug#599206: dpkg-cross should leave files in converted package
Date: Wed, 13 Oct 2010 12:01:03 +0200
On Wed, Oct 13, 2010, Goswin von Brederlow wrote:
> "share" is for things that are architecture independent which this is
> obviously not.

 This is it's high-level title, but if your pathnames are different when
 the architecture differs, I think it essentially fits the bill for the
 use cases of usr/share.

-- 
Loïc Minier




Added tag(s) pending. Request was from Neil Williams <codehelp@debian.org> to control@bugs.debian.org. (Wed, 08 Dec 2010 20:42:07 GMT) Full text and rfc822 format available.

Reply sent to Neil Williams <codehelp@debian.org>:
You have taken responsibility. (Wed, 08 Dec 2010 21:03:07 GMT) Full text and rfc822 format available.

Notification sent to Marcin Juszkiewicz <marcin.juszkiewicz@linaro.org>:
Bug acknowledged by developer. (Wed, 08 Dec 2010 21:03:07 GMT) Full text and rfc822 format available.

Message #90 received at 599206-close@bugs.debian.org (full text, mbox):

From: Neil Williams <codehelp@debian.org>
To: 599206-close@bugs.debian.org
Subject: Bug#599206: fixed in dpkg-cross 2.6.0
Date: Wed, 08 Dec 2010 21:02:06 +0000
Source: dpkg-cross
Source-Version: 2.6.0

We believe that the bug you reported is fixed in the latest version of
dpkg-cross, which is due to be installed in the Debian FTP archive:

dpkg-cross_2.6.0.dsc
  to main/d/dpkg-cross/dpkg-cross_2.6.0.dsc
dpkg-cross_2.6.0.tar.gz
  to main/d/dpkg-cross/dpkg-cross_2.6.0.tar.gz
dpkg-cross_2.6.0_all.deb
  to main/d/dpkg-cross/dpkg-cross_2.6.0_all.deb
libdebian-dpkgcross-perl_2.6.0_all.deb
  to main/d/dpkg-cross/libdebian-dpkgcross-perl_2.6.0_all.deb



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 599206@bugs.debian.org,
and the maintainer will reopen the bug report if appropriate.

Debian distribution maintenance software
pp.
Neil Williams <codehelp@debian.org> (supplier of updated dpkg-cross 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 ftpmaster@debian.org)


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Format: 1.8
Date: Wed, 08 Dec 2010 20:39:01 +0000
Source: dpkg-cross
Binary: dpkg-cross libdebian-dpkgcross-perl
Architecture: source all
Version: 2.6.0
Distribution: experimental
Urgency: low
Maintainer: Debian Embedded Group <debian-embedded@lists.debian.org>
Changed-By: Neil Williams <codehelp@debian.org>
Description: 
 dpkg-cross - tools for cross compiling Debian packages
 libdebian-dpkgcross-perl - functions to aid cross-compiling Debian packages
Closes: 592458 599206 605409
Changes: 
 dpkg-cross (2.6.0) experimental; urgency=low
 .
   * Add armhf support to cross-config (Closes: #605409)
   * Document file removal process (Closes: #599206)
   * Add translation support for runtime messages.
   * Move upload to experimental
   * Retain Section in converted package. (Closes: #592458)
Checksums-Sha1: 
 e07606bb47976a0b637caef76dd58fe613d6e560 1209 dpkg-cross_2.6.0.dsc
 aaa3147e0d76de06a38db9c834b669787c4662b4 76249 dpkg-cross_2.6.0.tar.gz
 248103057cc18a1553fb21fb8420f28d30ca4b1d 53542 dpkg-cross_2.6.0_all.deb
 74c02e3935fc9c14fbd3f764ec5dab3f6593c745 29492 libdebian-dpkgcross-perl_2.6.0_all.deb
Checksums-Sha256: 
 c2f7c767164b62dd032970bf63a17aed423ee8137857dad4e6dfa7378b631cdd 1209 dpkg-cross_2.6.0.dsc
 bef483939997ff3ffdae2302fbdd4d5ee212f302077e8b0e2e0e47e856c8ecbc 76249 dpkg-cross_2.6.0.tar.gz
 38f3c0b91fb0a21d15dbbac6a8e4e5c19d460ce9dd9b7b86b26c9a4ef40e23df 53542 dpkg-cross_2.6.0_all.deb
 50e1798fa576508d18d66c6f8ff327b2717a411ed783f39a60f4b8b2c6e726e4 29492 libdebian-dpkgcross-perl_2.6.0_all.deb
Files: 
 8fa5680ee8be84c6ba30e64845c2e13f 1209 utils extra dpkg-cross_2.6.0.dsc
 8adaf56a64a62f1b3ee0e8fbd02b6090 76249 utils extra dpkg-cross_2.6.0.tar.gz
 3e197e2215960710964e3707214a4f3c 53542 utils extra dpkg-cross_2.6.0_all.deb
 23425c78224a4c01e492c54ea6674f0f 29492 perl extra libdebian-dpkgcross-perl_2.6.0_all.deb

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)

iEYEARECAAYFAkz/77oACgkQiAEJSii8s+P0KwCgyVVa6WalCeUtmLWYxRzCGjau
V2cAoNvOzu2Gh6xhVIhZ8d0o/DKKkc1A
=jLlU
-----END PGP SIGNATURE-----





Bug archived. Request was from Debbugs Internal Request <owner@bugs.debian.org> to internal_control@bugs.debian.org. (Fri, 18 Mar 2011 07:30:50 GMT) Full text and rfc822 format available.

Send a report that this bug log contains spam.


Debian bug tracking system administrator <owner@bugs.debian.org>. Last modified: Sun Apr 20 22:07:29 2014; Machine Name: beach.debian.org

Debian Bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.