Skip to content

lib: cleanup after bump of minver#433101

Merged
wolfgangwalther merged 2 commits intoNixOS:masterfrom
wolfgangwalther:minver-cleanup-master
Aug 22, 2025
Merged

lib: cleanup after bump of minver#433101
wolfgangwalther merged 2 commits intoNixOS:masterfrom
wolfgangwalther:minver-cleanup-master

Conversation

@wolfgangwalther
Copy link
Contributor

@wolfgangwalther wolfgangwalther commented Aug 12, 2025

In #428076, we raised lib/minver.nix to 2.18. This allows some cleanup around lib.fileset. The cleanup in lib/customisation was probably already possible before.

Things done


Add a 👍 reaction to pull requests you find important.

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.
@nixpkgs-ci nixpkgs-ci bot added 10.rebuild-linux: 1-10 This PR causes between 1 and 10 packages to rebuild on Linux. 10.rebuild-darwin: 1-10 This PR causes between 1 and 10 packages to rebuild on Darwin. 10.rebuild-darwin: 1 This PR causes 1 package to rebuild on Darwin. 6.topic: lib The Nixpkgs function library labels Aug 12, 2025
Copy link
Member

@emilazy emilazy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

sternenseemann added a commit to sternenseemann/nix that referenced this pull request Aug 14, 2025
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.
@wolfgangwalther wolfgangwalther mentioned this pull request Aug 14, 2025
13 tasks
sternenseemann added a commit to sternenseemann/nix that referenced this pull request Aug 14, 2025
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.
@nixpkgs-ci nixpkgs-ci bot added the 12.approvals: 1 This PR was reviewed and approved by one person. label Aug 17, 2025
@wolfgangwalther wolfgangwalther merged commit be6f781 into NixOS:master Aug 22, 2025
33 of 34 checks passed
@wolfgangwalther wolfgangwalther deleted the minver-cleanup-master branch August 22, 2025 10:41
in
"Function called without required argument \"${arg}\" at "
+ "${loc'}${prettySuggestions (getSuggestions arg)}";
+ "${loc.file}:${loc.line}${prettySuggestions (getSuggestions arg)}";
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like we just missed that it still needs toString. I'll open a PR

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That looks like a string to me:

nix-repl> builtins.unsafeGetAttrPos "meta" hello
{
  column = 17;
  file = "[...]/pkgs/stdenv/generic/make-derivation.nix";
  line = 881;
}

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sternenseemann added a commit to sternenseemann/nix that referenced this pull request Sep 1, 2025
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.
tazjin pushed a commit to tvlfyi/nix that referenced this pull request Sep 2, 2025
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

6.topic: lib The Nixpkgs function library 10.rebuild-darwin: 1-10 This PR causes between 1 and 10 packages to rebuild on Darwin. 10.rebuild-darwin: 1 This PR causes 1 package to rebuild on Darwin. 10.rebuild-linux: 1-10 This PR causes between 1 and 10 packages to rebuild on Linux. 12.approvals: 1 This PR was reviewed and approved by one person.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants