#995768 libpq-dev: Unable to concurently install multiple architectures libpq-dev

Package:
libpq-dev
Source:
postgresql-15
Description:
header files for libpq5 (PostgreSQL library)
Submitter:
Krzysztof Aleksander Pyrkosz
Date:
2021-10-06 23:51:03 UTC
Severity:
important
#995768#5
Date:
2021-10-05 11:18:03 UTC
From:
To:
Dear Maintainer,

It is impossible to install libpq-dev for multiple architectures at the
same time.

$ sudo apt install libpq-dev:arm64
The following packages will be REMOVED:
  libpq-dev
The following NEW packages will be installed:
  libpq-dev:arm64

I suppose it is not a big deal to fix that since the binaries, libpq5
package can be installed with apt in multiarch directories without issues and
work out of the box.

#995768#8
Date:
2021-10-05 15:18:55 UTC
From:
To:
Re: Krzysztof Aleksander Pyrkosz

That is expected behavior for most lib*-dev packages.

Why do you need both in parallel?

Christoph

#995768#11
Date:
2021-10-05 15:18:55 UTC
From:
To:
Re: Krzysztof Aleksander Pyrkosz

That is expected behavior for most lib*-dev packages.

Why do you need both in parallel?

Christoph

#995768#16
Date:
2021-10-05 15:46:55 UTC
From:
To:
Package: libpq-dev
Version: 13.3-1
Followup-For: Bug #995768
X-Debbugs-Cc: krzpyrkosz@gmail.com

I wasn't aware of that. Isn't that what Debian's multiarch is about?

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.

#995768#21
Date:
2021-10-06 23:46:10 UTC
From:
To:
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)