Open pyle opened 2 years ago
This issue has been mentioned on NixOS Discourse. There might be relevant details there:
https://discourse.nixos.org/t/advice-which-lean-nixos-server-devops-tool-to-use/23778/8
I've got the same problem but --fast
doesn't fix it.
Any idea when this will be fixed?
Same issue here, is there any reason it is not fixed yet? (not rushing anyone, just making sure it's a bug that can be worked on)
Another workaround could be adding the aarch64 host as a remote builder on the source host.
Or you could try using binfmt stubs to emulate, but if you’re targeting a remote host anyway then it’s probably better to have that host do the building.
Another workaround could be adding the aarch64 host as a remote builder on the source host.
This will produce a nixos-rebuild
script whose shebang points to an aarch64 bash, which can't run natively on the (e.g. x86_64-linux
) source host. Not at all if it's a macOS source host.
Potential solutions:
system.build
that returns an executable nixos-rebuild
for any given system. Pass the value of nix eval --expr --impure builtins.currentSystem
to the function.--fast
by default and not reexec nixos-rebuild
. I think it's an acceptable default behavior. nixos-rebuild
could check that it supports all the features a NixOS configuration declares that it needs (new compatibility management feature).
Describe the bug
G'day, c1bc8de9e3f174853df69acdc2fa594d34d5417c introduces a
nixos-rebuild
failure when--target-host/--build-host
are set to aaarch64-linux
host and you're running the command on anx86_64-linux
machine.Prior to 22.05 nixos-rebuild did not "reexec" when using flakes which means the script didn't try to
nix build
a derivation which has the system attribute as aarch64.e.g. REXEC will atttempt to execute a derivation:
$ nix --extra-experimental-features nix-command flakes build --out-link /tmp/nix-shell.gBYKHm/nixos-rebuild.ZFCrK5/nixos-rebuild .#nixosConfigurations."my-aarch64-system".config.system.build.nixos-rebuild --verbose --show-trace
on an x86 platform causing the following error.This will only trigger on
$canRun
commands likeswitch|boot|test
Steps To Reproduce
Steps to reproduce the behavior:
nixos-rebuild --target-host aarch64-machine --build-host aarch64-machine --flake .#aarch64-machine
from an x86 boxExpected behavior
nixos-rebuild shouldn't attempt to reexec a systems flake if its architecture differs from its own OR nixos-rebuild should be built on the target machine :man_shrugging:
Workaround
You can bypass the reexec by adding the
--fast
flag.Notify maintainers
@Profpatsch meta.maintainers @enzime commit author
Metadata
Please run
nix-shell -p nix-info --run "nix-info -m"
and paste the result.Host machine:
Target machine (since upgraded to 22.05 but previously on 21.11 until
--fast
workaround used:If you need any more details just let me know :)