Hacker News new | ask | show | jobs
by thrwawy283 1558 days ago
This is an aside, but I've been watching all the audio graph editor projects pop up and it's made me realize I want something like this for package management. A package maintainer should be able to specify something is a dev dependency, runtime dependency. I should be able to form a "user dependency" where I say Xwayland depends on sway - even though it doesn't. So when I remove sway it pulls out Xwayland with it. I should be able to remove dependencies within package descriptions, and see that one used to exist but has been overridden by me. I'd love to even see the history of how that graph has changed over time (step through package adds/removes). Further filter by package source to visualize the network clouds.

I want to visualize all of these dependencies as a graph, instead of trying to hamstring things together with CLI invocations. Editing the graph would invoke the package manager.

4 comments

The standard way of doing this is to define your own package for what you want installed on the system. Check in the package spec to version control and it gives you the history of everything you wanted in the past. For your sway-xwayland case, make another package that depends on both, and make that a dependency of your system package instead of sway and xwayland directly.

You will also need to use your package manager's method of marking all packages as "automatically installed" except for your system package. How easy this is depends on the package manager. Eg for Alpine's apk this is trivial, because all packages are "automatically installed" unless they're listed in /etc/apk/world, but for OpenSUSE's zypper you need to update /var/lib/zypp/AutoInstalled to include every installed package and periodically refresh it when zypper decided to switch an automatically-installed package to manually-installed for some reason.

You can visualize dependencies as a graph with Guix out of the box [1]. While you can't easily setup "user dependencies" (except by editing the package definition) you can create profiles that install packages from a manifest file so you could have a profile with a manifest with xwayland and sway and then simply remove the profile if not needed. Guix already specifies runtime/dev dependencies.

[1]: https://guix.gnu.org/manual/en/html_node/Invoking-guix-graph...

That is definitely close to what I'm thinking of. What I was trying to say is our 1st reach should be for a graph editor. Behind the scenes it may break down to a command line program, but what you'd deal with all the time is the graph editor that you can mouse around and zoom in/out on, and add/remove edges between nodes/packages. That would be a neat experience.
I think Alpine can do what you're asking for using virtual packages (which is basically just a label that you apply to say "the following packages are a group to be installed and removed together"): https://docs.alpinelinux.org/user-handbook/0.1a/Working/apk....
A functional package manager like nixos or guix might be a good place to start.