Skip to content

fix: Return repo_metadata from repository rules in rust/repositories.bzl - #3855

Merged
illicitonion merged 1 commit into
bazelbuild:mainfrom
mortenmj:mmj/rust-toolchain-tools-reproducible
Feb 19, 2026
Merged

fix: Return repo_metadata from repository rules in rust/repositories.bzl#3855
illicitonion merged 1 commit into
bazelbuild:mainfrom
mortenmj:mmj/rust-toolchain-tools-reproducible

Conversation

@mortenmj

@mortenmj mortenmj commented Feb 14, 2026

Copy link
Copy Markdown
Contributor

This allows repos produced by rust_toolchain_tools_repository to use the remote repo content cache.

Using Bazel 9.0.0 and the remote repo content cache, the external directory in the output base is much smaller when using this patch. Downloading the toolchain, which comes in at almost 800 MB, can be entirely skipped when using remote execution.

Before:

external # du -h -d1 | sort -h | grep rules_rust
<SNIP>
4.0K    ./rules_rust++i+rules_rust_tinyjson
32K     ./rules_rust++rust+rust_toolchains
196K    ./rules_rust_prost+
6.1M    ./rules_rust+
787M    ./rules_rust++rust+rust_linux_x86_64__x86_64-unknown-linux-gnu__stable_tools

After:

external # du -h -d1 | sort -h | grep rules_rust
<SNIP>
4.0K    ./rules_rust++i+rules_rust_tinyjson
4.0K    ./rules_rust++rust+rust_linux_x86_64__x86_64-unknown-linux-gnu__stable_tools
32K     ./rules_rust++rust+rust_toolchains
196K    ./rules_rust_prost+
6.1M    ./rules_rust+

@mortenmj
mortenmj force-pushed the mmj/rust-toolchain-tools-reproducible branch from 1c52b2d to 28fd5cb Compare February 14, 2026 16:07
@mortenmj mortenmj changed the title fix: Return repo_metadata from rust_toolchain_tools_repository fix: Return repo_metadata from repository rules in rust/repositories.bzl Feb 14, 2026

@dzbarsky dzbarsky left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@mortenmj
mortenmj force-pushed the mmj/rust-toolchain-tools-reproducible branch from 28fd5cb to b857d5d Compare February 18, 2026 22:28

@illicitonion illicitonion left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks reasonable, thanks!

@illicitonion
illicitonion added this pull request to the merge queue Feb 19, 2026
Merged via the queue into bazelbuild:main with commit 86d809e Feb 19, 2026
3 checks passed
dzbarsky pushed a commit to hermeticbuild/rules_rust that referenced this pull request Feb 20, 2026
…bzl (bazelbuild#3855)

This allows repos produced by `rust_toolchain_tools_repository` to use
the remote repo content cache.

Using Bazel 9.0.0 and the remote repo content cache, the external
directory in the output base is much smaller when using this patch.
Downloading the toolchain, which comes in at almost 800 MB, can be
entirely skipped when using remote execution.

Before:
```shell
external # du -h -d1 | sort -h | grep rules_rust
<SNIP>
4.0K    ./rules_rust++i+rules_rust_tinyjson
32K     ./rules_rust++rust+rust_toolchains
196K    ./rules_rust_prost+
6.1M    ./rules_rust+
787M    ./rules_rust++rust+rust_linux_x86_64__x86_64-unknown-linux-gnu__stable_tools
```

After:
```shell
external # du -h -d1 | sort -h | grep rules_rust
<SNIP>
4.0K    ./rules_rust++i+rules_rust_tinyjson
4.0K    ./rules_rust++rust+rust_linux_x86_64__x86_64-unknown-linux-gnu__stable_tools
32K     ./rules_rust++rust+rust_toolchains
196K    ./rules_rust_prost+
6.1M    ./rules_rust+
```
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.

3 participants