Skip to content

refactor(toolchains): configure prebuilt and from-source tool toolchains - #4280

Draft
rickeylev wants to merge 2 commits into
bazel-contrib:mainfrom
rickeylev:configure_tool_source_builds
Draft

rickeylev wants to merge 2 commits into
bazel-contrib:mainfrom
rickeylev:configure_tool_source_builds

Conversation

@rickeylev

@rickeylev rickeylev commented Oct 18, 2026 •

Copy link
Copy Markdown
Collaborator

Configure prebuilt tool binaries when consuming a release archive, and build
tools from source when developing rules_python or overriding with a git
commit. For now, using these prebuilt binaries are disabled for release
archives.

To make this work, MODULE.bazel has a boolean that decides whether
rules_rust et al are dev dependencies. By default, they are not dev
dependencies. This default is chosen so that sub-modules for
testing use the from-source toolchains and that using non-release
commits also use the from-source toolchains. When creating the
release archive, this value is rewritten to make them dev dependencies.
This means release archives can't use from-source toolchains unless
they patch MODULE.bazel (and likely more), but this seems like
a reasonable trade-off for complexity vs configurability.

Work towards #4216
Work towards #4250

Use prebuilt tool binaries when consuming a release archive, and build
tools from source when developing rules_python or overriding with a git
commit.

Release archives bundle python/private/artifacts_manifest.json and set
TOOL_DEPS_DEV_ONLY = True in MODULE.bazel so release consumers can fetch
prebuilt binaries via http_file without pulling in rules_rust. Keep the
Rust exe_zip_maker disabled by default in releases until it is ready for
general rollout, while keeping it enabled by default during rules_python
development.

Work towards bazel-contrib#4216
Work towards bazel-contrib#4250
@rickeylev
rickeylev requested a review from aignas as a code owner October 18, 2026 23:04
@rickeylev
rickeylev marked this pull request as draft October 18, 2026 23:51
create_archive_and_notes.sh only runs on Linux in CI and uses GNU
sed --in-place, which is not supported by macOS BSD sed.

This branch has not been deployed

No deployments
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.

1 participant