1. For a start, with distutils deprecated are actually migrating to setuptools or other build systems upstream. This effectively solves
the problem for us since the .egg-info switch happens on version bump
and there is no file collision.
However, this isn't going to help for dead projects.
On 2022-01-10 06:39, Michał Górny wrote:
However, this isn't going to help for dead projects.
Dead dependencies probably should be reported upstream too.
The big problem is that switching implies changing the format, so if you install foo-X, then switch, then reinstall the same version of foo,src_install() ?
you're going to have the file replaced by a directory. This is not
supported by the PMS, and Portage handles it somewhat suboptimally
(renaming the old file and leaving it orphaned).
Is it possible to force the package to own the file may be touching it in
4. We could have the eclasses switch to "local" model and rename
the .egg-info files somehow at some point. The main question is "rename how?"
On Mon, 2022-01-10 at 06:39 +0100, Michał Górny wrote:
4. We could have the eclasses switch to "local" model and rename
the .egg-info files somehow at some point. The main question is "rename how?"
If anyone's interested, I've published a proof-of-concept for this:
https://github.com/gentoo/gentoo/pull/23721
Long story short, the eclass detects if vendored distutils are being
used and renames the directories from .egg-info to .g.egg-info then.
This basically means the tag changes from e.g. "py3.8" to "py3.8.g".
I'm testing this approach now and it doesn't seem to break anything.
On Mon, Jan 10, 2022 at 9:43 AM Michał Górny <mgorny@gentoo.org> wrote:
On Mon, 2022-01-10 at 06:39 +0100, Michał Górny wrote:
4. We could have the eclasses switch to "local" model and rename
the .egg-info files somehow at some point. The main question is "rename how?"
If anyone's interested, I've published a proof-of-concept for this:
https://github.com/gentoo/gentoo/pull/23721
Long story short, the eclass detects if vendored distutils are being
used and renames the directories from .egg-info to .g.egg-info then.
This basically means the tag changes from e.g. "py3.8" to "py3.8.g".
I'm testing this approach now and it doesn't seem to break anything.
A possible alternative would be to define pkg_preinst in the eclass
and have it move the .egg-info file out of the way before portage
tries to replace it with a directory. That would be a significant API
change for distutils-r1 though.
TL;DR: how to deal with setuptools (and newer distutils vendored by setuptools) replacing .egg-info files with directories?
I should probably emphasize here that the .egg-info path contains
the package version, so this is a problem only if the same upstream
version is being reinstalled.
You can easily reproduce the problem by playing with:
SETUPTOOLS_USE_DISTUTILS=stdlib
SETUPTOOLS_USE_DISTUTILS=local # vendored
2. We could control the distutils version in ebuilds directly,
i.e. force "stdlib" for the current versions and have developers switch
to "local" on version bumps. Combined with 1., this will probably
increase the coverage a bit but dead packages will remain in the way.
It also relies on all devs understanding the problem.
TL;DR: how to deal with setuptools (and newer distutils vendored by setuptools) replacing .egg-info files with directories?
I should probably emphasize here that the .egg-info path contains
the package version, so this is a problem only if the same upstream
version is being reinstalled.
You can easily reproduce the problem by playing with:
  SETUPTOOLS_USE_DISTUTILS=stdlib
  SETUPTOOLS_USE_DISTUTILS=local # vendored
2. We could control the distutils version in ebuilds directly,
i.e. force "stdlib" for the current versions and have developers
switch
to "local" on version bumps. Combined with 1., this will probably
increase the coverage a bit but dead packages will remain in the
way.
It also relies on all devs understanding the problem.
How about switching it with a new Python version?
(since that is also in the path...)
5. We could have the eclasses convert .egg-info into the newer .dist-
info format. However, I'm not aware of any existing tool doing such
a conversion, and I'm not convinced I want to write one right now,
and whether it wouldn't have compatibility implications.
Sysop: | Keyop |
---|---|
Location: | Huddersfield, West Yorkshire, UK |
Users: | 296 |
Nodes: | 16 (2 / 14) |
Uptime: | 62:48:40 |
Calls: | 6,654 |
Files: | 12,200 |
Messages: | 5,331,692 |