Skip to content

Commit d5dac68

Browse files
committed
distutils-r1.eclass: fix multiple impl handling for setuptools package
In the latest version of setuptools, setuptools stopped explicitly excluding the build/ directory: pypa/setuptools#4211 It is the default build_base until we specially set it via $DIST_EXTRA_CONFIG -- and before then, by rm -rf'ing the build/ directory. Both approaches were guarded by checking if DISTUTILS_USE_PEP517 is set to setuptools. This doesn't work for the setuptools package itself, since setuptools builds "standalone" so that it can depend on its own in-tree backend. Result: setuptools has always been ignoring BUILD_DIR and leaving persistent files around. Somehow that led to the new version of setuptools without `options.packages.find -> exclude = build`, installing a bunch of new files when building for multiple PYTHON_COMPAT targets. From iwdevtools: * FILES:+usr/lib/python3.12/site-packages/build/lib/setuptools/wheel.py [...] * SIZE: 13.88MiB -> 20.44MiB, 1083 -> 1631 files * ------> FILES(+556,-8) SIZE(+47.22%) (It should be noted that as part of the upgrade itself, python3_11 did get +12,-4 files, which is vastly out of proportion to the combined total of 556. This should actually be +24,-8.) Fix by running setuptools based code for standalone build-backends (and pbr, a setuptools wrapper) as well. It is either unneeded or necessary, but shouldn't hurt. Signed-off-by: Eli Schwartz <[email protected]>
1 parent a6e4321 commit d5dac68

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

eclass/distutils-r1.eclass

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1506,7 +1506,10 @@ distutils-r1_python_compile() {
15061506
_python_check_EPYTHON
15071507

15081508
case ${DISTUTILS_USE_PEP517:-setuptools} in
1509-
setuptools)
1509+
# pbr is a setuptools wrapper. Standalone may or may not
1510+
# wrap setuptools (the setuptools package itself does!)
1511+
# so better to do too much rather than too little.
1512+
setuptools|pbr|standalone)
15101513
# call setup.py build when using setuptools (either via PEP517
15111514
# or in legacy mode)
15121515

0 commit comments

Comments
 (0)