nixos/testing: Add onVMHost attribute to all tests#423276
nixos/testing: Add onVMHost attribute to all tests#423276roberth wants to merge 2 commits intoNixOS:masterfrom
onVMHost attribute to all tests#423276Conversation
This is useful for repeated ad hoc usage of a package set, as in NixOS#423276
|
I'm thinking about how to use this while developing for linux from darwin. Am I going to think about anything "cross" or am I thinking "native linux" instead? What I'm after is: Could
Also I wonder how this "is for linux" comes into play. How would this look like in practice, aka a full call? Just to get an idea of how confusing that might be. |
Complete example:
No. "VM Host" is one term here, and it's the same "host" as in |
The interaction between
pkg.override*and alternate VM hosts does not work.Concretely, if I'm using Darwin, and I'm developing a patch to a linux package, I'd want to do
(pkg.overrideAttrs someFunction).tests, but this does not work, because that will (have to) use the Linux version of the package, whereas we've added our patch (insomeFunction) to a Darwin instantiation of the package.The test framework can compensate for this.
Instead, with this PR, you could override the Linux package, and then build something like
(pkg.overrideAttrs someFunction).tests.nixos.onVMHost.aarch64-darwin(wherepkgis for Linux).Things done
nix.conf? (See Nix manual)sandbox = relaxedsandbox = truenix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage./result/bin/)Add a 👍 reaction to pull requests you find important.