command-not-found: drop perl dependency#74789
Conversation
|
I tested |
There was a problem hiding this comment.
Is nixpkgs. correct here or should it be nixos.?
There was a problem hiding this comment.
nixpkgs., however it will become nixpkgs# in the future.
63c9a2e to
e416c35
Compare
e416c35 to
3233ca3
Compare
|
Small typo in commit subject. |
3233ca3 to
d131ccc
Compare
|
fixed |
|
This to me is not really an improvement: it replaces a 51-line Perl script with a 141-line C++ program. As an aside, if we really want to get rid of Perl, then Rust is the way to go IMHO. BTW, I think we can get rid of the auto-install feature, it was added as a bit of a joke and nobody uses it. |
There was a problem hiding this comment.
nix run should be avoided, it's experimental and won't work in Nix 2.4 unless you pass --experimental-features nix-command.
There was a problem hiding this comment.
@edolstra is this going away in future or when does it become stable?
There was a problem hiding this comment.
FYI, nix run is used a few places in nixpkgs (and the manual) already.
There was a problem hiding this comment.
Not only nix run also nix copy and nix build (for example in the installer).
There was a problem hiding this comment.
Yeah, we should replace those by nix-build etc. (or add --experimental-features nix-command to those invocations, but that's tricky because it could override the user's experimental-features setting).
There was a problem hiding this comment.
BTW, maybe we should get rid of NIX_AUTO_RUN as well, automatically downloading/running binaries is not a very secure thing to do...
There was a problem hiding this comment.
Let's say not safe instead of secure.
There was a problem hiding this comment.
These char * are a bit unidiomatic C++ IMHO.
There was a problem hiding this comment.
These are unnecessary, compilation will fail anyway if they're not defined.
d131ccc to
f012aa4
Compare
I choose C++:
I am not sure the Rust version would be much shorter. The C++ is now 99 lines compared to 55 lines Perl. But it also generates more error messages and starts faster. |
Faster startup and remove some perl packages from the default nixos closure. Eventually we could remove perl completely from the default nixos closure.
f012aa4 to
2ccb9f5
Compare
|
Old closure size: 82.9M New one is faster but it probably hardly matters: Old: New: The C++ program is now +28 lines longer. Does this looks fine now? |
|
-1 on removing NIX_AUTO_INSTALL, since I'm using it. Or at least remove it in a separate PR with a release note entry. |
|
I am fine with whatever the consensus is. |
|
BTW for the record, https://github.com/bennofs/nix-index#usage-as-a-command-not-found-replacement Though from my experience it feels somewhat slower to that of the original command-not-found implementation. |
|
There is also a rust version alternative: #88517 |
Faster startup and remove some perl packages from the default nixos closure.
Eventually we could remove perl completely from the default nixos closure.
It now also uses
nix runwhenNIX_AUTO_RUNis set.Motivation for this change
Things done
sandboxinnix.confon non-NixOS linux)nix-shell -p nix-review --run "nix-review wip"./result/bin/)nix path-info -Sbefore and after)Notify maintainers
cc @