Skip to content

Conversation

@jpruiz84
Copy link
Contributor

Use pkgs instead of pkgs.buildPackages to ensure e2fsprogs and other utilities are built for the target ARM64 architecture rather than the build x86 architecture. This resolves the "Exec format error" when running chattr and mkfs.ext4.

Use pkgs instead of pkgs.buildPackages to ensure e2fsprogs and other utilities
are built for the target ARM64 architecture rather than the build x86 architecture.
This resolves the "Exec format error" when running chattr and mkfs.ext4.

Signed-off-by: Juan Pablo Ruiz <juanpablo.ruiz@unikie.com>
@nix-ci-app
Copy link

nix-ci-app bot commented Feb 25, 2025

NixCI is ready to run on this PR.
Maintainer: Comment nix-ci run to run now.

1 similar comment
@nix-ci-app
Copy link

nix-ci-app bot commented Feb 25, 2025

NixCI is ready to run on this PR.
Maintainer: Comment nix-ci run to run now.

@avnik
Copy link
Contributor

avnik commented Feb 25, 2025

Looks pretty sane

@astro
Copy link
Member

astro commented Feb 25, 2025

@mikatammi Please review

@astro
Copy link
Member

astro commented Apr 10, 2025

I fear that this is going to break the use-case where aarch64 is emulated by qemu on x86_64. Makes me wonder if we can reach a middleground that works for everyone by using pkgs.hostPackages?

@avnik
Copy link
Contributor

avnik commented Apr 11, 2025

Probably no. runCommand statements should use pkgs.buildPackages (on builder), runtime scripts should use hostPackages (ie for target platform). I intentionally keep emulation off on my main x86-64 machine, to catch cross-compilation bugs.

I would test, if it correctly cross-builds now

@astro
Copy link
Member

astro commented Apr 19, 2025

Well, in that case a runtime check for the host arch has to be done to select the right packages.

@mikatammi
Copy link
Contributor

image
Never forget!

@mikatammi
Copy link
Contributor

You cannot expect me to do code review for people, who kicked me out of their project because I put the PRIDE flag as my Slack profile picture. Yes I am bisexual, and I have enjoyed sex with other men 🖕

@avnik
Copy link
Contributor

avnik commented Jun 17, 2025

@astro I checked it about week ago, and it at least builds for me!

@astro astro merged commit 075b880 into microvm-nix:main Jun 17, 2025
51 checks passed
astro added a commit that referenced this pull request Jun 18, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants