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

Re: Updating dpkg-cross: file moving question



> > Dpkg-cross is a tool to create cross-compile environment, useful to
> > cross-compile debian packages and other software.
> > One of dpkg-cross's functions is to process a native library or libdev
> > package for some arch, and turn it into arch-all packages that install
> > libraries info /usr/$DEB_TARGET_GNU_ARCH)/lib/, and headers
> > info /usr/$(DEB_TARGET_GNU_ARCH)/include/. E.g. arm cross-compile
> > environment was created under /usr/arm-linux/. This was consistent
> > with cross-binutils and cross-gcc packages file placement.
>
> That isn't where the multiarch proposals for Debian and FHS place
> files and I think it is best if you follow their lead. Use
>
> /usr/lib/$(DEB_HOST_GNU_CPU)-$(DEB_HOST_ARCH_OS)/
> /usr/include/$(DEB_HOST_GNU_CPU)-$(DEB_HOST_ARCH_OS)/

Hmm...

All cross toolchains I've seen up to today, both free and commercial, use 
include/ and lib/ subdirectories of some prefix.

Cross-ld from binutils use ${prefix}/${target}/lib these are the path to 
search libraries.

Cross-gcc also uses ${prefix}/${target}/include and  
${prefix}/${target}/lib.

This is how things used to work for years.
There should be a very serious reason to change this.

> > In newer dpkg tools, target names changed, e.g. arm-linux turned into
> > arm-linux-gnu. So, to keep system consistent, dpkg-cross should now
> > place things under /usr/arm-linux/gnu/.
> >
> > The question is - how to process existing cross-compile environment,
> > created by earlier versions of dpkg-cross.
> >
> > I am thinking to make the following trick. In postinst of new
> > dpkg-cross, it will check for /usr/arm-linux, /usr/powerpc-linux/, and
> > other places where packages created by earlier versions could place
> > files. If any of such directories is found:
> > - a directory with the new name will be created if not exists yet,
> > - complete file hierarchy from the old directory will be copied to the
> > new directory,
> > - old directory will be replaces with a sympink to the new one.
> >
> > Looks that this procedure is more or less safe. E.g. removals of
> > packages which files have been moved in this way, would remove correct
> > files.
>
> The target directory would not be removed.

Yes, I see.
This is one more drawback.

In future dpkg-cross versions, I'll probably make -arch-cross packages to 
provide 'dpkg-cross-layout-<arch>-<version>', and conflict with older 
versions, so inconsistent setup could be more or less easilly avoided if 
layout will ever change in future. Or something similar.

But currently, seems there is no way to avoid inconsistency cleanly, so 
question is - try some tricks to avoid it in 'standard cases', by the cost 
of mentioned drawbacks, or just add a news entry asking users to 
regenerate all -arch-cross packages with new dpkg-cross, and leave the 
rest to the users.

Nikita

Attachment: pgp0GjzS5xqx4.pgp
Description: PGP signature


Reply to: