APK --force-broken-world shouldn't default to a soluton where the package I'm targeting is simply uninstalled
This concerns apk, packaged as apk-tools 2.14.0 on current stable postmarketOS 23.06 as of 2023-12-28.
Let me demonstrate, steps to reproduce (this breaks your packages!!! Reasoning however is explained below):
- Install postmarketOS 23.06 stable, not edge, as found today 2023-12-28 with no later service packs or updates.
- In a terminal, run:
wget https://gitlab.gnome.org/GNOME/gnome-system-monitor/uploads/d3d43f1845d021eee2b1217cc7776607/gnome-system-monitor-45.0.2_p1-r1.apk
(for what it's worth, info about the package source: https://gitlab.gnome.org/GNOME/gnome-system-monitor/-/merge_requests/112#note_1955032 ) - In a terminal run (super unsafe, at your own risk):
sudo apk add --allow-untrusted gnome-system-monitor-45.0.2_p1-r1.apk
which shouldn't work, but rather give you a dependency error:ERROR: unable to select packages: so:libc.musl-x86_64.so.1 (no such package)
- In a terminal run (extremely unsafe and breaks your system):
sudo apk add --allow-broken-world --allow-untrusted gnome-system-monitor-45.0.2_p1-r1.apk
Now what happens, why is that unexpected, and what did I expect instead:
As a result of the last command, apk simply removed gnome-system-monitor as a program entirely from the system. This doesn't seem like a useful or expected behavior to me for this command. To explain my reasoning, I made a risky guess that maybe despite the dependency on the newer musl libc, the given package would maybe manage to run fine with the older one. I was willing to accept crashes and issues due to this, so my intention here was "please proceed even if the dependencies can't be fully satisfied". That seems to be what --force-broken-world
suggests it would do.
The current behavior however doesn't seem useful in any scenario I can think of since it seems to be the equivalent of apk del --purge gnome-system-monitor
which I could have just run instead, and effectively it doesn't even seem to touch or use the apk file I pointed it to. That seems kind of nonsensical, since if I want to convince it to do something with the given package on disk, an operation that ends up not using it doesn't really seem to be what a user would be after.