Also migrates away from them with these commands, using ast-grep 0.43.0
with these commands in bash (assisted by ChatGPT):
```bash
for old in extractType1 extractType2; do
ast-grep \
--lang nix \
--pattern "\$TOOLS.$old" \
--rewrite '$TOOLS.extract' \
--update-all \
pkgs
done
ast-grep \
--lang nix \
--pattern '$TOOLS.wrapType1' \
--rewrite '$TOOLS.wrapType2' \
--update-all \
pkgs
```
Assisted-by: GPT-5.6-Sol Medium via ChatGPT
This commit was created by a combination of scripts and tools:
- an ast-grep script to prefix things in meta with `lib.`,
- a modified nixf-diagnose / nixf combination to remove unused `with
lib;`, and
- regular nixfmt.
Co-authored-by: Wolfgang Walther <walther@technowledgy.de>
This reverts commit 65a333600d.
This wasn't tested for correctness with something like fodwatch [0],
and should not have been (self-)merged so quickly, especially without
further review.
It also resulted in the breakage of at least one package [1] (and that's
the one we know of and was caught).
A few packages that were updated in between this commit and this revert
were not reverted back to using `rev`, but other than that, this is a
1:1 revert.
[0]: https://codeberg.org/raphaelr/fodwatch
[1]: https://github.com/NixOS/nixpkgs/pull/396904 / 758551e458
- add patch fixing gcc14 errors:
`implicit-int`:
```
rpc_tab.c:1:8: error: type defaults to 'int' in declaration of
'elide_trace_reduce' [-Wimplicit-int]
1 | extern elide_trace_reduce(int, int);
| ^~~~~~~~~~~~~~~~~~
rpc_tab.c:2:8: error: type defaults to 'int' in declaration of
'elide_trace_shift' [-Wimplicit-int]
2 | extern elide_trace_shift(int,int);
| ^~~~~~~~~~~~~~~~~
rpc_tab.c:3:8: error: type defaults to 'int' in declaration of
'report_trace_shift' [-Wimplicit-int]
3 | extern report_trace_shift(int);
| ^~~~~~~~~~~~~~~~~~
rpc_tab.c:4:8: error: type defaults to 'int' in declaration of
'report_trace_reduce' [-Wimplicit-int]
4 | extern report_trace_reduce(int, int);
| ^~~~~~~~~~~~~~~~~~~
rpc_tab.c:5:8: error: type defaults to 'int' in declaration of
'report_trace_error' [-Wimplicit-int]
5 | extern report_trace_error(short *yyss, short *yyssp);
| ^~~~~~~~~~~~~~~~~~
```
`implicit-function-declaration`:
```
parse.tab.c: In function 'yyparse':
parse.tab.c:1148:16: error: implicit declaration of function 'yylex'
[-Wimplicit-function-declaration]
1148 | yychar = yylex ();
| ^~~~~
parse.tab.c:1595:7: error: implicit declaration of function 'yyerror';
did you mean 'yyerrok'? [-Wimplicit-function-declaration]
1595 | yyerror (YY_("syntax error"));
| ^~~~~~~
| yyerrok
n2d.c: In function 'main':
n2d.c:1529:12: error: implicit declaration of function 'yyparse'
[-Wimplicit-function-declaration]
1529 | result = yyparse();
| ^~~~~~~
```