tinymist: remove unused deps#396283
Conversation
GaetanLepage
left a comment
There was a problem hiding this comment.
Thanks!
I wonder though, can this tool tell if we include a dependency so that the one eventually vendored in the package itself is not used?
In this case, would the dependency be tagged as "unused"?
drupol
left a comment
There was a problem hiding this comment.
Why not ! If that still works, let's do it !
|
My tool does yield false-positives! Not all flagged dependencies are actually unused. Vendored blobs (copied instead of symlinked), runtime deps that are expected to be in the $PATH (e.g. capnp for pycapnp), or some edge cases in statical linking. Please ALWAYS check against upstream code, and ideally check why the dependency was first included in nix. The packages probably build when removing the flagged deps, but it is not entirely guaranteed, care needs to be taken. |
Understood, thanks for the clarification. In this case, |
|
Yes I know there might be false-positives. I just thought I'd give it a try and see if it still works. Only briefly have I skimmed through the upstream code though. Looking at why deps were added to a nix package is a good call, I should have done that as well! Thanks @LordGrimmauld ! |
|
I am happy people are excited about cleanup work, this was my intention - but only as long as nothing breaks. Good tools are not an excuse for cheaping out on due diligence. But thanks for giving my tool a spin and understanding the limitations, have fun hunting dead code :) |
|
For future reference, i have added a checklist to my tool describing reasonable steps to ensure nothing breaks: https://github.com/LordGrimmauld/nix-check-deps?tab=readme-ov-file#guidelines-when-contributing-cleanup-work-to-nixpkgs |
Trying out https://github.com/LordGrimmauld/nix-check-deps I removed presumably unused deps.
Still builds and works fine as far as my testing goes.
Reviewing and testing would be appreciated.
Things done
nix.conf? (See Nix manual)sandbox = relaxedsandbox = truenix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage./result/bin/)Add a 👍 reaction to pull requests you find important.