I’m trying to set up a Raspberry Pi v4b (running Ubuntu 20.04) as a remote builder for my local x86 machine (also Ubuntu 20.04) and I’m getting a rather confusing error message when trying to build a package that targets aarch64-linux:
error: build of '/nix/store/xf0nqqhaq68jqnfh132f7w3g53pmrlcm-pigpio-78.drv' on 'ssh://build-rpi' failed: a 'x86_64-linux' with features {} is required to build '/nix/store/xf0nqqhaq68jqnfh132f7w3g53pmrlcm-pigpio-78.drv', but I am a 'aarch64-linux' with features {benchmark, big-parallel, kvm, nixos-test}
The package in question: https://github.com/drewrisinger/nur-packages/blob/10649b8c8be82f990d21051410f10226df750f08/pkgs/raspberrypi/pigpio/default.nix
Output of nix-shell -p nix-info --run "nix-info -m"
(host):
- system: `"x86_64-linux"`
- host os: `Linux 5.8.0-41-generic, Ubuntu, 20.04.2 LTS (Focal Fossa)`
- multi-user?: `no`
- sandbox: `yes`
- version: `nix-env (Nix) 2.3.7`
- channels(brad): `""`
- channels(root): `"<other channels>, nixpkgs-20.03.3324.929768261a3"`
- nixpkgs: `/nix/var/nix/profiles/per-user/root/channels/nixpkgs`
(not sure why it says ‘no’ for ‘multi-user’ - it actually is a multi-user installation)
rpi:
- system: `"aarch64-linux"`
- host os: `Linux 5.4.0-1028-raspi, Ubuntu, 20.04.2 LTS (Focal Fossa)`
- multi-user?: `yes`
- sandbox: `yes`
- version: `nix-env (Nix) 2.3.10`
- channels(root): `"nixpkgs-20.03.3324.929768261a3"`
- nixpkgs: `/nix/var/nix/profiles/per-user/root/channels/nixpkgs`
nix.conf (host):
substituters = https://cache.nixos.org <other substituters>
trusted-public-keys = cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY= <other keys>
cores = 0
build-users-group = nixbld
builders = ssh://build-rpi
#builders-use-substitutes = true # tried this both ways, didn't seem to make a difference as far as the error
rpi:
system = aarch64-linux
extra-platforms = armv7l-linux # I don't even know if this is true, basically just added it to see what would happen
build-users-group = nixbld
max-jobs = 1
cores = 0
trusted-users = root build-rpi
And I also have allowUnsupportedSystem = true;
in my local user’s config.nix
(this was actually a key thing in getting as far as I have).
It took me quite a few attempts to get nix-build
to even try to use the rpi, so I probably have some unnecessary stuff in my configuration - please ignore that. The extra channels and substituters can be ignored too.
As far as why I want to do distributed builds in this way - this is just a local test before I attempt to use the rpi as a builder for a hydra server I’m running.
Any help would be appreciated, TIA.