1 |
On 2/13/21 5:51 PM, Zac Medico wrote: |
2 |
> On 2/10/21 11:11 AM, Rich Freeman wrote: |
3 |
>> On Wed, Feb 10, 2021 at 12:57 PM Andreas K. Hüttel <dilfridge@g.o> wrote: |
4 |
>>> |
5 |
>>> * what portage features are still needed or need improvements (e.g. binpkg |
6 |
>>> signing and verification) |
7 |
>>> * how should hosting look like |
8 |
>> |
9 |
>> Some ideas for portage enhancements: |
10 |
>> |
11 |
>> 1. Ability to fetch binary packages from some kind of repo. |
12 |
> |
13 |
> The old PORTAGE_BINHOST functionality has been replaced with a |
14 |
> binrepos.conf file that's very similar to repos.conf: |
15 |
> |
16 |
> https://bugs.gentoo.org/668334 |
17 |
> |
18 |
> It doesn't have explicit support for multiple local binary package |
19 |
> repositories yet, but somebody got it working with src-uri set to a |
20 |
> file:/ uri as described in comments on this bug: |
21 |
> |
22 |
> https://bugs.gentoo.org/768957 |
23 |
> |
24 |
>> 2. Ability to have multiple binary packages co-exist in a repo (local |
25 |
>> or remote) with different build attributes (arch, USE, CFLAGS, |
26 |
>> DEPENDS, whatever). |
27 |
> |
28 |
> We can now enable FEATURES=binpkg-multi-instance by default now that |
29 |
> this bug is fixed: |
30 |
> |
31 |
> https://bugs.gentoo.org/571126 |
32 |
> |
33 |
>> 3. Ability to pick the most appropriate binary packages to use based |
34 |
>> on user preferences (with a mix of hard and soft preferences). |
35 |
> |
36 |
> Current package selection logic for binary packages is basically the |
37 |
> same as for ebuilds. These are the notable differences: |
38 |
> |
39 |
> 1) Binary packages are sorted in descending order by (version, mtime), |
40 |
> so then most recent builds are preferred when the versions are identical. |
41 |
> |
42 |
> 2) The --binpkg-respect-use option rejects binary packages what would |
43 |
> need to be rebuilt in order to match local USE settings. |
44 |
> |
45 |
>> One idea I've had around how #2-3 might be implemented is: |
46 |
>> 1. Binary packages already contain data on how they were built (USE |
47 |
>> flags, dependencies, etc). Place this in a file using a deterministic |
48 |
>> sorting/etc order so that two builds with the same settings will have |
49 |
>> the same results. |
50 |
> |
51 |
> This would only be needed to multi-profile binhosts that provide a |
52 |
> variety of configurations for the same package. |
53 |
> |
54 |
> Features like this are not necessary if the binhost only intends to |
55 |
> provide packages for a single profile. |
56 |
> |
57 |
>> 2. Generate a hash of the file contents - this can go in the filename |
58 |
>> so that the file can co-exist with other files, and be located |
59 |
>> assuming you have a full matching set of metadata. |
60 |
> |
61 |
> For FEATURES=binpkg-multi-instance we currently use an integer BUILD_ID |
62 |
> ensure that file names are unique. |
63 |
> |
64 |
>> 3. Start dropping attributes from the file based on a list of |
65 |
>> priorities and generate additional hashes. Create symlinked files to |
66 |
>> the original file using these hashes (overwriting or not existing |
67 |
>> symlinks based on policy). This allows the binary package to be found |
68 |
>> using either an exact set of attributes or a subset of higher-priority |
69 |
>> attributes. This is analogous to shared object symlinking. |
70 |
>> 4. The package manager will look for a binary package first using the |
71 |
>> user's full config, and then by dropping optional elements of the |
72 |
>> config (so maybe it does the search without CFLAGs, then without USE |
73 |
>> flags). Eventually it aborts based on user prefs (maybe the user only |
74 |
>> wants an exact match, or is willing to accept alternate CFLAGs but not |
75 |
>> USE flags, or maybe anything for the arch is selected> 5. As always the final selected binary package still gets evaluated |
76 |
>> like any other binary package to ensure it is usable. |
77 |
>> |
78 |
>> Such a system can identify whether a potentially usable file exists |
79 |
>> using only filename, cutting down on fetching. In the interests of |
80 |
>> avoiding useless fetches we would only carry step 3 reasonably far - |
81 |
>> packages would have to match based on architecture and any dynamic |
82 |
>> linking requirements. So we wouldn't generate hashes that didn't |
83 |
>> include at least those minimums, and the package manager wouldn't |
84 |
>> search for them. |
85 |
>> |
86 |
>> Obviously you could do more (if you have 5 combinations of use flags, |
87 |
>> look for the set that matches most closely). That couldn't be done |
88 |
>> using hashes alone in an efficient way. You could have a small |
89 |
>> manifest file alongside the binary package that could be fetched |
90 |
>> separately if the package manager wants to narrow things down and |
91 |
>> fetch a few of those to narrow it down further. |
92 |
> |
93 |
> All of the above is oriented toward multi-profile binhosts, so we'll |
94 |
> have to do a cost/benefit analysis to determine whether it's worth the |
95 |
> effort to introduce the complexity that multi-profile binhosts add. |
96 |
|
97 |
This idea to borrow paludis's notion of pbins could work well for a |
98 |
multi-profile binhost: |
99 |
|
100 |
https://archives.gentoo.org/gentoo-dev/message/1aea0de0ff588c67bf652f4c1f8ef304 |
101 |
-- |
102 |
Thanks, |
103 |
Zac |