Skip to content

fix(toolchain): exclude libpython from runtime in recent releases - #4091

Draft
aignas wants to merge 5 commits into
bazel-contrib:mainfrom
aignas:aignas.feat.toolchain_slim
Draft

fix(toolchain): exclude libpython from runtime in recent releases#4091
aignas wants to merge 5 commits into
bazel-contrib:mainfrom
aignas:aignas.feat.toolchain_slim

Conversation

@aignas

@aignas aignas commented Aug 22, 2026

Copy link
Copy Markdown
Collaborator

Use the already existing auto-detection and exclude libpython and
friends as suggested in the upstream ticket.

Fixes #3534

Use the already existing auto-detection and exclude libpython and
friends as suggested in the upstream ticket.

Fixes bazel-contrib#3534
@aignas
aignas requested a review from rickeylev as a code owner August 22, 2026 14:34
@aignas
aignas marked this pull request as draft August 22, 2026 15:57
@aignas

aignas commented Aug 22, 2026

Copy link
Copy Markdown
Collaborator Author

Re-read the comment and realized that this should be config flag gated, will PoC the interface

@rickeylev

Copy link
Copy Markdown
Collaborator

Re: interface: I had three thoughts

One: a coarse/vague string flag like minimal/full/some-use-case-name

Two: a string flag of pieces to include/exclude, similar to how output group flag works. -libs,+pip,-headers,-tcl,etc

Three: a flag to pick the runtime flavor, ie install_only (which is a 26M install compared to the other tars) (this flag will be added regardless, eventually)

@aignas

aignas commented Aug 22, 2026

Copy link
Copy Markdown
Collaborator Author

I am done for the day so I'll quickly respond:

One: a coarse/vague string flag like minimal/full/some-use-case-name

I chose to be very specific here with respect to what we are including. I chose to have a runtime inclusion behaviour because we already have the thing extracted, so we can support various configurations given the extracted contents and what is present.

Two: a string flag of pieces to include/exclude, similar to how output group flag works. -libs,+pip,-headers,-tcl,etc

This is a nice idea, but could feel clunky? Maybe not... The nice thing here is that we could trampoline off of what user supplies and use FeatureFlagInfo to get derived flags for what we need. I like this because it keeps the API surface small and extendible.

Three: a flag to pick the runtime flavor, ie install_only (which is a 26M install compared to the other tars) (this flag will be added regardless, eventually)

This can be already achieved via what is provided to the machinery as the URLs. I thought the install_only still has the libpython?

Feel free to hack on this and mold it to your liking.

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.

bin/python size exploded 2000 times larger

2 participants