Bug 281393 - pkgbase: incremental update broken after base 4231a5e50404
Summary: pkgbase: incremental update broken after base 4231a5e50404
Status: Closed FIXED
Alias: None
Product: Base System
Classification: Unclassified
Component: bin (show other bugs)
Version: 15.0-CURRENT
Hardware: Any Any
: --- Affects Only Me
Assignee: Baptiste Daroussin
URL:
Keywords: regression
Depends on:
Blocks:
 
Reported: 2024-09-09 16:22 UTC by Evgenii Khramtsov
Modified: 2024-10-10 13:07 UTC (History)
4 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Evgenii Khramtsov 2024-09-09 16:22:39 UTC
# make update-packages
results in:

BRANCH_EXT_FROM p20240909154744
BRANCH_EXT snap

which causes new package creation rather than "Keeping old", see

https://github.com/freebsd/freebsd-src/blob/34d9de9658af/Makefile.inc1#L2082

After reverting 
https://github.com/freebsd/freebsd-src/commit/aee4c9c5b88a
https://github.com/freebsd/freebsd-src/commit/4231a5e50404

"Keeping old" behavior is restored.
Comment 1 commit-hook freebsd_committer freebsd_triage 2024-09-10 16:09:13 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/src/commit/?id=2b9c818d8db30389c366746e60efa665c0d591cc

commit 2b9c818d8db30389c366746e60efa665c0d591cc
Author:     Baptiste Daroussin <bapt@FreeBSD.org>
AuthorDate: 2024-09-10 15:56:44 +0000
Commit:     Baptiste Daroussin <bapt@FreeBSD.org>
CommitDate: 2024-09-10 16:05:29 +0000

    pkgbase: fix decision logic to keep the old packages

    when running update-package, we try to keep as much as possible the old
    packages to avoid wasting users bandwidth. the previous code was failing
    at catching properly the "snap" extension and we lost incremental build.

    With this new code we only stop checking we we have an old package with
    the same checksum if we transition from:
    - alpha to beta
    - beta to rc
    - rc to release

    but we keep old packages when we transition from release to p1 or when
    we stay on a given snapshot

    PR:             281393
    Reported by:    Evgenii Khramtsov <throwaway_vthgwq4@protonmail.com>

 Makefile.inc1 | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
Comment 2 Evgenii Khramtsov 2024-09-10 16:33:58 UTC
I did update-packages twice after base 2b9c818d8db3 buildworld and can still reproduce.
Comment 3 Baptiste Daroussin freebsd_committer freebsd_triage 2024-10-02 12:40:47 UTC
here is a new attempt at fixing it my approach was too naive:
https://reviews.freebsd.org/D46871
Comment 4 Gleb Popov freebsd_committer freebsd_triage 2024-10-02 14:04:04 UTC
You meant https://reviews.freebsd.org/D46874 I presume.
Comment 5 Baptiste Daroussin freebsd_committer freebsd_triage 2024-10-02 15:32:07 UTC
oups yes
Comment 6 commit-hook freebsd_committer freebsd_triage 2024-10-10 06:50:08 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/src/commit/?id=458dc7f30310394a571fd4f2f5368acd48684652

commit 458dc7f30310394a571fd4f2f5368acd48684652
Author:     Baptiste Daroussin <bapt@FreeBSD.org>
AuthorDate: 2024-10-08 06:53:45 +0000
Commit:     Baptiste Daroussin <bapt@FreeBSD.org>
CommitDate: 2024-10-10 06:48:28 +0000

    pkgbase: fix incremental generation of packages

    Replace the regex trying to catch the branch name of the existing
    repository which was too naive with simpler glob matching.

    As a result the only case when we only use the new packages are:
    moving from alpha to beta
    moving from beta to rc
    moving from rc to release
    changing the major version number for the main git branch

    PR:             281393
    Differential Revision:  D46874

 Makefile.inc1 | 46 ++++++++++++++++++++++++++++++++--------------
 1 file changed, 32 insertions(+), 14 deletions(-)
Comment 7 Evgenii Khramtsov 2024-10-10 12:08:35 UTC
I confirm, works fine after base 458dc7f30310.
Comment 8 Baptiste Daroussin freebsd_committer freebsd_triage 2024-10-10 13:07:17 UTC
at last, thanks for the feedback and sorry about the breakage in the first place.