Hello, I’m kind of new to packaging with Nix, and it’s been several days I’m stuck digging the nixpkgs code to try and find a solution, without success.
The goal is to cross build my Qt / C++ app from x86-64 Linux (laptop), targeting ARM64 Linux (Raspberry Pi 4) :
(import <nixpkgs> {
localSystem = "x86_64-linux"; # buildPlatform
crossSystem = "aarch64-linux"; # hostPlatform
}).qt5.callPackage
(
{
lib,
mkDerivation,
qtwayland,
stdenv,
}:
mkDerivation {
pname = "smart-piano-ui";
version = "0.1.0";
src = ./.;
buildInputs =
[ ] # qtbase included by libsForQt5 / qt5 mkDerivation
++ lib.optional stdenv.hostPlatform.isLinux [
qtwayland # Wayland support (Linux)
];
configurePhase = ''
qmake
'';
installPhase = ''
install -D SmartPianoUI $out/bin/ui
'';
}
)
{ }
The full source is on GitHub. Of course, I tried to build it for the same target as the host (removing crossSystem…) and it works as expected. But running a cross nix build fails with an output like this :
these 10 derivations will be built:
/nix/store/w7bf4wwlgchnzzp454iq3h797qq847g0-qtsvg-aarch64-unknown-linux-gnu-5.15.17.drv
/nix/store/3wcfssv148vmg80rd9py19r748rf9i0q-qtdeclarative-aarch64-unknown-linux-gnu-5.15.17.drv
/nix/store/3zrvrdplyjqrwgb5hc9w4djpqymxq5cw-qtquickcontrols-aarch64-unknown-linux-gnu-5.15.17.drv
/nix/store/3midvnlisf9sqqvfxwyyvnd1xnpxdlhs-qtwayland-aarch64-unknown-linux-gnu-5.15.17.drv
/nix/store/mv1dir1wb7v4wphxw6lqiikxx8l0mlrz-qtsvg-5.15.17.drv
/nix/store/fx0sr6qc1x9s866zigacdsi0mdymjv4d-qtdeclarative-5.15.17.drv
/nix/store/xlly5sb7cjqhwf0pqh5bmkc87i6rjl8p-qtquickcontrols-5.15.17.drv
/nix/store/fwqwpcxzqji54g5sb79a27d5cjlqfp81-qtwayland-5.15.17.drv
/nix/store/li5gwxbq29xzndhdi7l2ql2m6l3gcqfp-wrap-qt5-apps-hook.drv
/nix/store/9ps209gx4vwd6qjg3x5pgi0rc98fzmwv-smart-piano-ui-aarch64-unknown-linux-gnu-0.1.0.drv
building '/nix/store/w7bf4wwlgchnzzp454iq3h797qq847g0-qtsvg-aarch64-unknown-linux-gnu-5.15.17.drv'...
building '/nix/store/mv1dir1wb7v4wphxw6lqiikxx8l0mlrz-qtsvg-5.15.17.drv'...
Error: detected mismatched Qt dependencies:
/nix/store/lyqw8xyhr5xa96rfwg8asfg9ahr644gq-qtbase-5.15.17-dev
/nix/store/f9shj5nv1cj3alkn5fwwsdr3jx6n9nmi-qtbase-5.15.17-dev
error: builder for '/nix/store/mv1dir1wb7v4wphxw6lqiikxx8l0mlrz-qtsvg-5.15.17.drv' failed with exit code 1;
last 3 log lines:
> Error: detected mismatched Qt dependencies:
> /nix/store/lyqw8xyhr5xa96rfwg8asfg9ahr644gq-qtbase-5.15.17-dev
> /nix/store/f9shj5nv1cj3alkn5fwwsdr3jx6n9nmi-qtbase-5.15.17-dev
For full logs, run:
nix log /nix/store/mv1dir1wb7v4wphxw6lqiikxx8l0mlrz-qtsvg-5.15.17.drv
error: 1 dependencies of derivation '/nix/store/fx0sr6qc1x9s866zigacdsi0mdymjv4d-qtdeclarative-5.15.17.drv' failed to build
error: 1 dependencies of derivation '/nix/store/xlly5sb7cjqhwf0pqh5bmkc87i6rjl8p-qtquickcontrols-5.15.17.drv' failed to build
error: 1 dependencies of derivation '/nix/store/fwqwpcxzqji54g5sb79a27d5cjlqfp81-qtwayland-5.15.17.drv' failed to build
error: 1 dependencies of derivation '/nix/store/li5gwxbq29xzndhdi7l2ql2m6l3gcqfp-wrap-qt5-apps-hook.drv' failed to build
error: 1 dependencies of derivation '/nix/store/9ps209gx4vwd6qjg3x5pgi0rc98fzmwv-smart-piano-ui-aarch64-unknown-linux-gnu-0.1.0.drv' failed to build
Am I doing something wrong ? Thanks for any help ![]()