Skip to content

build-python3.sh: remove test modules to reduce size - #171

Merged
cho-m merged 1 commit into
mainfrom
build-python3-reduce-size
Aug 3, 2026
Merged

build-python3.sh: remove test modules to reduce size#171
cho-m merged 1 commit into
mainfrom
build-python3-reduce-size

Conversation

@cho-m

@cho-m cho-m commented Aug 3, 2026

Copy link
Copy Markdown
Member

Test modules are for self-testing Python so aren't needed by glibc. They account for ~120M of installation which is a third of the total size.

The default OPT sets -g which adds another 20M of unused debug symbols. We can override this to avoid bloat

Also avoid installing libpython.a (~43M) and setting up ensurepip (~23M) which shouldn't be needed to build glibc.


glibc is one of packages that may need to be built from source so keeping sizes small indirectly helps with faster install.

Copilot AI review requested due to automatic review settings August 3, 2026 14:50

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR reduces the size of the Python 3 installation produced by build-python3.sh, aiming to minimize bootstrap footprint while still providing a usable Python needed for building glibc and related packages.

Changes:

  • Overrides Python鈥檚 build OPT flags to avoid carrying debug symbols into the installation.
  • Configures CPython to avoid installing test modules, ensurepip, and the static libpython archive to reduce installed size.

馃挕 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread build-python3.sh Outdated
Test modules are for self-testing Python so aren't needed by glibc. They
account for ~120M of installation which is a third of the total size.

Also avoid installing libpython.a (~43M) and setting up ensurepip (~23M)
which shouldn't be needed to build glibc.
@cho-m
cho-m force-pushed the build-python3-reduce-size branch from b8ec4d5 to 481c00b Compare August 3, 2026 15:23
@cho-m
cho-m requested a review from Copilot August 3, 2026 15:25

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated no new comments.

@cho-m
cho-m merged commit 3ffaa99 into main Aug 3, 2026
20 checks passed
@cho-m
cho-m deleted the build-python3-reduce-size branch August 3, 2026 16:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants