-
-
Notifications
You must be signed in to change notification settings - Fork 14.6k
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
nixos: Make 'nesting.clone' work in NixOS tests #62069
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Because nesting.clone calls 'eval-config.nix' manually, without the 'extraArgs' argument that provides the 'nodes' argument to nixos modules in nixos tests, evaluating of 'nesting.clone' definitions would fail with the following error while evaluating the module argument `nodes' in "<redacted>" while evaluating the attribute '_module.args.nodes' at undefined position: attribute 'nodes' missing, at <redacted./nixpkgs/lib/modules.nix:163:28 by not using 'extraArgs' but a nixos module instead, the nodes parameter gets propagated to the 'eval-config.nix' call that 'nesting.clone' makes too - getting rid of the error. See https://github.com/NixOS/nixpkgs/blob/master/nixos/modules/system/activation/top-level.nix#L13-L23 See https://github.com/NixOS/nixpkgs/blob/master/nixos/lib/build-vms.nix#L27 See NixOS#20886 (comment)
ofborg
bot
added
the
6.topic: nixos
Issues or PRs affecting NixOS modules, or package usability issues specific to NixOS
label
May 25, 2019
This is actually very useful. Allows you to test switch-to-configuration nesting.children is still currently still broken as it will throw away 'too much' of the config, including the modules that make nixos tests work in the first place. But that's something for another time.
arianvp
force-pushed
the
fix-nesting-clone
branch
from
May 25, 2019 22:37
99cd01e
to
a48047a
Compare
This is sort of a solution to #20886 I think |
ofborg
bot
added
10.rebuild-darwin: 0
This PR does not cause any packages to rebuild on Darwin
10.rebuild-linux: 0
This PR does not cause any packages to rebuild on Linux
labels
May 25, 2019
cc @danbst |
aszlig
approved these changes
May 25, 2019
@GrahamcOfBorg test nesting |
1 similar comment
@GrahamcOfBorg test nesting |
danbst
reviewed
May 29, 2019
danbst
approved these changes
May 29, 2019
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.
I think this is fine. I've did exactly same in test for https://github.com/NixOS/nixpkgs/pull/57429/files
We differentiate between modules and baseModules in the VM builder for NixOS tests. This way, nesting.children, eventhough it doesn't inherit from parent, still has enough config to actually complete the test. Otherwise, the qemu modules would not be loaded, for example, and a nesting.children statement would not evaluate.
arianvp
force-pushed
the
fix-nesting-clone
branch
from
May 29, 2019 10:51
c8fd4a9
to
cbc45b5
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
6.topic: nixos
Issues or PRs affecting NixOS modules, or package usability issues specific to NixOS
10.rebuild-darwin: 0
This PR does not cause any packages to rebuild on Darwin
10.rebuild-linux: 0
This PR does not cause any packages to rebuild on Linux
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Because nesting.clone calls 'eval-config.nix' manually,
without the 'extraArgs' argument that provides the 'nodes'
argument to nixos modules in nixos tests, evaluating
of 'nesting.clone' definitions would fail with the following error
while evaluating the module argument `nodes' in ""
while evaluating the attribute '_module.args.nodes' at undefined position:
attribute 'nodes' missing, at <redacted./nixpkgs/lib/modules.nix:163:28
by not using 'extraArgs' but a nixos module instead, the nodes parameter
gets propagated to the 'eval-config.nix' call that 'nesting.clone'
makes too - getting rid of the error.
See https://github.com/NixOS/nixpkgs/blob/master/nixos/modules/system/activation/top-level.nix#L13-L23
See https://github.com/NixOS/nixpkgs/blob/master/nixos/lib/build-vms.nix#L27
See #20886 (comment)
Motivation for this change
Things done
sandbox
innix.conf
on non-NixOS)nix-shell -p nix-review --run "nix-review wip"
./result/bin/
)nix path-info -S
before and after)