Gentoo Archives: gentoo-portage-dev

From: Zac Medico <zmedico@g.o>
To: gentoo-portage-dev@l.g.o, Alec Warner <antarus@g.o>
Cc: Matt Turner <mattst88@g.o>
Subject: Re: [gentoo-portage-dev] [PATCH] Add @changed-subslot package set
Date: Tue, 19 Jan 2021 04:09:54
Message-Id: ff293a8f-64c3-e3d7-6c15-565a78e53bee@gentoo.org
In Reply to: Re: [gentoo-portage-dev] [PATCH] Add @changed-subslot package set by Alec Warner
1 On 1/18/21 6:07 PM, Alec Warner wrote:
2 > On Fri, Jan 15, 2021 at 6:47 PM Matt Turner <mattst88@g.o> wrote:
3 >>
4 >> This set is the upgradable packages for which the highest visible
5 >> version has a different subslot than the currently installed version.
6 >>
7 >> The primary purpose of this feature is for use in catalyst builds. We
8 >> update the "seed" stage3 before using it to build a new stage1.
9 >>
10 >> Updating the entire stage is expensive and unnecessary (since we're
11 >> going to build the latest packages in stage1 and then rebuild everything
12 >> in stage3).
13 >>
14 >> What we definitely do need to update in the original stage3 however, is
15 >> any package that would trigger a subslot rebuild.
16 >>
17 >> For example: gcc links with libmpfr.so from dev-libs/mpfr. mpfr's SONAME
18 >> changes from libmpfr.so.4 (SLOT="0/4") to libmpfr.so.6 (SLOT="0/6"). If
19 >> the seed stage's dev-libs/mpfr is not updated before emerging gcc, gcc
20 >> will link with libmpfr.so.4, but the latest version of dev-libs/mpfr
21 >> will be built and libmpfr.so.6 included into the stage1. Since the old
22 >> libmpfr.so.4 is not included in the stage1, gcc will not work, breaking
23 >> subsequent stage builds.
24 >>
25 >> Our current options to update the seed are too large a hammer (e.g.,
26 >> "--update --deep --newuse @world" or "--update --deep --newuse
27 >> --complete-graph --rebuild-if-new-ver gcc") and spend too much time
28 >> updating seed stages for no gain beyond updating only packages for whom
29 >> the subslot has changed.
30 >>
31 >> With this set, catalyst will likely use
32 >>
33 >> emerge @changed-subslot --ignore-built-slot-operator-deps y
34 >>
35 >> to update the seed stage.
36 >>
37 >> Thank you to Zac Medico for showing me how to do this.
38 >>
39 >> Bug: https://bugs.gentoo.org/739004
40 >> Signed-off-by: Matt Turner <mattst88@g.o>
41 >> ---
42 >> cnf/sets/portage.conf | 5 +++++
43 >> lib/portage/_sets/dbapi.py | 39 +++++++++++++++++++++++++++++++++++++-
44 >> 2 files changed, 43 insertions(+), 1 deletion(-)
45 >>
46 >> diff --git a/cnf/sets/portage.conf b/cnf/sets/portage.conf
47 >> index 22f0fa3a5..5651a9c53 100644
48 >> --- a/cnf/sets/portage.conf
49 >> +++ b/cnf/sets/portage.conf
50 >> @@ -84,6 +84,11 @@ exclude-files = /usr/bin/Xorg
51 >> [rebuilt-binaries]
52 >> class = portage.sets.dbapi.RebuiltBinaries
53 >>
54 >> +# Installed packages for which the subslot of the highest visible ebuild
55 >> +# version is different than the currently installed version.
56 >> +[changed-subslot]
57 >> +class = portage.sets.dbapi.SubslotChangedSet
58 >> +
59 >> # Installed packages for which the highest visible ebuild
60 >> # version is lower than the currently installed version.
61 >> [downgrade]
62 >> diff --git a/lib/portage/_sets/dbapi.py b/lib/portage/_sets/dbapi.py
63 >> index 52367c4a6..46ba5c17d 100644
64 >> --- a/lib/portage/_sets/dbapi.py
65 >> +++ b/lib/portage/_sets/dbapi.py
66 >> @@ -15,7 +15,7 @@ from portage._sets import SetConfigError, get_boolean
67 >> import portage
68 >>
69 >> __all__ = ["CategorySet", "ChangedDepsSet", "DowngradeSet",
70 >> - "EverythingSet", "OwnerSet", "VariableSet"]
71 >> + "EverythingSet", "OwnerSet", "SubslotChangedSet", "VariableSet"]
72 >>
73 >> class EverythingSet(PackageSet):
74 >> _operations = ["merge"]
75 >> @@ -167,6 +167,43 @@ class VariableSet(EverythingSet):
76 >>
77 >> singleBuilder = classmethod(singleBuilder)
78 >>
79 >> +class SubslotChangedSet(PackageSet):
80 >> +
81 >> + _operations = ["merge", "unmerge"]
82 >> +
83 >> + description = "Package set which contains all packages " + \
84 >> + "for which the subslot of the highest visible ebuild is " + \
85 >> + "different than the currently installed version."
86 >
87 > description = ("string1",
88 > "string2",
89 > "string3")
90 >
91 > vs concat + \ for line continuation?
92 >
93 > -A
94
95 We also got flak on irc about the classmethod(singleBuilder) usage as
96 opposed to @classmethod. This package set is formatted exactly like
97 others in the file, so it's just a copy / paste thing.
98
99 On the topic of python formatting, maybe we should use something like
100 https://github.com/psf/black to automate it?
101 --
102 Thanks,
103 Zac

Attachments

File name MIME type
signature.asc application/pgp-signature

Replies