diff --git a/CHANGELOG.md b/CHANGELOG.md index 72cf0d4e0b..0c3e01c57f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -47,6 +47,15 @@ changelog](https://rules-python.readthedocs.io/en/latest/changelog.html). in {obj}`python.defaults`, {obj}`python_register_toolchains`, and {obj}`python_register_multi_toolchains` ([#4023](https://github.com/bazel-contrib/rules_python/pull/4023)). +* (toolchains) Shared `libpython*.so*` files are now excluded by default from + hermetic Python runtime files for recognized Astral `python-build-standalone` + builds (`20250517` and newer), which statically link `libpython` into the + interpreter. Older, custom, or unrecognized runtimes retain them. Set + `libpython = "include"` or `"exclude"` on {obj}`python.override`, + {obj}`python.single_version_override`, + {obj}`python.single_version_platform_override`, or + {obj}`python_register_toolchains` to override this behavior + ([#4165](https://github.com/bazel-contrib/rules_python/pull/4165)). {#v2-4-0-fixed} ### Fixed @@ -81,6 +90,10 @@ changelog](https://rules-python.readthedocs.io/en/latest/changelog.html). * (toolchain) Fixed a crash on Windows when precompiling is enabled: the precompiler's interpreter couldn't find its DLLs once relocated ([#4082](https://github.com/bazel-contrib/rules_python/issues/4082)). +* (zipapp) Reduced self-contained archive sizes by preserving Python executable + symlinks instead of storing each alias as another copy of the interpreter, and + by omitting shared `libpython` files from recognized statically linked Astral + runtime builds. {#v2-4-0-added} ### Added @@ -91,6 +104,7 @@ changelog](https://rules-python.readthedocs.io/en/latest/changelog.html). package directory, set it to `None` or `""` to set it to the root of the repo ([#4029](https://github.com/bazel-contrib/rules_python/issues/4029)). + {#v2-3-4} ## [2.3.4] - 2026-09-21 diff --git a/news/4165.changed.md b/news/4165.changed.md deleted file mode 100644 index 64e91b2347..0000000000 --- a/news/4165.changed.md +++ /dev/null @@ -1,9 +0,0 @@ -(toolchains) Shared `libpython*.so*` files are now excluded by default from -hermetic Python runtime files for recognized Astral `python-build-standalone` -builds (`20250517` and newer), which statically link `libpython` into the -interpreter. Older, custom, or unrecognized runtimes retain them. Set -`libpython = "include"` or `"exclude"` on {obj}`python.override`, -{obj}`python.single_version_override`, -{obj}`python.single_version_platform_override`, or -{obj}`python_register_toolchains` to override this behavior -([#4165](https://github.com/bazel-contrib/rules_python/pull/4165)). diff --git a/news/py-zipapp-size.fixed.md b/news/py-zipapp-size.fixed.md deleted file mode 100644 index 508882b9da..0000000000 --- a/news/py-zipapp-size.fixed.md +++ /dev/null @@ -1,4 +0,0 @@ -(zipapp) Reduced self-contained archive sizes by preserving Python executable -symlinks instead of storing each alias as another copy of the interpreter, and -by omitting shared `libpython` files from recognized statically linked Astral -runtime builds. diff --git a/python/private/python.bzl b/python/private/python.bzl index c7ca018102..8256e1b856 100644 --- a/python/private/python.bzl +++ b/python/private/python.bzl @@ -1361,7 +1361,7 @@ Valid values are `auto`, `include`, and `exclude`. With `auto`, recognized Astral Python Standalone builds from 20250517 onward exclude the shared libraries; other runtimes retain them. -:::{versionadded} VERSION_NEXT_PATCH +:::{versionadded} 2.4.0 ::: """, values = ["auto", "include", "exclude"], @@ -1450,7 +1450,7 @@ Valid values are `auto`, `include`, and `exclude`. With `auto`, recognized Astral Python Standalone builds from 20250517 onward exclude the shared libraries; other runtimes retain them. -:::{versionadded} VERSION_NEXT_PATCH +:::{versionadded} 2.4.0 ::: """, values = ["auto", "include", "exclude"], @@ -1532,7 +1532,7 @@ Valid values are `auto`, `include`, and `exclude`. With `auto`, recognized Astral Python Standalone builds from 20250517 onward exclude the shared libraries; other runtimes retain them. -:::{versionadded} VERSION_NEXT_PATCH +:::{versionadded} 2.4.0 ::: """, values = ["auto", "include", "exclude"],