What to do about timestamp based rebuilds?
Created by: ollieparanoid
Timestamp based rebuilds recap
Quoting the 50 days post:
abuild
is the package building program from Alpine Linux, thatpmbootstrap
wraps around. Just like in most Linux distributions it considers packages up to date, when the [binary] package version is equal with the version of the package recipe. This has the side-effect, that package developers must pass--force
to rebuild a package if they changed anything, but do not want to increase the version yet. [@mmaret expected] it to work like the classicmake
build automation program, which means that after modifying one file anywhere in the source tree, it automatically detects which packages are out of date and rebuilds them [...]
Three open bugs caused by this feature
As you know, I'm trying to fix all pmbootstrap bugs before working on new features. Of the 6 bugs we have right now, 3 bugs are in the timestamp based rebuilds feature:
- #1156 (closed) gtk+2.0-maemo-2.24.31-r3.apk is rebuilt in each and every build
- #1023 (closed): timestamp based rebuilds thinks everything needs to be rebuilt after "git merge" instead of "git rebase"
- #985 (closed): Binary repo hinders / confuses
(The other 3 bugs have PRs waiting for reviews, which directly resolve them or at least work towards resolving them.)
Why is it so complicated?
Quote from https://github.com/postmarketOS/pmbootstrap/issues/1156#issuecomment-359954250:
This seems easy at first, but in combination with
git
, when you switch branches or just cloned a repo, then the files will have newer timestamps than the binary packages. So pmbootstrap would think they need to be rebuilt.
To work around this, we ask git to diff against current master, and only look at the files that have changed in regard to
master
. But this only seems to work correctly when usinggit rebase
instead ofgit merge
(and I'm not 100% sure of that even, need to investigate this more). This feature got even more complicated as the binary repo was introduced.
Drop it?
Unfortunatelly I do not see a straight forward way to fix the issues. And because it is so complicated, it makes the code hard to maintain and PRs get really hard to review and understand.
I'm not saying this lightheartedly, because I spent a great deal of time to implement this in the first place. But what if we just dropped this feature and documented instead, that --force
is necessary when not changing the version?