[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#457364: debian-policy: please reserve part of the package namespace for cross compilation



Hi,

Manoj Srivastava wrote:

 Why is it important that we do this?
 What are *-cross packages?

The dpkg-cross utility generates development packages usable from cross compilers directly from native development packages by translating paths inside the package and adapting specific files. As an example,

libfoo0_0.2-1_arm.deb containing
  /usr/lib/libfoo.so.0.1

libfoo-dev_0.2-1_arm.deb containing
  /usr/lib/libfoo.so -> libfoo.so.0.1
  /usr/include/foo.h

will be converted to

libfoo0-arm-cross_0.2-1_all.deb containing
  /usr/arm-linux-gnu/lib/libfoo.so.0.1

libfoo-dev-arm-cross_0.2-1_all.deb containing
  /usr/arm-linux-gnu/lib/libfoo.so -> libfoo.so.0.1
  /usr/arm-linux-gnu/include/foo.h

This transformation happens on binary packages only, so there is no source directly associated with these packages, and they can easily be reproduced from the native packages, so storing them in the Debian archive would be a waste of resources.

The proposed namespace reservation allows these packages to be generated on demand without fear of conflicts from the regular archive. No such conflicts exist currently.

The mapping is not entirely bijective, so a certain amount of heuristics is involved (specifically, the "kfreebsd-i386" architecture makes it impossible to tell if a package's original name ends in "kfreebsd" and an i386 cross version is requested; we believe this to be a non-issue as everyone involved with ports whose architecture names contain a dash are interested in cross compilation anyway. :-)

This ambiguity cannot be resolved easily at present; a possible solution would be to extend the set of allowed characters in package names to allow for a separator character, but this would be a fairly intrusive change at the time being.

 How would the legal packages differ from the normal packages?

The legal packages are either generated with the dpkg-cross utility or from a package that is actively building a toolchain component for cross compilation; only the latter are ever uploaded into the archive, and these uploads are coordinated appropriately.

Would lintian be able to differentiate these legal packages from the ones not allowed?

With a bit of effort, perhaps.

Cross toolchain packages should only install files (besides /usr/share/doc/<package>) that match

/usr/bin/<target>-*
/usr/lib/gcc/<target>/**
/usr/<target>/**
/usr/share/man/<target>-*
/usr/share/info/<target>-*

where <target> is the GNU architecture name of the respective target system supported by them. Due to the "kfreebsd" problem, checking this again involves some heuristics.

        Do we have a package currently available that meets the required
 criteria? Can that package be presented as an example?

These packages can be generated by downloading any package containing a library or header files and invoking "dpkg-cross -a<arch> -b <package>", with <arch> being the architecture of the library package.

The general idea is that packages from the Debian archive have precedence over packages generated on the user's system, so we want to avoid accidental clashes, but allow for packages to be explicitly built if special support is required (such as when a build system is used that makes it difficult to automatically convert packages); these packages should however be coordinated with the people maintaining cross toolchain support in Debian.

   Simon



Reply to: