LSB, bi-arch, and package repositories

Printer-friendly version

This message describes a real world problem I'm hitting now trying to
ship Picasa.

Consider the case of an ISV who has a 32 bit
application who would like to build it once
and allow users to use their native package manager
to download the package from the ISV's package repository
and also notify the user when newer versions are available.

For good coverage, this means the ISV has to
package the same binary in both .rpm and .deb format
(e.g. http://picasa.google.com/linux/download.html )
(This ignores the attempt of the spec to mandate the RPM format,
http://refspecs.linux-foundation.org/LSB_3.2.0/LSB-Core-generic/LSB-Core...
but since the LSB doesn't standardize rollout of packages over the
network, we have to go with the native package format here.)

With .rpm, no problem; rpm is pretty good at handling this.
Even on 64 bit machines, the 32 bit package installs and works.

With .deb, there's a minor hitch; apt and aptitude don't
recognize 32 bit packages in 64 bit repositories.
Easy workaround: provide a second .deb marked as
64 bits, but with identical contents.
(This violates the letter but perhaps not the spirit of
http://refspecs.linux-foundation.org/LSB_3.2.0/LSB-Core-IA32/LSB-Core-IA...
)

That works fine except for one detail: how to make sure the
target system has the 32 bit compatibility libraries installed?

Since this is a dependency problem specific to the
ia32 architecture (the arch of the app) and the
amd64 architecture (the arch of the target system),
let's look at the pages of the LSB definition that deal
with those two architectures:
http://refspecs.linux-foundation.org/LSB_3.2.0/LSB-Core-IA32/LSB-Core-IA...
suggests that adding a dependency on
lsb-core-ia32
would do the trick, but
http://refspecs.linux-foundation.org/LSB_3.2.0/LSB-Core-AMD64/LSB-Core-A...
doesn't mention this possibility.

Back in the real world, the story is not so pretty.
On Ubuntu Gutsy, one has to add a dependency on ia32-libs,
but on Ubuntu Hardy, one has to add dependencies on
both ia32-libs and lib32nss-mdns, else the app can't look up hosts by name;
see https://bugs.launchpad.net/ubuntu/+source/ia32-libs/+bug/220377

So, what are the prospects for tidying up this painful little issue?

I'm looking for both a short-term and a long-term solution.
Short-term, I'd like Ubuntu to get its *!@$ act together and
return to the practice of letting 64 bit packages depend on ia32-libs
to trigger installation of all needed 32 bit compatibility libraries.
Long-term, since forcing all distributions to support yum rpm
repostories is not likely to succeed, I'd like the LSB to
grudgingly accept the .deb format as an alternate representation.
That would probably mean adding
a little section saying that .deb packaging is allowed, and
allow 32 bit apps to be packaged either the current way
(marked as 32 bit packages) or (as a sop to apt's inability to
handle 32 bit packages on a 64 bit machine) in this alternate way
(marked as 64 bit packages but with a dependency on lsb-core-ia32).

I looked around a bit, and found a few hits on the topic, e.g.
http://www.linuxfoundation.org/impl/20040206.html
http://lackof.org/taggart/hacking/multiarch/
but nothing current.

If you've read this far, thanks for listening. I'd love to
hear suggestions for how to move forward.
- Dan

LSB, bi-arch, and package repositories
Submitted by tytso on Thu, 07/17/2008 - 14:30.

On Thu, Jul 17, 2008 at 04:52:33AM -0700, Dan Kegel wrote:
> This message describes a real world problem I'm hitting now trying to
> ship Picasa.
>
> Consider the case of an ISV who has a 32 bit
> application who would like to build it once
> and allow users to use their native package manager
> to download the package from the ISV's package repository
> and also notify the user when newer versions are available.

The problem you are considering hasn't been one that we've dealt with,
because most ISV that we've been working with haven't been interested
in making packages available via yum (or apt repositories). You're
the first one who's asked for this kind of coverage.

> I'm looking for both a short-term and a long-term solution.
> Short-term, I'd like Ubuntu to get its *!@$ act together and
> return to the practice of letting 64 bit packages depend on ia32-libs
> to trigger installation of all needed 32 bit compatibility libraries.

So I know you this doesn't solve the automatic update problem (which
let's try to treat as a separate problem while we explore the solution
space), but it may be the easist way to solve this problem is a patch
to the "alien" program that when it is asked to convert a 64-bit RPM
to a 32-bit dpkg, that it does so while adding the right dependencies.

