psycopg2: cross compilation fails #164958
Labels
0.kind: bug
Something is broken
6.topic: cross-compilation
Building packages on a different platform than they will be used on
Cross compiling
psycopg2
currently fails. Psycopg2 is a postgresql adapter for python, and therefore requirespostgresql
.The runtime libraries for
postgresql
needs to be available for the host platform, and the binarypg_config
frompostgresql
needs to be available for the build platform.Currently,
postgresql
is only specified innativeBuildInputs
. That makes thepg_config
binary available. However, it also makes the runtime libraries available built for build platform, not host platform. From what I understand, to make the runtime libraries forpostgresql
available for the target platform,postgresql
should be added tobuildInputs
. However, the linking step fails because it still finds the native / build platform libraries.I'd like to fix this issue myself, but I need some pointers on the best way to proceed. I can see two ways to fix this:
postgresql
package which does not include the runtime libraries.Error when building:
pkgsCross.armv7l-hf-multiplatform.python39Packages.psycopg2
/nix/store/521z5w03bmrs4d2qxpnbcqk80lvn7p4v-postgresql-13.6-lib/lib/libpq.so: file not recognized: file format not recognized
Examining the file format reveals that it is build for x86-64, the build platform.
The text was updated successfully, but these errors were encountered: