Skip to contentSkip to conversation

package/pkg-python.mk: switch back to local setuptools distutils

PATCH Applied James Hilliard 2 participants 2 messages Jun 24, 2023 – Jun 25, 2023

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 package/pkg-python.mk: switch back to local setuptools distutils

We overrode the default in 4386bbdf0895dbb35e02c25f42603bae9af64451 to work around target shebang bug, as this issue no longer appears to be present lets revert back to the local version as this is what will be use in the future when distutils is removed from the python stdlib.

Tested with:

$ support/testing/run-tests -d dl -o output_folder -k tests.package.test_ipython.TestIPythonPy3
15:43:26 TestIPythonPy3                           Starting
15:43:27 TestIPythonPy3                           Building
15:49:35 TestIPythonPy3                           Building done
Downloading to /home/buildroot/buildroot/dl/tmp_iyk_fn6
Renaming from /home/buildroot/buildroot/dl/tmp_iyk_fn6 to /home/buildroot/buildroot/dl/kernel-versatile-5.10.7
Downloading to /home/buildroot/buildroot/dl/tmpokk23l2z
Renaming from /home/buildroot/buildroot/dl/tmpokk23l2z to /home/buildroot/buildroot/dl/versatile-pb-5.10.7.dtb
15:50:04 TestIPythonPy3                           Cleaning up
.
----------------------------------------------------------------------
Ran 1 test in 398.709s

OK

$ head -n 1 output_folder/TestIPythonPy3/target/usr/bin/ipython
#!/usr/bin/python
---
 package/pkg-python.mk | 12 ++++--------
 1 file changed, 4 insertions(+), 8 deletions(-)
package/pkg-python.mk +4 -8
index c15a168f60..fcb8fa0a99 100644
@@ -55,8 +55,7 @@ HOST_PKG_PYTHON_ENV = \
 # Target distutils-based packages
 PKG_PYTHON_DISTUTILS_ENV = \
 	$(PKG_PYTHON_ENV) \
-	LDSHARED="$(TARGET_CROSS)gcc -shared" \
-	SETUPTOOLS_USE_DISTUTILS=stdlib \
+	LDSHARED="$(TARGET_CROSS)gcc -shared"
 
 PKG_PYTHON_DISTUTILS_BUILD_OPTS = \
 	--executable=/usr/bin/python
@@ -75,16 +74,14 @@ PKG_PYTHON_DISTUTILS_INSTALL_STAGING_OPTS = \
 
 # Host distutils-based packages
 HOST_PKG_PYTHON_DISTUTILS_ENV = \
-	$(HOST_PKG_PYTHON_ENV) \
-	SETUPTOOLS_USE_DISTUTILS=stdlib
+	$(HOST_PKG_PYTHON_ENV)
 
 HOST_PKG_PYTHON_DISTUTILS_INSTALL_OPTS = \
 	--prefix=$(HOST_DIR)
 
 # Target setuptools-based packages
 PKG_PYTHON_SETUPTOOLS_ENV = \
-	$(PKG_PYTHON_ENV) \
-	SETUPTOOLS_USE_DISTUTILS=stdlib
+	$(PKG_PYTHON_ENV)
 
 PKG_PYTHON_SETUPTOOLS_CMD = \
 	$(if $(wildcard $($(PKG)_BUILDDIR)/setup.py),setup.py,-c 'from setuptools import setup;setup()')
@@ -105,8 +102,7 @@ PKG_PYTHON_SETUPTOOLS_INSTALL_STAGING_OPTS = \
 
 # Host setuptools-based packages
 HOST_PKG_PYTHON_SETUPTOOLS_ENV = \
-	$(HOST_PKG_PYTHON_ENV) \
-	SETUPTOOLS_USE_DISTUTILS=stdlib
+	$(HOST_PKG_PYTHON_ENV)
 
 HOST_PKG_PYTHON_SETUPTOOLS_INSTALL_OPTS = \
 	--prefix=$(HOST_DIR) \
Signature · 6 lines
2.34.1

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#1 lore raw
Quoted 19 lines · James Hilliard

