Hi Tollef,
Thanks for looking into this.
On Mon, Jan 04, 2016 at 10:13:22PM +0100, Tollef Fog Heen wrote:
> Right, this is the same as doko reported in #807946. Do you have any
> concerns about his patch there or can I use that instead of your much
> more comprehensive one?
I confirm that doko filed a duplicate. His patch will practically solve
the issue in most cases, but is technically wrong. pkg-config's
architecture is not necessarily the same as DEB_BUILD_ARCH (but it will
be in many cases). Nothing prevents you from installing pkg-config:i386
on an amd64 system and then x86_64-linux-gnu-pkg-config will be broken.
You also notice that the complexity of my patch stems precisely from
doing this correctly. Rather than assuming that pkg-config's
architecture is the same as DEB_BUILD_ARCH, the architecture is written
into the script. This in turn makes it architecture dependent and
mandates a move to /usr/lib causing compatibility code in the dpkg-hook.
So if you dislike this approach, we can try to go Simon McVittie's
route: Simply don't point the symlink for pkg-config's architecture at
the cross wrapper, but at pkg-config directly. There are two ways to
implement this. One is to write pkg-config's architecture into the
dpkg-hook (essentially moving the complexity). The other is to ship it
as a file in the package (knowing that the dpkg-hook won't touch
symlinks that don't point to the cross wrapper). I believe the latter to
be fragile, because
1) Other packages (crossbuild-essential-*) mess with this symlink as
pkg-config failed to do so for a long time. Think: file conflicts.
2) preinst needs to remove any cross wrapper symlinks for pkg-config's
architecture adding the complexity there.
3) There is a chance that the dpkg hook is run in between preinst and
unpack.
So given all of this, I believe that my patch has the least complexity
for doing the right thing.
Helmut