make uninstall step based on inspecting install steps, rather than with "push installed file" mechanism
Extracted from #14647.
The way that zig build uninstall works is broken with regards to packages. It needs to be audited and to be changed to a different strategy than the pushInstalledFile system that is currently in place. Instead it should figure out the installed file paths based on inspecting the install steps that were created from running the build() function.
IIUC, updating procedure would always be to uninstall the old version first, since the set of installed files might change due to the update.
I'm not sure if this is always a user-facing concern, or whether the package manager will have to care about this - maybe delegate to user if a to-be-updated package is detected to be installed?
(Can the build system detect whether a package is installed?
Also I assume that install may do more than just write files to a local zig-out directory - even though that's probably all my packages will ever do.)
Or on second thought maybe I'm conflating things, and install is supposed to be modular and play nice with nesting into other projects -> allow updates without uninstalling?
Then a separate system-install step could use custom logic for these things.