We overrode the default in 4386bbdf0895dbb35e02c25f42603bae9af64451 to work around target shebang bug, as this issue no longer appears to be present lets revert back to the local version as this is what will be use in the future when distutils is removed from the python stdlib.

Tested with:

$ support/testing/run-tests -d dl -o output_folder -k tests.package.test_ipython.TestIPythonPy3
15:43:26 TestIPythonPy3                           Starting
15:43:27 TestIPythonPy3                           Building
15:49:35 TestIPythonPy3                           Building done
Downloading to /home/buildroot/buildroot/dl/tmp_iyk_fn6
Renaming from /home/buildroot/buildroot/dl/tmp_iyk_fn6 to /home/buildroot/buildroot/dl/kernel-versatile-5.10.7
Downloading to /home/buildroot/buildroot/dl/tmpokk23l2z
Renaming from /home/buildroot/buildroot/dl/tmpokk23l2z to /home/buildroot/buildroot/dl/versatile-pb-5.10.7.dtb
15:50:04 TestIPythonPy3                           Cleaning up
.
----------------------------------------------------------------------
Ran 1 test in 398.709s
Quoted 6 lines

OK

$ head -n 1 output_folder/TestIPythonPy3/target/usr/bin/ipython
#!/usr/bin/python

Applied to master, thanks.

Regards,
Arnout

Quoted 38 lines
---
  package/pkg-python.mk | 12 ++++--------
  1 file changed, 4 insertions(+), 8 deletions(-)
package/pkg-python.mk +3 -6
index c15a168f60..fcb8fa0a99 100644
@@ -55,8 +55,7 @@ HOST_PKG_PYTHON_ENV = \
  # Target distutils-based packages
  PKG_PYTHON_DISTUTILS_ENV = \
  	$(PKG_PYTHON_ENV) \
-	LDSHARED="$(TARGET_CROSS)gcc -shared" \
-	SETUPTOOLS_USE_DISTUTILS=stdlib \
+	LDSHARED="$(TARGET_CROSS)gcc -shared"
 
  PKG_PYTHON_DISTUTILS_BUILD_OPTS = \
  	--executable=/usr/bin/python
@@ -75,16 +74,14 @@ PKG_PYTHON_DISTUTILS_INSTALL_STAGING_OPTS = \
 
  # Host distutils-based packages
  HOST_PKG_PYTHON_DISTUTILS_ENV = \
-	$(HOST_PKG_PYTHON_ENV) \
-	SETUPTOOLS_USE_DISTUTILS=stdlib
+	$(HOST_PKG_PYTHON_ENV)
 
  HOST_PKG_PYTHON_DISTUTILS_INSTALL_OPTS = \
  	--prefix=$(HOST_DIR)
 
  # Target setuptools-based packages
  PKG_PYTHON_SETUPTOOLS_ENV = \
-	$(PKG_PYTHON_ENV) \
-	SETUPTOOLS_USE_DISTUTILS=stdlib
+	$(PKG_PYTHON_ENV)
 
  PKG_PYTHON_SETUPTOOLS_CMD = \
  	$(if $(wildcard $($(PKG)_BUILDDIR)/setup.py),setup.py,-c 'from setuptools import setup;setup()')

package/pkg-python.mk PKG_PYTHON_SETUPTOOLS_INSTALL_STAGING_OPTS = \ · line 108

Quoted 9 lines
package/pkg-python.mk +1 -2
@@ -105,8 +102,7 @@ PKG_PYTHON_SETUPTOOLS_INSTALL_STAGING_OPTS = \
 
  # Host setuptools-based packages
  HOST_PKG_PYTHON_SETUPTOOLS_ENV = \
-	$(HOST_PKG_PYTHON_ENV) \
-	SETUPTOOLS_USE_DISTUTILS=stdlib
+	$(HOST_PKG_PYTHON_ENV)
 
  HOST_PKG_PYTHON_SETUPTOOLS_INSTALL_OPTS = \
  	--prefix=$(HOST_DIR) \

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot