Conversation
…chives Runtimes always used install_only archives, which include debug symbols. The install_only_stripped variants are much smaller; for example, a Python 3.14 zipapp shrinks from 147 MB to 65 MB. Add python.override(archive_flavor) with install_only (default), install_only_stripped, and full. The manifest sort key is shared and prefers the selected flavor, falling back when unavailable. Built-in manifest entries now include stripped archive hashes for releases from 20240726 onward, sourced from the official SHA256SUMS files. Fixes bazel-contrib#4163
Contributor
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
Add coverage for the full flavor and address the noted release-note and formatting issues.
Review effort: Lite
Findings: 1
Open (4)
What changed in this PR
Adds configurable Python standalone archive flavors, including stripped archives and fallback selection.
Changes:
- Adds
archive_flavoroverride support. - Updates manifest ranking and stripped archive hashes.
- Adds tests, documentation, mocks, and release notes.
| File | Summary |
|---|---|
tests/support/mocks/python_ext.bzl |
Updates mock override attributes. |
tests/python/python_tests.bzl |
Tests archive selection and fallback behavior. |
python/versions.bzl |
Reuses shared manifest sorting. |
python/private/runtimes_manifest.txt |
Adds stripped archive checksums. |
python/private/python.bzl |
Implements archive flavor configuration. |
python/private/pbs_manifest.bzl |
Defines flavor-aware manifest ranking. |
news/stripped-python-archives.added.md |
Adds the release note. |
docs/toolchains.md |
Documents archive flavor selection. |
💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Comment on lines
+1316
to
+1324
| Valid values are `install_only`, `install_only_stripped`, and `full`. Use | ||
| `install_only_stripped` to reduce runtime and zipapp size by omitting debug | ||
| symbols. If the preferred flavor is unavailable for a runtime, another | ||
| available flavor is used. | ||
|
|
||
| :::{versionadded} VERSION_NEXT_FEATURE | ||
| ::: | ||
| """, | ||
| values = ["install_only", "install_only_stripped", "full"], |
| @@ -0,0 +1,3 @@ | |||
| (toolchains) Added {attr}`python.override.archive_flavor` to select | |||
| @@ -0,0 +1,3 @@ | |||
| (toolchains) Added {attr}`python.override.archive_flavor` to select | |||
| `install_only_stripped` python-build-standalone archives, which omit debug | |||
| symbols and reduce runtime and zipapp size. | |||
Comment on lines
+478
to
+482
| tool_versions = _parse_archive_flavor_modules("install_only_stripped").config.default["tool_versions"] | ||
| platform = "x86_64-unknown-linux-gnu" | ||
|
|
||
| env.expect.that_str(tool_versions["3.14.4"]["sha256"][platform]).equals("2" * 64) | ||
| env.expect.that_str(tool_versions["3.14.4"]["url"][platform][0]).contains("install_only_stripped") |
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


Runtimes always used install_only archives, which include debug symbols. The install_only_stripped variants are much smaller; for example, a Python 3.14 zipapp shrinks from 147 MB to 65 MB.
Add python.override(archive_flavor) with install_only (default), install_only_stripped, and full. The manifest sort key is shared and prefers the selected flavor, falling back when unavailable. Built-in manifest entries now include stripped archive hashes for releases from 20240726 onward, sourced from the official SHA256SUMS files.
Fixes #4163