The reason why I say this is that Debian's dpkg development looking in
from the outside, seems to be somewhat disfunctional, and attempts to
add multiarch support to Debian has been highly contentious, to say
the list. So unfortunately, I personally don't have much confidence
in dpkg growing the right support to get true multiarch (or biarch)
support in the short term, and I'm not so sure Ubuntu is going to be
willing to firmly grasp the third rail of Debian packaging politics
and fork dpkg and apt in order address this problem. I could be
wrong, and if I am, I would be delighted, but patches to support
multiarch, at least in a partial way, have been drifting around for
some 3-4 years, and they have never been integrated.

So it may be that submitting patches to alien may be the fastest way
to solve the multiarch problem from practical point of view.

> Long-term, since forcing all distributions to support yum rpm
> repostories is not likely to succeed....

Well, it's not strictly necessary to force switch over to Yum RPM
repositories. Both Debian and Ubuntu (in universe) have Yum packages
available. I can't speak to how well they work, but in theory you a
system could be using yum and synaptics in parallel; it doesn't have
to be an either-or situation.

In the worst case, the shortest path to a solution from Google's point
of view might be to take the yum dpkg, and see if it works properly.
It might need some minor adjustments to use "alien" instead of "rpm"
to install an rpm package, but that would be a relatively minor patch.
I suspect the change to make alien be able to convert 64-bit RPM's to
32-bit dpkg's while adding the right dependencies wouldn't be that
hard, and alien could be taught that when asked to install a package
using -i, to fork off "apt-get install" to fetch any added
dependencies such as the 32-bit libraries.

I suspect it will be easier to get these patches into the alien and
yum packages, since it avoids the dpkg political swamp. (Since dpkg is
so critical, getting consensus to get new features/patches added to
dpkg, even from the original author of dpkg, seems to be glacial, and
there was recently an extremely ugly power struggle which the Debian
ftp masters had to referee as a result of that.)

Until those packages are accepted into Debian and Ubuntu, Google could
include them in its yum repository, and then have Debian and Ubuntu
users simply download and run a simple script which installs the
updated/enhanced yum and alien commands which will do the right thing.
Yes, that's extra work for you, but at least all of the pieces are
under your control. It may be easier than hoping that Canonical will
to fork dpkg, or waiting for the dpkg maintainers to integrate a patch
that has been floating about for years, etc. And it also in the long
term means you only have to release one binary package, which should
save you effort in the long run.

> I'd like the LSB to
> grudgingly accept the .deb format as an alternate representation.

The question is what does it mean for us to "grudgingly accept"? If
an ISV chooses to release an application in multiple formats,
including an LSB-compliant RPM subset (which Ubuntu and Alien's alien
and lsb-install packages know how to accept), as well as a dpkg
version of the application, the "bag of bits" which is the
lsb-compliant RPM would be get the LSB certification mark, and in
practice people would say the application is LSB certified.

If an ISV provides an alternate packaging mechanism for the
convenience of users, I can't see any reason why anyone would
complain. However, giving the the dpkg "bag of bits" the LSB
certification mark doesn't make any sense, since that isn't anything
an RPM distribution could make sense of.

In addition, even if all distributions shipped alien (which can
convert dpkg's to RPM's, although that support is no doubt much less
well tested), in order to add the .deb format to the LSB
specification, we would have to document the low-level dpkg format,
which whould not be a trivial exercise.

So as you say, "back to the real world", it may be the best way
forward is to patch alien and yum to do the right thing on Debian
32-bit systems, and then try to get those changes picked up by the
Debian maintainers. If you can manage do this, then it is highly
likely that Ubuntu will have the support within 6 months. Other
approaches may require you to end up waiting for Godot.....

- Ted

Copyright © 2008 Linux Foundation. All rights reserved.
LSB is a trademark of the Linux Foundation. Linux is a registered trademark of Linus Torvalds