Trying to build a flake with gnupg for aarch64 on x86 and it fails:
error: builder for '/nix/store/sb333zfrc8fwmkqz9dds427pjm6c2g48-gnupg-aarch64-unknown-linux-gnu-2.4.5.drv' failed with exit code 1;
last 10 log lines:
> *** New Portable Threads Library (nPth). Please install this
> *** library first. The library is for example available at
> *** https://gnupg.org/ftp/gcrypt/npth/
> *** (at least version 1.2 (API 1) is required).
> ***
> configure: error:
> ***
> *** Required libraries not found. Please consult the above messages
> *** and install them before running configure again.
> ***
For full logs, run 'nix log /nix/store/sb333zfrc8fwmkqz9dds427pjm6c2g48-gnupg-aarch64-unknown-linux-gnu-2.4.5.drv'.
error (ignored): error: cannot unlink '/tmp/nix-build-tpm2-tss-aarch64-unknown-linux-gnu-4.0.1.drv-0/source': Directory not empty
error: 1 dependencies of derivation '/nix/store/ihk3hb17k246d3d1p1g1sg1in4cmxr36-systemd-aarch64-unknown-linux-gnu-255.4.drv' failed to build
error: 1 dependencies of derivation '/nix/store/1dvl02yqqgacdad3mcbg6mjk7rwryy57-util-linux-aarch64-unknown-linux-gnu-2.39.3.drv' failed to build
error: 1 dependencies of derivation '/nix/store/py658abgm23bc9xbpwnjiqpsdwsfwi1h-nixos-rebuild.drv' failed to build
ok, but why does it succeed if I remove those three lines?
Also, I don’t even have gnupg in any of my files, so something else is pulling this in. Any way to figure out what?
it says:
error: 1 dependencies of derivation '/nix/store/ihk3hb17k246d3d1p1g1sg1in4cmxr36-systemd-aarch64-unknown-linux-gnu-255.4.drv' failed to build
error: 1 dependencies of derivation '/nix/store/1dvl02yqqgacdad3mcbg6mjk7rwryy57-util-linux-aarch64-unknown-linux-gnu-2.39.3.drv' failed to build
error: 1 dependencies of derivation '/nix/store/py658abgm23bc9xbpwnjiqpsdwsfwi1h-nixos-rebuild.drv' failed to build
, so gnupg is a dependency of util-linux and systemd?
I don’t understand that line;). I’m building on x86 for a Pi, but if I run a native compilier in emulation, then it’s not cross compiling, or something like that?
Yes, I experience that. It takes like 10 hours to build. Anyways, is there no way to get a higher kernel on the Pi, then?
Your PC has an x86 processor which can only execute binaries made of x86.
Your Pi has an ARM processor which can only execute binaries made for ARM.
What you’re attempting to do now is to produce ARM binaries on your x86 PC. For that to happen, you need a compiler built for the buildPlatform (x86) that produces binaries made for the hostPlatform (ARM). This is the process of cross-compiling. The tools ran during compilation are native to the platform the build is performed on but the resulting code is made for a different platform.
“native compiler in emulation” means that your processor gains the ability to execute another platform’s code via emulation. In that case the compiler that is ran during the build is itself an ARM executable and also produces code for ARM. It’s the same as if you ran a regular build on an actual ARM processor and is colloquially known as a “native” build. The emulation just makes it possible to perform it on a machine that otherwise couldn’t because its processor does not understand ARM.
Though do note that such emulation is very slow to the point where you might be better off just building on the Pi itself.
Should have known that this is an XY problem
What kernel are you running currently, which kernel do you want to run and what steps have you taken in order to do so?