Skip to contentSkip to conversation

package/python3: do not install MS Windows installers on the target

PATCH New Titouan Christophe 3 participants 6 messages Sep 12, 2020 – Sep 15, 2020

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 package/python3: do not install MS Windows installers on the target

Buildroot generates Linux systems, so there is no need to have MS Windows executables in there.

This reduces the target filesystem size by about 2MB:

$ du -hcs usr/lib/python3.8/distutils/command/wininst-*.exe
60K usr/lib/python3.8/distutils/command/wininst-6.0.exe
64K usr/lib/python3.8/distutils/command/wininst-7.1.exe
60K usr/lib/python3.8/distutils/command/wininst-8.0.exe
192K    usr/lib/python3.8/distutils/command/wininst-9.0.exe
220K    usr/lib/python3.8/distutils/command/wininst-9.0-amd64.exe
188K    usr/lib/python3.8/distutils/command/wininst-10.0.exe
220K    usr/lib/python3.8/distutils/command/wininst-10.0-amd64.exe
448K    usr/lib/python3.8/distutils/command/wininst-14.0.exe
576K    usr/lib/python3.8/distutils/command/wininst-14.0-amd64.exe
2,0M    total
---
 package/python3/python3.mk | 1 +
 1 file changed, 1 insertion(+)
package/python3/python3.mk +1 -0
index 31e7ca3d3a..3c2f71e448 100644
@@ -212,6 +212,7 @@ define PYTHON3_REMOVE_USELESS_FILES
 	rm -f $(TARGET_DIR)/usr/bin/python$(PYTHON3_VERSION_MAJOR)m-config
 	rm -f $(TARGET_DIR)/usr/bin/python3-config
 	rm -f $(TARGET_DIR)/usr/bin/smtpd.py.3
+	rm -f $(TARGET_DIR)/usr/lib/python$(PYTHON3_VERSION_MAJOR)/distutils/command/wininst*.exe
 	for i in `find $(TARGET_DIR)/usr/lib/python$(PYTHON3_VERSION_MAJOR)/config-$(PYTHON3_VERSION_MAJOR)m-*/ \
 		-type f -not -name Makefile` ; do \
 		rm -f $$i ; \
Signature · 1 line
2.25.3
#1 lore raw

PATCH 2/2 package/python: do not install MS Windows installers on the target

Buildroot generates Linux systems, so there is no need to have MS Windows executables in there.

This reduces the target filesystem size by about 600kB:

$ du -hcs usr/lib/python2.7/distutils/command/wininst-*.exe
60K usr/lib/python2.7/distutils/command/wininst-6.0.exe
64K usr/lib/python2.7/distutils/command/wininst-7.1.exe
60K usr/lib/python2.7/distutils/command/wininst-8.0.exe
192K    usr/lib/python2.7/distutils/command/wininst-9.0.exe
220K    usr/lib/python2.7/distutils/command/wininst-9.0-amd64.exe
596K    total
---
 package/python/python.mk | 1 +
 1 file changed, 1 insertion(+)
package/python/python.mk +1 -0
index ccaaadd012..a08732cb22 100644
@@ -199,6 +199,7 @@ define PYTHON_REMOVE_USELESS_FILES
 	rm -f $(TARGET_DIR)/usr/bin/python2-config
 	rm -f $(TARGET_DIR)/usr/bin/python-config
 	rm -f $(TARGET_DIR)/usr/bin/smtpd.py
+	rm -f $(TARGET_DIR)/usr/lib/python$(PYTHON_VERSION_MAJOR)/distutils/command/wininst*.exe
 	for i in `find $(TARGET_DIR)/usr/lib/python$(PYTHON_VERSION_MAJOR)/config/ \
 		-type f -not -name pyconfig.h -a -not -name Makefile` ; do \
 		rm -f $$i ; \
Signature · 1 line
2.25.3
#2 lore raw

PATCH 2/2 package/python: do not install MS Windows installers on the target

Quoted 14 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Titouan" == Titouan Christophe <[email protected]> writes:

Buildroot generates Linux systems, so there is no need to have MS Windows executables in there.

This reduces the target filesystem size by about 600kB:

$ du -hcs usr/lib/python2.7/distutils/command/wininst-*.exe
60K usr/lib/python2.7/distutils/command/wininst-6.0.exe
64K usr/lib/python2.7/distutils/command/wininst-7.1.exe
60K usr/lib/python2.7/distutils/command/wininst-8.0.exe
192K    usr/lib/python2.7/distutils/command/wininst-9.0.exe
220K    usr/lib/python2.7/distutils/command/wininst-9.0-amd64.exe
596K    total
Quoted 1 line

Committed to 2020.02.x, 2020.05.x and 2020.08.x, thanks.

Signature · 1 line
Bye, Peter Korsgaard
#3 lore raw

PATCH 1/2 package/python3: do not install MS Windows installers on the target

