I am trying to cross-compile a package that needs two different architectures 
of libpq-dev at the same time.

The rust crate diesel_migrations [0] is a procedural macro that requires the 
host's libpq-dev to compile the macro and the target's libpq-dev to link 
against. There is an thread [1] describing a similar issue involving sqlite3 
where the solution is to install both libsqlite3-dev packages with 

`apt-get install --assume-yes libsqlite3-dev libsqlite3-dev:armhf`

This works with libsqlite3-dev, so I would hope that this can be made to work 
for libpq-dev. Until then, I think the solution is to use apt-download to 
manually download and unpack the target's libpq-dev and do some messing with 
the linker.

[0] (https://github.com/diesel-rs/diesel/tree/master/diesel_migrations)
[1] (https://github.com/diesel-rs/diesel/issues/2650#issuecomment-783525112)

On Tue, 05 Oct 2021 15:46:55 +0000 Krzysztof Aleksander Pyrkosz 
<krzpyrk...@gmail.com> wrote:
> Package: libpq-dev
> Version: 13.3-1
> Followup-For: Bug #995768
> X-Debbugs-Cc: krzpyrk...@gmail.com
> 
> 
> > That is expected behavior for most lib*-dev packages.
> 
> I wasn't aware of that. Isn't that what Debian's multiarch is about?
> 
> > Why do you need both in parallel?
> 
> I am crosscompiling projects from x86 build machine to arm64 and armhf.
> I've got no issues with having libssl-dev, zlib1g-dev, libc6-dev,
> libgcc-10-dev and a bunch of other development packages, coming from
> apt, installed concurrently for my host and both arm versions. I've been
> using this setup for a very long time without issues because it is
> perfectly integrated with CMake and clang.
> 
> libpq-dev does not want to cooperate because it contains different 
> /usr/bin/pg_config in each architecture package. If not for this single
> file, the -dev package would be installable like all other ones.
> 
> 

Reply via email to