NixOS/nixpkgs

`runNixOSTest` fails on Darwin (` tests.testers.runNixOSTest-example` fails to build)

ShamrockLee opened this issue · 6 comments

Describe the bug

#282401 should have made NixOS Tests available on Darwin. This should include package tests produced via tester runNixOSTest, but the OfBorg build result shows it isn't. An example is tests.testers.runNixOSTest-example

error: a 'x86_64-linux' with features {} is required to build '/nix/store/rsjmz848mv48kil2s92vnzy4n7q53rcz-builder.pl.drv', but I am a 'aarch64-darwin' with features {benchmark, big-parallel, nixos-test}

See the OfBorg test result in #292759.

Steps To Reproduce

Steps to reproduce the behavior on MacOS:

  1. Set up Nix on MacOS
  2. git clone https://github.com/NixOS/nixpkgs.git
  3. cd nixpkgs
  4. Checkout commit
  5. Build tests.testers.runNixOSTest-example
  6. See build failure

Steps to reproduce the behavior on GitHub:

  1. Go to #292759 or any PR targeting the Nixpkgs master branch.
  2. Comment @ofborg build tests.testers.runNixOSTest-example

Expected behavior

Package tests written by testers.runNixOSTest, including tests.testers.runNixOSTest-example, should run on MacOS. Related OfBorg build should be green.

Screenshots

OfBorg build failure of tests.testers.runNixOSTest-example on x86_64-darwin from #292759

Additional context

OfBorg build log links:

Notify maintainers

@Gabriella439

Metadata

Please run nix-shell -p nix-info --run "nix-info -m" and paste the result.

[user@system:~]$ nix-shell -p nix-info --run "nix-info -m"
output here

Add a 👍 reaction to issues you find important.

The macOS support for NixOS tests only adds support for running them but not building them. You still need access to a Linux builder to build those tests.

Thanks for the quick response!

The macOS support for NixOS tests only adds support for running them but not building them. You still need access to a Linux builder to build those tests.

What's the difficulty to build NixOS tests on macOS? Isn't it just a QEMU virtual machine?

It is possible to build Linux products on NixOS using something like darwin.linux-builder but we don't yet have a way to do that in the course of a Nix build. See:

https://nixos.org/manual/nixpkgs/unstable/#sec-darwin-builder