In reply to Titouan Christophe
Quoted 16 lines · On Sat, 12 Sep 2020 13:56:21 +0200 Titouan Christophe…

Buildroot generates Linux systems, so there is no need to have MS Windows executables in there.

This reduces the target filesystem size by about 2MB:

$ du -hcs usr/lib/python3.8/distutils/command/wininst-*.exe
60K usr/lib/python3.8/distutils/command/wininst-6.0.exe
64K usr/lib/python3.8/distutils/command/wininst-7.1.exe
60K usr/lib/python3.8/distutils/command/wininst-8.0.exe
192K    usr/lib/python3.8/distutils/command/wininst-9.0.exe
220K    usr/lib/python3.8/distutils/command/wininst-9.0-amd64.exe
188K    usr/lib/python3.8/distutils/command/wininst-10.0.exe
220K    usr/lib/python3.8/distutils/command/wininst-10.0-amd64.exe
448K    usr/lib/python3.8/distutils/command/wininst-14.0.exe
576K    usr/lib/python3.8/distutils/command/wininst-14.0-amd64.exe
2,0M    total
Quoted 4 lines
---
 package/python3/python3.mk | 1 +
 1 file changed, 1 insertion(+)

Both applied. Thanks!

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
#4 lore raw

PATCH 1/2 package/python3: do not install MS Windows installers on the target

In reply to Titouan Christophe
Quoted 18 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Titouan" == Titouan Christophe <[email protected]> writes:

Buildroot generates Linux systems, so there is no need to have MS Windows executables in there.

This reduces the target filesystem size by about 2MB:

$ du -hcs usr/lib/python3.8/distutils/command/wininst-*.exe
60K usr/lib/python3.8/distutils/command/wininst-6.0.exe
64K usr/lib/python3.8/distutils/command/wininst-7.1.exe
60K usr/lib/python3.8/distutils/command/wininst-8.0.exe
192K    usr/lib/python3.8/distutils/command/wininst-9.0.exe
220K    usr/lib/python3.8/distutils/command/wininst-9.0-amd64.exe
188K    usr/lib/python3.8/distutils/command/wininst-10.0.exe
220K    usr/lib/python3.8/distutils/command/wininst-10.0-amd64.exe
448K    usr/lib/python3.8/distutils/command/wininst-14.0.exe
576K    usr/lib/python3.8/distutils/command/wininst-14.0-amd64.exe
2,0M    total
Quoted 1 line

Funky!

It seems like we need to do something similar for python{,3}-setuptools:

# find /usr/ -name \*.exe | grep -v wininst | xargs ls -lahS
-rw-rw-r--    1 root     root       73.5K Sep  8 14:28 /usr/lib/python3.8/site-packages/setuptools/gui-64.exe
-rw-rw-r--    1 root     root       73.0K Sep  8 14:28 /usr/lib/python3.8/site-packages/setuptools/cli-64.exe
-rw-rw-r--    1 root     root       64.0K Sep  8 14:28 /usr/lib/python3.8/site-packages/setuptools/cli-32.exe
-rw-rw-r--    1 root     root       64.0K Sep  8 14:28 /usr/lib/python3.8/site-packages/setuptools/cli.exe
-rw-rw-r--    1 root     root       64.0K Sep  8 14:28 /usr/lib/python3.8/site-packages/setuptools/gui-32.exe
-rw-rw-r--    1 root     root       64.0K Sep  8 14:28 /usr/lib/python3.8/site-packages/setuptools/gui.exe
Signature · 1 line
Bye, Peter Korsgaard
#5 lore raw

PATCH 1/2 package/python3: do not install MS Windows installers on the target

In reply to Titouan Christophe
Quoted 18 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Titouan" == Titouan Christophe <[email protected]> writes:

Buildroot generates Linux systems, so there is no need to have MS Windows executables in there.

This reduces the target filesystem size by about 2MB:

$ du -hcs usr/lib/python3.8/distutils/command/wininst-*.exe
60K usr/lib/python3.8/distutils/command/wininst-6.0.exe
64K usr/lib/python3.8/distutils/command/wininst-7.1.exe
60K usr/lib/python3.8/distutils/command/wininst-8.0.exe
192K    usr/lib/python3.8/distutils/command/wininst-9.0.exe
220K    usr/lib/python3.8/distutils/command/wininst-9.0-amd64.exe
188K    usr/lib/python3.8/distutils/command/wininst-10.0.exe
220K    usr/lib/python3.8/distutils/command/wininst-10.0-amd64.exe
448K    usr/lib/python3.8/distutils/command/wininst-14.0.exe
576K    usr/lib/python3.8/distutils/command/wininst-14.0-amd64.exe
2,0M    total
Quoted 1 line

Committed to 2020.02.x, 2020.05.x and 2020.08.x, thanks.

Signature · 1 line
Bye, Peter Korsgaard