lib: cleanup after bump of minver#433101
Conversation
This could have been done a while ago, minver has been > 2.3.4 for quite some time already.
minver is now at 2.18, which means that `fetchGit` support shallow clones and submodules for sure.
emilazy
left a comment
There was a problem hiding this comment.
Looks like nothing here will break the minver check code path (which I think is important to keep working on 2.3 for now).
BTW, maybe we should add a check to other entry points like nixos/{default,eval-config}.nix and the flake.
See NixOS/nixpkgs@fa0cba1. Note that NixOS/nixpkgs#433101 will likely require backporting further changes from later C++ Nix versions in order to keep things working.
See NixOS/nixpkgs@fa0cba1. We'll see how dependent nixpkgs will grow on newer and features and how feasible it is to continue using Nix 2.3. The compat code that will be immediately removed looks like it doesn't actually affect Nix 2.3.18 which already had some fixes backported: - NixOS/nixpkgs#433101. Some features of fileset won't work anymore, but fileset is disallowed in nixpkgs anyways. The documentation workaround only affects Nix < 2.3.5. - NixOS/nixpkgs#433055. The fix for NIX_ATTRS_* has been backported to Nix 2.3.18.
| in | ||
| "Function called without required argument \"${arg}\" at " | ||
| + "${loc'}${prettySuggestions (getSuggestions arg)}"; | ||
| + "${loc.file}:${loc.line}${prettySuggestions (getSuggestions arg)}"; |
There was a problem hiding this comment.
Looks like this change doesn't quite work, yet. The error message in https://github.com/NixOS/nixpkgs/actions/runs/17161276034/job/48690946895 is:
… while evaluating a path segment
at /nix/store/jabhxzs8rhw9gv4y7vlz4qrd85rsi9qv-source/lib/customisation.nix:290:24:
289| "Function called without required argument \"${arg}\" at "
290| + "${loc.file}:${loc.line}${prettySuggestions (getSuggestions arg)}";
| ^
291|
error: cannot coerce an integer to a string: 9
There was a problem hiding this comment.
Looks like we just missed that it still needs toString. I'll open a PR
There was a problem hiding this comment.
Looking closer, I'm also skeptical of directly interpolating loc.file. Is it guaranteed to be a string not a path value?
If it's a path value then direct interpolation would result in creating a new store object.
There was a problem hiding this comment.
That looks like a string to me:
nix-repl> builtins.unsafeGetAttrPos "meta" hello
{
column = 17;
file = "[...]/pkgs/stdenv/generic/make-derivation.nix";
line = 881;
}
There was a problem hiding this comment.
That looks like a string to me:
Ah for some reason I had the module system in mind, where I'm not sure if _file is allowed to be a path value.
If unsafeGetAttrPos always uses a string for file, consistently accross versions/implementations, then I guess we don't need to toString or + it.
See NixOS/nixpkgs@fa0cba1. We'll see how dependent nixpkgs will grow on newer and features and how feasible it is to continue using Nix 2.3. The compat code that will be immediately removed looks like it doesn't actually affect Nix 2.3.18 which already had some fixes backported: - NixOS/nixpkgs#433101. Some features of fileset won't work anymore, but fileset is disallowed in nixpkgs anyways. The documentation workaround only affects Nix < 2.3.5. - NixOS/nixpkgs#433055. The fix for NIX_ATTRS_* has been backported to Nix 2.3.18.
See NixOS/nixpkgs@fa0cba1. We'll see how dependent nixpkgs will grow on newer and features and how feasible it is to continue using Nix 2.3. The compat code that will be immediately removed looks like it doesn't actually affect Nix 2.3.18 which already had some fixes backported: - NixOS/nixpkgs#433101. Some features of fileset won't work anymore, but fileset is disallowed in nixpkgs anyways. The documentation workaround only affects Nix < 2.3.5. - NixOS/nixpkgs#433055. The fix for NIX_ATTRS_* has been backported to Nix 2.3.18.
In #428076, we raised
lib/minver.nixto 2.18. This allows some cleanup aroundlib.fileset. The cleanup inlib/customisationwas probably already possible before.Things done
Add a 👍 reaction to pull requests you find important.