astro / microvm.nix

NixOS MicroVMs
https://astro.github.io/microvm.nix/
MIT License
1.24k stars 93 forks source link

Broken cross-compiled microvm-run #263

Closed avnik closed 1 month ago

avnik commented 1 month ago

After this https://github.com/astro/microvm.nix/commit/adbd716f6303dc45945195b79a03dcd2925fca8d#diff-76419ad2883632d3fdf8ec762593d5f741879baac8c16116a43502a8aa402b37L26 change, resulting script generated with buildPackages.bash in shebang, which follow to exec format error in runtime

brianmcgillion commented 1 month ago

This in the case when doing a cross compiled build e.g. from x86_64 - aarch64

$ cat /var/lib/microvms/net-vm/current/bin/microvm-run                 
#!/nix/store/i1x9sidnvhhbbha2zhgpxkhpysw6ajmr-bash-5.2p26/bin/bash
...
$ file /nix/store/i1x9sidnvhhbbha2zhgpxkhpysw6ajmr-bash-5.2p26/bin/bash
/nix/store/i1x9sidnvhhbbha2zhgpxkhpysw6ajmr-bash-5.2p26/bin/bash: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked, interpreter /nix/store/0wydilnf1c9vznywsvxqnaing4wraaxp-glibc-2.39-52/lib/ld-linux-x86-64.so.2, BuildID[sha1]=d9699c0a55f1c4bb3d96966637c79808d0a0441e, for GNU/Linux 3.10.0, not stripped
$ uname -a
Linux ghaf-host 5.10.120 #1-NixOS SMP Tue Jan 1 00:00:00 UTC 1980 aarch64 GNU/Linux