Skip to content

Conversation

@booxter
Copy link
Contributor

@booxter booxter commented Sep 14, 2025

This commit was generated using:

github.com:booxter/nix-clean_with-lib/fix-with-lib-in-meta@6540275

--- before.json	2025-09-13 22:06:30
+++ after.json	2025-09-13 22:08:39
@@ -826078,7 +826078,7 @@
       "maintainersPosition": {
         "column": 5,
         "file": "/Users/ihrachyshka/src/nixpkgs/pkgs/by-name/ep/epoll-shim/package.nix",
-        "line": 41
+        "line": 42
       },
       "name": "epoll-shim-0.0.20240608",
       "outputsToInstall": [

Some stats from one of the recent commit hashes:

$ git rev-parse --short HEAD
a85985a1a6cf

$ git grep 'meta = with ' | wc -l
504

$ git checkout HEAD~

$ git grep 'meta = with ' | wc -l
18294

$ python -c 'print(f"%.4f" % (504./18294))'
0.0276

The PR was specifically crafted to hit zero rebuilds to allow for mechanical validation. You can reproduce the patch using the generation script located here.

Note to reviewers: I'm sure this PR will clash with other patches. I am happy to refresh it when someone is ready to mechanically review the PR and merge it. Let me know!

Things done

  • Built on platform:
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • Tested, as applicable:
  • Ran nixpkgs-review on this PR. See nixpkgs-review usage.
  • Tested basic functionality of all binary files, usually in ./result/bin/.
  • Nixpkgs Release Notes
    • Package update: when the change is major or breaking.
  • NixOS Release Notes
    • Module addition: when adding a new NixOS module.
    • Module update: when the change is significant.
  • Fits CONTRIBUTING.md, pkgs/README.md, maintainers/README.md and other READMEs.

Add a 👍 reaction to pull requests you find important.

@booxter booxter marked this pull request as draft September 14, 2025 01:29
@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. 10.rebuild-linux: 1 This PR causes 1 package to rebuild on Linux. 6.topic: emacs Text editor 6.topic: vim Advanced text editor 6.topic: nodejs Node.js is a free, open-source, cross-platform JavaScript runtime environment 6.topic: coq A formal proof management system 6.topic: cinnamon Desktop environment 6.topic: docker tools Open-source software for deploying and running of containerized applications 6.topic: R R is a programming language for statistical computing and data visualization. 6.topic: vscode A free and versatile code editor that supports almost every major programming language. 6.topic: jupyter Interactive computing tooling: kernels, notebook, jupyterlab 6.topic: COSMIC COSMIC is a software platform for designing beautiful user experiences labels Sep 14, 2025
This commit was generated using:

github.com:booxter/nix-clean_with-lib/fix-with-lib-in-meta@6540275
@nixpkgs-ci nixpkgs-ci bot added 12.approvals: 1 This PR was reviewed and approved by one person. 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin. 10.rebuild-linux: 0 This PR does not cause any packages to rebuild on Linux. and removed 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. 10.rebuild-linux: 1 This PR causes 1 package to rebuild on Linux. labels Sep 14, 2025
@booxter booxter marked this pull request as ready for review September 14, 2025 02:55
@nixpkgs-ci nixpkgs-ci bot added the 2.status: merge conflict This PR has merge conflicts with the target branch label Sep 14, 2025
Copy link
Contributor

@wolfgangwalther wolfgangwalther left a comment

Choose a reason for hiding this comment

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

I don't feel confident reviewing / approving this, because I can't come up with a way to verify the exclusion list - there could be other files that are just left broken. Unfortunately nix-env -qa doesn't recurse into everything. Also the script is quite complex and hard to verify - what scares me a bit is the part where a sanity check with nixfmt is run and the change reverted if that doesn't pass. This means the transformation is not perfect - which also means there could be bad transformations that don't show up as a syntax error.

Maybe @philiptaron feels more confident about this.

@wolfgangwalther
Copy link
Contributor

Here's a quick draft of a tiny first step of the approach I outlined on Matrix: technowledgy/refactor-tractor#14

Most of the code in there is glue and tests for the replacement. It's a rather simple treesitter query to replace only maintainers with lib.maintainers. The same can be done for various other fields easily. And then nixf-diagnose to clean up the unused with lib;. Personally, I'd trust that approach much more, because complexity of each step is much smaller.

@booxter
Copy link
Contributor Author

booxter commented Sep 14, 2025

@wolfgangwalther thanks for this. I'll take a look if I can instead contribute some rules there.

@booxter
Copy link
Contributor Author

booxter commented Sep 15, 2025

@booxter
Copy link
Contributor Author

booxter commented Sep 18, 2025

Gonna pursue the same via refactor-tractor: technowledgy/refactor-tractor#15

@booxter booxter closed this Sep 18, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

2.status: merge conflict This PR has merge conflicts with the target branch 6.topic: cinnamon Desktop environment 6.topic: coq A formal proof management system 6.topic: COSMIC COSMIC is a software platform for designing beautiful user experiences 6.topic: docker tools Open-source software for deploying and running of containerized applications 6.topic: emacs Text editor 6.topic: jupyter Interactive computing tooling: kernels, notebook, jupyterlab 6.topic: nodejs Node.js is a free, open-source, cross-platform JavaScript runtime environment 6.topic: R R is a programming language for statistical computing and data visualization. 6.topic: vim Advanced text editor 6.topic: vscode A free and versatile code editor that supports almost every major programming language. 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin. 10.rebuild-linux: 0 This PR does not cause any 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