-
-
Notifications
You must be signed in to change notification settings - Fork 15.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add "emulator" function to systems #50212
Conversation
Success on x86_64-linux (full log) Attempted: libxml2, talloc, unscd Partial log (click to expand)
|
Success on aarch64-linux (full log) Attempted: libxml2, talloc, unscd Partial log (click to expand)
|
Success on x86_64-darwin (full log) Attempted: libxml2, talloc The following builds were skipped because they don't evaluate on x86_64-darwin: unscd Partial log (click to expand)
|
Success on x86_64-darwin (full log) Attempted: libxml2, qemu, talloc, vde2 The following builds were skipped because they don't evaluate on x86_64-darwin: unscd Partial log (click to expand)
|
Timed out, unknown build status on x86_64-linux (full log) Attempted: libxml2, qemu, talloc, unscd, vde2 Partial log (click to expand)
|
Success on aarch64-linux (full log) Attempted: libxml2, qemu, talloc, unscd, vde2 Partial log (click to expand)
|
Success on x86_64-darwin (full log) Attempted: libxml2, qemu, talloc, vde2 The following builds were skipped because they don't evaluate on x86_64-darwin: unscd Partial log (click to expand)
|
Success on aarch64-linux (full log) Attempted: libxml2, qemu, talloc, unscd, vde2 Partial log (click to expand)
|
Success on aarch64-linux (full log) Attempted: libxml2, qemu, talloc, unscd, vde2 Partial log (click to expand)
|
Success on x86_64-linux (full log) Attempted: libxml2, qemu, talloc, unscd, vde2 Partial log (click to expand)
|
Success on x86_64-darwin (full log) Attempted: libxml2, qemu, talloc, vde2 The following builds were skipped because they don't evaluate on x86_64-darwin: unscd Partial log (click to expand)
|
Timed out, unknown build status on x86_64-linux (full log) Attempted: libxml2, qemu, talloc, unscd, vde2 Partial log (click to expand)
|
@GrahamcOfBorg build pkgsCross.aarch64-multiplatform.talloc pkgsCross.mingwW64.talloc pkgsCross.powernv.talloc tests.cross.aarch64-multiplatform tests.cross.mingwW64 tests.cross.musl64 tests.cross.fuloongminipc |
Failure on aarch64-linux (full log) Attempted: pkgsCross.aarch64-multiplatform.talloc, pkgsCross.powernv.talloc, tests.cross.aarch64-multiplatform, tests.cross.musl64, tests.cross.fuloongminipc The following builds were skipped because they don't evaluate on aarch64-linux: pkgsCross.mingwW64.talloc, tests.cross.mingwW64 Partial log (click to expand)
|
Timed out, unknown build status on x86_64-darwin (full log) Attempted: pkgsCross.aarch64-multiplatform.talloc, pkgsCross.powernv.talloc, tests.cross.aarch64-multiplatform, tests.cross.mingwW64, tests.cross.musl64, tests.cross.fuloongminipc The following builds were skipped because they don't evaluate on x86_64-darwin: pkgsCross.mingwW64.talloc Partial log (click to expand)
|
Timed out, unknown build status on x86_64-linux (full log) Attempted: pkgsCross.aarch64-multiplatform.talloc, pkgsCross.powernv.talloc, tests.cross.aarch64-multiplatform, tests.cross.mingwW64, tests.cross.musl64, tests.cross.fuloongminipc The following builds were skipped because they don't evaluate on x86_64-linux: pkgsCross.mingwW64.talloc Partial log (click to expand)
|
8922d5e
to
bfeb7f0
Compare
Timed out, unknown build status on x86_64-linux (full log) Attempted: qemu, talloc Partial log (click to expand)
|
pkgs/top-level/all-packages.nix
Outdated
# built stuff on the local system. Emulators, simulators, and more. | ||
# Note this will give you a path to an executable - not a derivation. | ||
# Don’t rely on using a certain emulator. | ||
exeWrapper = platform: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The expression is large enough to be imported from an external file.
Success on aarch64-linux (full log) Attempted: qemu, talloc Partial log (click to expand)
|
Success on x86_64-linux (full log) Attempted: qemu, talloc Partial log (click to expand)
|
Success on x86_64-darwin (full log) Attempted: qemu, talloc Partial log (click to expand)
|
@GrahamcOfBorg build pkgs.tests.cross.hello |
No attempt on x86_64-darwin (full log) The following builds were skipped because they don't evaluate on x86_64-darwin: pkgs.tests.cross.hello Partial log (click to expand)
|
No attempt on aarch64-linux (full log) The following builds were skipped because they don't evaluate on aarch64-linux: pkgs.tests.cross.hello Partial log (click to expand)
|
Unexpected error: command failed with exit code 1 on x86_64-linux (full log) Attempted: pkgs.tests.cross.hello Partial log (click to expand)
|
0cfeacc
to
322cad6
Compare
"powerpc64le" = "ppc64"; | ||
}.${final.parsed.cpu.name} or final.parsed.cpu.name; | ||
|
||
emulator = pkgs: let |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Ericson2314 How do you feel about putting this in lib/systems/default.nix? I want to avoid sticking it in "pkgs" as that is only really supposed to contain callPackage usages.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you move the emulator stuff to its own file?
Success on aarch64-linux (full log) Attempted: qemu, talloc Partial log (click to expand)
|
Success on x86_64-darwin (full log) Attempted: qemu, talloc Partial log (click to expand)
|
Timed out, unknown build status on x86_64-linux (full log) Attempted: qemu, talloc Partial log (click to expand)
|
@GrahamcOfBorg build pkgs.tests.cross.hello.aarch64-multiplatform |
Failure on aarch64-linux (full log) Attempted: pkgs.tests.cross.hello.aarch64-multiplatform Partial log (click to expand)
|
No attempt on x86_64-linux (full log) The following builds were skipped because they don't evaluate on x86_64-linux: pkgs.tests.cross.hello.aarch64-multiplatform Partial log (click to expand)
|
Makes it easier to use mapAttrs with lib.systems.examples. Now every entry in it are legitimate systems.
You can use stdenv.hostPlatform.emulator to get an executable that runs cross-built binaries. This could be any emulator. For instance, we use QEMU to emulate Linux targets and Wine to emulate Windows targets. To work with qemu, we need to support custom targets. I’ve reworked the cross tests in pkgs/test/cross to use this functionality. Also, I’ve used talloc to cross-execute with the emulator. There appears to be a cross-execute for all waf builds. In the future, it would be nice to set this for all waf builds. Adds stdenv.hostPlatform.qemuArch attrbute to get the qemuArch for each platform.
784ebd1
to
9c8fd41
Compare
Success on x86_64-linux (full log) Attempted: qemu, talloc Partial log (click to expand)
|
Success on aarch64-linux (full log) Attempted: qemu, talloc Partial log (click to expand)
|
I wonder if this can be used to help cross compile packages that use gobject-introspection. |
exeWrapper is based on meson's exe_wrapper idea. Basically, it will give you an emulator that can run whatever executable you want. It is useful for instance in "waf" build systems that expect a "--cross-execute" flag to run some configuration tests. We can use QEMU to emulate Linxux systems. On windows systems we can use WINE.
I am hoping this is useful in more things, for instance running, some tests in the emulator when doing cross compilation.
The QEMU system should be able to run Linux. Running
pkgs.exeWrapper { config = "aarch64-unknown-linux-gnu"; }
, will give you a bash script to emulate an aarch64 system. I have already rewritten the Nixpkgs cross tests to use this (and can probably add them to release-cross.nix).