Skip to content

refactor(toolchains): share Python version config settings - #4159

Merged
aignas merged 2 commits into
bazel-contrib:mainfrom
dzbarsky:deduplicate-python-toolchain-version-settings
Sep 15, 2026
Merged

aignas merged 2 commits into
bazel-contrib:mainfrom
dzbarsky:deduplicate-python-toolchain-version-settings

Conversation

@dzbarsky

@dzbarsky dzbarsky commented Sep 10, 2026 •

Copy link
Copy Markdown
Contributor

Generated toolchain BUILD files repeat Python version config_setting predicates for each suite. toolchain_suites_content now emits each distinct predicate once and passes its label to py_toolchain_suite, preserving version matching while reducing retained configuration data.

In our repo, this removes 79MB of retained heap.

Validation: buildifier -mode=check on the three changed files and git diff --check passed. bazel test --config=fast-tests --jobs=4 //tests/toolchains/... //tests/config_settings/... passed (36 passed, 1 skipped).

Generate each distinct Python version and flag predicate once per toolchain repository and reuse it across py_toolchain_suite calls.

In our repo, this removes 79MB of retained heap.
@aignas

aignas commented Sep 15, 2026

Copy link
Copy Markdown
Collaborator

Thanks!

@aignas
aignas added this pull request to the merge queue Sep 15, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Sep 15, 2026
@aignas
aignas added this pull request to the merge queue Sep 15, 2026
Merged via the queue into bazel-contrib:main with commit 809c0f5 Sep 15, 2026
5 checks passed
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.

2 participants