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
treewide: with stdenv.lib; in meta -> with lib; #108978
Conversation
Strategies used to sanity check the changes involve using a script to randomly evaluate packages, so all important packages should still evaluate.
Some leaf packages might have problems if they don’t follow the |
The output of
shows that there are only a few files which got more than two lines of changes. |
Good to know. Following. |
EditorCheck fails with |
Couldn't you test it by generating all the drvs and making sure they're invariant? This should apply generally to refactorings that should not change semantics. I don't know if generating all drvs is hard or something but if yes, https://discourse.nixos.org/t/using-nixos-in-an-isolated-environment/3369 is probably relevant. |
ecea912
to
8d15008
Compare
I did a dudu while rebasing, I think it’s fixed now. |
8d15008
to
ed6e00d
Compare
Thanks to @cole-h running the ofborg check locally, full evaluation should now work again. |
Waiting for ofborg eval to be green, then rebasing & merging (otherwise there will be new merge conflicts before ofborg evals) |
Part of: NixOS#108938 meta = with stdenv.lib; is a widely used pattern. We want to slowly remove the `stdenv.lib` indirection and encourage people to use `lib` directly. Thus let’s start with the meta field. This used a rewriting script to mostly automatically replace all occurances of this pattern, and add the `lib` argument to the package header if it doesn’t exist yet. The script in its current form is available at https://cs.tvl.fyi/depot@2f807d7f141068d2d60676a89213eaa5353ca6e0/-/blob/users/Profpatsch/nixpkgs-rewriter/default.nix
ed6e00d
to
1a25769
Compare
ofborg takes a while to reach this eval in its queue, and then chickens out immediately if there is a merge conflict … we are running the https://github.com/nixos/ofborg#running-meta-checks-locally check on a big machine and will merge once that succeeds. |
Okay, ran the eval and made sure the check from above
proudces
|
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.
Ran the OfBorg checks locally. All good.
I think a pass with a secondary tool over files changed by this addressing left over |
This broke eval in |
A good idea -- but how (what is the incantation)? |
There's probably a better way, but:
|
And how do we know that there's an issue, given that loads of packages fail to evaluate (e.g. unfree and broken)? Is there some pattern that's easily greppable for? Running |
that's an excellent question :) |
An actual eval error will kill the evaluation. Note one should test |
I see. So as long as |
|
This fixes an evaluation error indroduced by NixOS#108978
This is a best-effort refactor as long as we don’t have well-documented ways of making sure the whole tree still evaluates. We used the ofborg check for that, running it locally. |
Part of: #108938
is a widely used pattern. We want to slowly remove
the
stdenv.lib
indirection and encourage peopleto use
lib
directly. Thus let’s start with the metafield.
This used a rewriting script to mostly automatically
replace all occurances of this pattern, and add the
lib
argument to the package header if it doesn’texist yet.
The script in its current form is available at
https://cs.tvl.fyi/depot@2f807d7f141068d2d60676a89213eaa5353ca6e0/-/blob/users/Profpatsch/nixpkgs-rewriter/default.nix
Motivation for this change
Things done
sandbox
innix.conf
on non-NixOS linux)nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
./result/bin/
)nix path-info -S
before and after)