Repository navigation
nixosTests: pass thru pkgs when available - #331873
Conversation
b0cab54 to
94b5e98
Compare
94b5e98 to
c6b49aa
Compare
tomberek
left a comment
There was a problem hiding this comment.
@infinisil please review as this changes how pkgs is injected into module evaluation
c6b49aa to
cb0fd81
Compare
|
Thank you on behalf of @dramforever and PLCT lab! |
There was a problem hiding this comment.
I have a minor suggestion, but this looks good to me, though I don't fully understand this fully
This allows for being able to test cross compilation, musl, LLVM, static nixpkgs, etc.
Could you give an example of what's now possible with this? And couldn't one set nixpkgs.pkgs to also achieve this?
Oh and ping @roberth
You can now try building all tests in |
cb0fd81 to
4e5f70d
Compare
roberth
left a comment
There was a problem hiding this comment.
Unfortunately this stuff has a long history.
OT: I think there's still opportunity to simplify things on the NixOS "core" side.
Perhaps the normal nixpkgs.nix module could integrate the "read only" functionality after system/crossSystem/localSystem are deprecated.
Right now that's the added complexity of those legacy parameters makes that rather difficult, not impossible, but difficult and hard to review.
There was a problem hiding this comment.
pkgsis a redundant argument we might want to get rid of; see comment ineval-config.nix- use the option instead- It'd be good to make sure we're not accidentally ignoring any of the
nixpkgs.*settings by making them read-only. systemis also redundant, because it's only needed for creating apkgs, which we already have.
| inherit system pkgs; | |
| modules = [ | |
| modules = [ | |
| { nixpkgs.pkgs = pkgs; } | |
| ../modules/misc/nixpkgs/read-only.nix |
(Same applies to the other eval-config.nix calls)
There was a problem hiding this comment.
Alright, I've made that change
There was a problem hiding this comment.
Removing system causes this:
error: The option `nixpkgs.system' does not exist. Definition values:
- In `/nix/store/fqjbkkwvb4h14bb4vl9pb28pja11bpcv-source/nixos/lib/eval-config.nix':
{
_type = "override";
content = "aarch64-linux";
priority = 1000;
}
There was a problem hiding this comment.
I guess that could be prevented by passing system = null; to eval-config.nix, but at that point we're adding too much boilerplate in my opinion. Let's postpone my proposal for when we have a nice and clean entrypoint. (in nixos/lib/default.nix?)
There was a problem hiding this comment.
Yeah, that fixed it.
4e5f70d to
5a387dc
Compare
There was a problem hiding this comment.
Probably my suggestion was wrong. This undoes the optimization for tests that have node.pkgsReadOnly = true;; the opposite of your intent.
I think you can just revert this chunk, ie leave nodes.nix as is.
There was a problem hiding this comment.
Alright, reverted.
703bfce to
2dd7550
Compare
roberth
left a comment
There was a problem hiding this comment.
Looks good in principle. What are the attributes to pass to ofborg?
|
I'm not sure, I think we can just get away with at least only running the boot tests. The other changes are probably trivial enough that it wouldn't be a concern not to run them. |
2dd7550 to
727fafa
Compare
|
This PR has been rebased, going to spin up the tests and see if this works. |
|
✔️ |
|
Woops, this broke pure eval. Let's fix it in #404284. |
Description of changes
Passes
pkgsthrough to eacheval-config.niximport to ensure the tests contains the suppliedpkgs. This allows for being able to test cross compilation, musl, LLVM, static nixpkgs, etc.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.