Gentoo Archives: gentoo-dev

From: Mike Gilbert <floppym@g.o>
To: Gentoo Dev <gentoo-dev@l.g.o>
Subject: Re: [gentoo-dev] Looking for a solution to the distutils/setuptools .egg-info mess
Date: Tue, 11 Jan 2022 03:49:49
Message-Id: CAJ0EP43umQkSHnXcSnqC4zodZ3OJ+2Yz6SauSoCy3Bp0X7obag@mail.gmail.com
In Reply to: Re: [gentoo-dev] Looking for a solution to the distutils/setuptools .egg-info mess by Mike Gilbert
1 On Mon, Jan 10, 2022 at 8:19 PM Mike Gilbert <floppym@g.o> wrote:
2 >
3 > On Mon, Jan 10, 2022 at 9:43 AM Michał Górny <mgorny@g.o> wrote:
4 > >
5 > > On Mon, 2022-01-10 at 06:39 +0100, Michał Górny wrote:
6 > > > 4. We could have the eclasses switch to "local" model and rename
7 > > > the .egg-info files somehow at some point. The main question is "rename
8 > > > how?"
9 > > >
10 > >
11 > > If anyone's interested, I've published a proof-of-concept for this:
12 > >
13 > > https://github.com/gentoo/gentoo/pull/23721
14 > >
15 > > Long story short, the eclass detects if vendored distutils are being
16 > > used and renames the directories from .egg-info to .g.egg-info then.
17 > > This basically means the tag changes from e.g. "py3.8" to "py3.8.g".
18 > > I'm testing this approach now and it doesn't seem to break anything.
19 >
20 > A possible alternative would be to define pkg_preinst in the eclass
21 > and have it move the .egg-info file out of the way before portage
22 > tries to replace it with a directory. That would be a significant API
23 > change for distutils-r1 though.
24
25 Portage actually handles installation of a directory over a file by
26 renaming the file with a ".backup.nnnn" suffix.
27
28 * Installation of a directory is blocked by a file:
29 * '/usr/lib/python3.9/site-packages/layman-2.4.3-py3.9.egg-info'
30 * This file will be renamed to a different name:
31 * '/usr/lib/python3.9/site-packages/layman-2.4.3-py3.9.egg-info.backup.0000'
32
33 A lazy approach would be to just let Portage do this and advise people
34 to clean them up later if so desired.