New command-not-found handler for openSUSE
Hello, 15 years ago Pavol Rusnak and I wrote the command-not-found handler. We had a lot of ideas about what could be indexed and searched back then. But nothing really materialised. I like the honest comment in https://github.com/openSUSE/scout/
Many of its data sources have been discontinued, so currently its most important use is to print useful messages about packages when a command is not found in the shell.
I've switched to MicroOS Desktop and use distroboxes a lot. And I am less and less willing to install Python just for this simple functionality. So in order to deal with my old sins and also to have some fun with a hacking something, let me introduce you to https://github.com/vyskocilm/cnf-rs It is an almost 100% compatible replacement of the Python code written in Rust and using libsolv.a under the hood. This means that it reads the same package database as zypper does. My end goal here is to push it into the openSUSE itself and to deprecate the scout. Let me know what you think about it.
On 4/13/23 12:43, Michal Vyskocil wrote:
Hello,
15 years ago Pavol Rusnak and I wrote the command-not-found handler. We had a lot of ideas about what could be indexed and searched back then. But nothing really materialised. I like the honest comment in https://github.com/openSUSE/scout/ https://github.com/openSUSE/scout/
Many of its data sources have been discontinued, so currently its most important use is to print useful messages about packages when a command is not found in the shell.
I've switched to MicroOS Desktop and use distroboxes a lot. And I am less and less willing to install Python just for this simple functionality. So in order to deal with my old sins and also to have some fun with a hacking something, let me introduce you to
https://github.com/vyskocilm/cnf-rs https://github.com/vyskocilm/cnf-rs
It is an almost 100% compatible replacement of the Python code written in Rust and using libsolv.a under the hood. This means that it reads the same package database as zypper does. My end goal here is to push it into the openSUSE itself and to deprecate the scout.
Let me know what you think about it.
Michal, My build failed. The last lines output were Compiling lazycell v1.3.0 Compiling configparser v3.0.2 Compiling cnf-rs v0.1.0 (/home/finger/cnf-rs) error: failed to run custom build command for `cnf-rs v0.1.0 (/home/finger/cnf-rs)` Caused by: process didn't exit successfully: `/home/finger/cnf-rs/target/debug/build/cnf-rs-cd50b687112deb97/build-script-build` (exit status: 101) --- stdout cargo:rustc-link-search=/usr/lib64 cargo:rustc-link-lib=static=solv cargo:rerun-if-changed=wrapper.h cargo:rerun-if-env-changed=TARGET cargo:rerun-if-env-changed=BINDGEN_EXTRA_CLANG_ARGS_x86_64-unknown-linux-gnu cargo:rerun-if-env-changed=BINDGEN_EXTRA_CLANG_ARGS_x86_64_unknown_linux_gnu cargo:rerun-if-env-changed=BINDGEN_EXTRA_CLANG_ARGS --- stderr wrapper.h:1:10: fatal error: 'solv/pool.h' file not found thread 'main' panicked at 'Unable to generate bindings: ClangDiagnostic("wrapper.h:1:10: fatal error: 'solv/pool.h' file not found\n")', build.rs:42:10 note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace I could not find an uninstalled package on Tumbleweed with a file "pool.h". Larry
Yes, I forgot to mention the need for a devel package installed. Thanks for
correcting it
Dne čt 13. 4. 2023 20:36 uživatel Javier Llorente
El jueves, 13 de abril de 2023 20:18:36 (CEST) Larry Finger escribió:
I could not find an uninstalled package on Tumbleweed with a file "pool.h".
I think you have to install libsolv-devel.
Greetings, -- Javier Llorente
W dniu 13.04.2023 o 19:43, Michal Vyskocil pisze:
[...] let me introduce you to
https://github.com/vyskocilm/cnf-rs https://github.com/vyskocilm/cnf-rs
It is an almost 100% compatible replacement of the Python code written in Rust and using libsolv.a under the hood. This means that it reads the same package database as zypper does. My end goal here is to push it into the openSUSE itself and to deprecate the scout.
Let me know what you think about it.
I think you should KICK ASS! https://hennevogel.de/blog/kick-ass.html
On Thursday 2023-04-13 23:14, Adam Mizerski wrote:
W dniu 13.04.2023 o 19:43, Michal Vyskocil pisze:
[...] let me introduce you to
https://github.com/vyskocilm/cnf-rs https://github.com/vyskocilm/cnf-rs
It is an almost 100% compatible replacement of the Python code written in Rust and using libsolv.a under the hood. This means that it reads the same package database as zypper does. My end goal here is to push it into the openSUSE itself and to deprecate the scout.
Let me know what you think about it.
I think you should KICK ASS! https://hennevogel.de/blog/kick-ass.html
On 13/04/2023 19.43, Michal Vyskocil wrote:
Let me know what you think about it.
I would be happy to have one less package to maintain. My only concern is about that tendency of rust packages to pull megabytes of dependencies into a vendor.tar that then never get updated and thus keep all of the bugs that were long fixed upstream. Ciao Bernhard M.
On Sat, Apr 15, 2023 at 4:50 AM Bernhard M. Wiedemann via openSUSE Factory < factory@lists.opensuse.org> wrote:
My only concern is about that tendency of rust packages to pull megabytes of dependencies into a vendor.tar that then never get updated and thus keep all of the bugs that were long fixed upstream.
Yeah... and it still has unsafe code blocks.. that can still blow up.
"Bernhard M. Wiedemann via openSUSE Factory"
On 13/04/2023 19.43, Michal Vyskocil wrote:
Let me know what you think about it.
I would be happy to have one less package to maintain.
My only concern is about that tendency of rust packages to pull megabytes of dependencies into a vendor.tar that then never get updated and thus keep all of the bugs that were long fixed upstream.
That's why we added dependabot so that the dependencies will get
automatically updated.
Cheers,
Dan
--
Dan Čermák
Hi all,
I managed to refresh my already rusted packaging skills and have cnf-rs
packaged and ready for testing.
sudo zypper ar
https://download.opensuse.org/repositories/home:/mvyskocil/openSUSE_Tumblewe...
sudo zypper in cnf-rs-bash
source /etc/bash.bashrc
will do the job. Note this will REMOVE the existing handler. There's a
cnf-rs-zsh with a zsh integration too.
I have changed the bash handler so it always runs. The zsh one did that
already. The slowdown is around 100ms in my setup. Happy to
discuss the scheme to make it more configurable.
My next plan is to take a look at existing translations and manual pages
before proceeding into openSUSE:Factory.
Bye for now
Michal
On Sun, Apr 16, 2023 at 10:04 PM Dan Čermák
"Bernhard M. Wiedemann via openSUSE Factory"
writes: On 13/04/2023 19.43, Michal Vyskocil wrote:
Let me know what you think about it.
I would be happy to have one less package to maintain.
My only concern is about that tendency of rust packages to pull megabytes of dependencies into a vendor.tar that then never get updated and thus keep all of the bugs that were long fixed upstream.
That's why we added dependabot so that the dependencies will get automatically updated.
Cheers,
Dan
-- Dan Čermák
Software Engineer Development tools SUSE Software Solutions Germany GmbH Frankenstrasse 146 90461 Nürnberg Germany (HRB 36809, AG Nürnberg) Managing Director/Geschäftsführer: Ivo Totev, Andrew Myers, Andrew McDonald, Boudien Moerman
participants (8)
-
Adam Mizerski
-
Bernhard M. Wiedemann
-
Cristian Rodríguez
-
Dan Čermák
-
Jan Engelhardt
-
Javier Llorente
-
Larry Finger
-
Michal Vyskocil