apk doesn't handle upgrades correctly when old dep versions are still available in repository
We’ve just released Adélie 1.0-BETA3, and due to that, we have lots of people upgrading their computers… we’ve had at least three cases so far today where there’s been the same error:
ERROR: unsatisfiable constraints: harfbuzz-icu-1.8.8-r1: breaks: harfbuzz-dev-2.4.0-r0[harfbuzz-icu=2.4.0-r0] libpcrecpp-8.42-r1: breaks: pcre-dev-8.43-r0[libpcrecpp=8.43-r0]
All of these cases are when qt5-qtbase-dev (or another Qt 5 development package) is installed. This helpfully included our primary web server, which has only adelie-base, apache-httpd, and qt5-qtbase-dev installed. I enabled DEBUG_PRINT in apk/solver.c, rebuilt, and tried again with this custom apk-tools build. Output is included in the attached 1.33 MB log file.
In the middle you find this chunk:
select_package: harfbuzz-icu (requirers=1, iif=0) consider harfbuzz-icu-1.8.8-r1 iif_triggered=0, tag_ok=1, selectable=1, provider_priority=0, installed=1 consider harfbuzz-icu-2.3.1-r0 iif_triggered=0, tag_ok=1, selectable=1, provider_priority=0, installed=0 consider harfbuzz-icu-2.4.0-r0 iif_triggered=0, tag_ok=1, selectable=1, provider_priority=0, installed=0 selecting: harfbuzz-icu-1.8.8-r1, available: 1 assign harfbuzz-icu to harfbuzz-icu-1.8.8-r1 disqualify_package: harfbuzz-icu-2.3.1-r0 (conflicting provides) queue_dirty: pc:harfbuzz disqualify_package: harfbuzz-icu-2.4.0-r0 (conflicting provides) assign so:libharfbuzz-icu.so.0 to harfbuzz-icu-1.8.8-r1
This seems to be a small issue in the solver: https://git.alpinelinux.org/apk-tools/tree/src/solver.c\#n514 - it “Prefer[s] existing package[s]”, even during a system upgrade. Anything in world is considered for upgrade, but dependencies of world are only considered for upgrade if the existing package versions are no longer present/available. I’m aware that the Alpine policy is to run the equivalent of cleanoldpkg on every build, but it isn’t our policy at Adélie - once a package is published to our mirrors, it is never removed for any reason other than if there is a license error
My personal opinion is that there should perhaps be another flag to upgrade, maybe -d/—deep for “deep upgrades” which will upgrade every package, not just world.
(from redmine: issue id 10532, created on 2019-06-01)