-
Notifications
You must be signed in to change notification settings - Fork 7
Description
Hi,
Not that my opinion should count, but I thought why not let you know anyway.
I disliked how pkgx@2 is handling install/uninstall. For example, pkgm:
- Pollutes the system a lot more than before (
/usr/local/pkgs,/usr/local/lib,/usr/local/bin, maybe more?) - Makes it substantially harder to cleanup
- Makes it easy to break installations (if some of the dirs are removed, there won't be
pkgxto recover it) - Uses
sudowithout user consent, which makes me nervous as I often have systems with sudoNOPASSWD
Yeah, I know applications installed with pkgm do not depend on pkgx. But what for? To save 5MB in the whole system?
I thought the only pain-point of the pkgx@1 approach was the stubs speed. But that was solved with pkgx@2.
Why not make pkg@2/pkgm behave like pkgx@1 install used to?
- It's super quick to install (stubs)
- It doesn't download or consume disk until the program is actually used
- No crazy places to look for leftovers like
/usr/local/lib, users can peacefullyrm -rf "${PKGX_DIR:-"${HOME}/.pkgx"}"to free up disk without sacrificing anything at all
I use pkgx a lot in containers. In Dockerfiles, I use pkgx to ship stubs for applications that might be used. After installing the stubs, I can clean ~/.pkgx (and other dirs like ~/.cache/pkgx and ~/.local/share/pkgx) in the Dockerfile itself to guarantee the stubs are really only summing bytes to the final image size, without sacrificing functionality.
In fact, why not bring install/uninstall commands back into pkgx@2?
It would probably only add like 1KB in pkgx@2 binary size and yet would simplify things a lot:
Right now, to stub a program like go with pkgx mash pkgx/stub go, pkgx will have to download a hundred megabytes of stuff like deno and then deno will have to download the libraries, etc. And don't forget now there are additional places to clean up like ~/.cache/deno to bring the system back to a clean state.
I understand that X stands for execute in pkgx, and M stands for manage, separate responsibility, etc.
I also understand that install/uninstall in pkgx@1 were kinda hacky.
But also, I think pkgx aims to solve real-world challenges doing whatever it takes (like patching cargo in Pantry to install stuff to the right dir). Thus, an argument like that (keeping responsibility of code separated in different projects) doesn't makes sense in my opinion. That's oriented to the developers of pkgx only, not to users.
What if we can think of a future-proof, stable, install/uninstall solution based on stubs that wouldn't be hacky? I'm confident we can build something (example). Even for Windows.
Or just feel free to disregard this completely. No hard feelings. I'm very thankful anyway.