1 |
On Sat, Dec 17, 2022 at 05:42:43AM +0000, Sam James wrote: |
2 |
> |
3 |
> |
4 |
> > On 15 Dec 2022, at 19:22, Florian Schmaus <flow@g.o> wrote: |
5 |
> > |
6 |
> > This is a public service announcement that the recently stabilized portage version will truncate you repo's git history to 1. |
7 |
> |
8 |
> I wish you'd shown us in #gentoo-portage before sending this, as it's a bit misleading / alarmist. We were actively all speaking |
9 |
> at the time. |
10 |
> |
11 |
> Not only to reconsider the phrasing and include some important details, but also to mention the rationale, which I describe |
12 |
> below. |
13 |
> |
14 |
> If you felt the Portage team should've written a news item for it, you were (and still are) free to say so, and we'd |
15 |
> do it. |
16 |
> |
17 |
> > |
18 |
> > While this is a good thing for the majority of Gentoo users, it affects developers that develop in a git known to portage (like me). If I understand the portage maintainers vision correctly, then future portage will assume full control over its configured repositories and potentially perform destructive operations on them, for example "git clean" [1]. |
19 |
> > |
20 |
> ... only for repositories of sync-type=git & auto-sync=yes. |
21 |
> |
22 |
> The rationale for this is that most people who use sync-type=git are doing so because they want |
23 |
> a quicker sync (to complete), a more reliable one (no Manifest race condition issues), and to |
24 |
> get changes from Gentoo faster. |
25 |
> |
26 |
> Whenever Portage is syncing something, our view was that we should prioritise successful |
27 |
> completion of syncs, especially given it may be performed unattended. |
28 |
> |
29 |
> If git is pulling from a CDN, Portage may on one sync receive state X, but |
30 |
> on a subsequent sync receive state X-1. This can cause an odd state |
31 |
> where git wants to resolve conflicts and manual intervention is required. |
32 |
> |
33 |
> This situation was often worse with sync-depth=1 and would lead |
34 |
> to orphaned files, hence the 'git clean' PR referenced. |
35 |
> |
36 |
> The motivation behind the sync depth part was because of |
37 |
> disk space growing unbounded otherwise. |
38 |
|
39 |
Just to make this more abundantly explicit: it repeatedly happened to |
40 |
me (but others, too) that on a system using git to sync a shallow |
41 |
::gentoo clone, during unattended syncs, the repository attempted a |
42 |
merge with the upstream, yielding a repo in a merging state, with a |
43 |
huge list of dirtied files in the working tree, plus untracked files. |
44 |
|
45 |
> > I personally would prefer portage simply adjusting its behavior based on the owner of the repository. That is, if it's the 'portage' user then assume full control, and if it is a different user, then fall back to a preserving, conservative mode of operation. Unfortunately, for me, this idea was received skeptically at best in a recent discussion in #gentoo-portage. |
46 |
> |
47 |
> This wouldn't work for Prefix and also FEATURES="-usersync". |
48 |
> |
49 |
> -- |
50 |
> |
51 |
> Now, looking forward in a constructive manner, I think we can |
52 |
> make both camps happy here with an option to indicate |
53 |
> If Portage can assume the repository will be touched by something |
54 |
> other than Portage. |
55 |
> |
56 |
> I propose a configuration option called 'volatile' (thanks |
57 |
> Arsen for the name suggestion) which indicates that the |
58 |
> repository may be changed outside of Portage by any time, |
59 |
> and hence no destructive operations should be carried out. |
60 |
> |
61 |
> If the option is on, it also prohibits some optimisations |
62 |
> which require assuming the integrity of the repository. |
63 |
> |
64 |
> I have a draft of these changes at https://github.com/gentoo/portage/pull/961. |
65 |
> |
66 |
> (https://github.com/gentoo/portage/pull/961.patch if want to view as a raw patch series.0 |
67 |
> |
68 |
> I am undecided on whether volatile should be default on or not. In the PR |
69 |
> as it is, it defaults to off, which would require a news item. I may just turn it |
70 |
> on given the tone of this thread, as none of it has been very encouraging |
71 |
> for further work on Portage. |