nixos/version: Warn about using the default of system.stateVersion#124261
nixos/version: Warn about using the default of system.stateVersion#124261dasJ merged 3 commits intoNixOS:masterfrom
Conversation
|
I think this is worth backporting, since it prevents unexpected issues and otherwise does not have a negative impact. |
There was a problem hiding this comment.
This also throws a warning for all(?) NixOS tests.
I see a two of solutions:
- Explicitly set
stateVersionto the old default in the test builder - Add an option to specify that the system is only short-lived and should therefore not get this warning.
(+1 for the idea tho 👍🏻)
b1fc031 to
afb3ce9
Compare
|
@mweinelt Thanks, force pushed @Synthetica9 Can you point me in the right direction on where to set this in the test runner? I really have no idea where to look. Edit: Do I just add it to @NixOS/nixos-release-managers Do you think this should be backported to 21.05? (assuming I can get rid of the warnings in the tests) |
I think adding a new module to baseModules where you override the default should work, but I haven't tested that. |
|
Actually, you should probably add it to https://github.com/NixOS/nixpkgs/blob/master/nixos/modules/testing/test-instrumentation.nix: diff --git a/nixos/modules/testing/test-instrumentation.nix b/nixos/modules/testing/test-instrumentation.nix
index be5fa88b8ad..774738d0be1 100644
--- a/nixos/modules/testing/test-instrumentation.nix
+++ b/nixos/modules/testing/test-instrumentation.nix
@@ -129,6 +129,9 @@ with import ../../lib/qemu-flags.nix { inherit pkgs; };
# Make sure we use the Guest Agent from the QEMU package for testing
# to reduce the closure size required for the tests.
services.qemuGuest.package = pkgs.qemu_test.ga;
+
+ # Squelch warning about unset system.stateVersion
+ system.stateVersion = lib.trivial.release;
};
} |
|
Fixed and rebased |
afb3ce9 to
fe44f8c
Compare
fe44f8c to
4fd787a
Compare
Synthetica9
left a comment
There was a problem hiding this comment.
Good change, reducing the amount of footguns in NixOS
4fd787a to
9a4a241
Compare
I would say yes. This has only positive affects as long as ofborg is happy. |
|
@grahamc Any idea about the eval error? That would probably affect other PRs as well once this is merged |
|
@dasJ If you temporarily replace |
0ebbdd0 to
9a4a241
Compare
|
Nope, adding an assertion fixes the eval |
|
Weird, running |
|
Another idea: How about we temporarily drop the default and see if ofborg shows us a trace? |
48a93ad to
5f7a128
Compare
|
I'm out of ideas now |
|
@dasJ for https://github.com/NixOS/ofborg#running-meta-checks-locally I get the warning logged but no non-zero exit code (which may mean nothing as ofborg maybe parses that output somehow). I have no idea what that command does though so maybe that doesn't matter. It eats all your RAM btw (~32 GB or so). Edit: I'm pretty sure that's the offending command. |
5f7a128 to
53e0cd5
Compare
53e0cd5 to
0329256
Compare
|
Finally, ofborg succeeded 🎉 |
| system.nixos = dummyVersioning; | ||
| boot.loader.grub.enable = false; | ||
| fileSystems."/".device = "/dev/null"; | ||
| system.stateVersion = lib.trivial.release; |
There was a problem hiding this comment.
This one was redundant because of the default in test-instrumentation.nix. Removing in #171647.
see NixOS/nixpkgs#124261 for docker I had the choice between the image or the config, perhaps it makes more sens in the image ?
Motivation for this change
Using the default which switches every release is dangerous and potentially breaking when upgrading to a new release.
This should be required in the future but it will only be a warning for now.
Things done
sandboxinnix.confon non-NixOS linux)nix-shell -p nixpkgs-review --run "nixpkgs-review wip"./result/bin/)