Re: Cross-building Debian packages with --sysroot
On Wed, Oct 12, 2016 at 12:12:33AM -0500, John Morris wrote:
> I was able to patch in the `dpkg-shlibdeps --sysroot` argument. The
> attached patch monkey-patches the system directly (not the packages that
> provide the patched files).
Is adding sysroot support really a good idea? A big reason to do
multiarch was to get rid of sysroots once and for all. Now it seems
we're getting the pain back.
> + --sysroot=<directory> add a prefix to the administrative and library search
> + directories.
I think that having this as an option is fairly useless, because most
invocations of dpkg-shlibdeps are implicit. Thus using this feature
requires patching each package.
> +=item B<-R>I<directory>, B<--sysroot=>I<directory>
> +
> +This option tells B<dpkg-shlibdeps> to use an alternate directory as a
> +system root. It will be prepended to the B<--admindir> directory, and
> +to library search paths.
> +
> +This is useful when cross-building packages against libraries in a
> +system root directory created by e.g. B<multistrap>.
I'm wondering how this relates to the DPKG_ROOT environment variable[1].
It was added for simplifying installation of packages into chroots
without relying on the tools inside the chroot. Few parts of dpkg
currently support DPKG_ROOT (basically only dpkg itself).
Can we maybe define a reasonable meaning of "DPKG_ROOT=$sysroot
dpkg-buildpackage"? It could mean using outside-sysroot tools to build a
package using the libraries inside-sysroot.
This is not fleshed out and I'm not convinced that supporting sysroots
is worth the effort, but moving to an environment variable sounds like a
strict improvement.
Helmut
Reply to: