Skip to content

Mark pinned toolchain and plugin repos reproducible - #309

Merged
abrisco merged 2 commits into
periareon:mainfrom
sethvargo:sethvargo/toolchain-repo-metadata
Oct 29, 2026
Merged

abrisco merged 2 commits into
periareon:mainfrom
sethvargo:sethvargo/toolchain-repo-metadata

Conversation

@sethvargo

Copy link
Copy Markdown
Contributor

Closes #308.

#286 moved helm_import_repository to repository_ctx.repo_metadata, but the toolchain repos still returned a bare dict. Bazel never put them in the repo contents cache, so every new output base downloaded and extracted helm again.

This change makes three rules return repo_metadata:

Rule Returns
helm_toolchain_repository reproducible = True when integrity is set, which the extension always does. Without it, the resolved integrity goes in attrs_for_reproducibility, the same as before.
helm_plugin_repository reproducible = True when integrity is set. The attribute is mandatory.
helm_toolchain_repository_hub reproducible = True. It only writes files from its attributes.

helm_host_alias_repository stays as it is because it reads repository_ctx.os. All three use the same hasattr guard as import.bzl, so Bazel 7 still gets the old return values.

Testing

On Bazel 9.3.1, I fetched the toolchain, with_cm_push, and plugin repos for darwin_arm64 into two fresh output bases that shared one --repository_cache. In both output bases, each repo was a symlink to the same repo contents cache entry. Before this change, the toolchain and plugin repos were real directories in every output base. buildifier -mode=check -lint=warn passes.

@abrisco abrisco 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.

Thank you!

@sethvargo

Copy link
Copy Markdown
Contributor Author

@abrisco it looks like CI is failing, but I'm not entirely sure why?

@abrisco
abrisco merged commit 8eb6aa7 into periareon:main Oct 29, 2026
31 of 39 checks passed
@sethvargo
sethvargo deleted the sethvargo/toolchain-repo-metadata branch October 29, 2026 23:44
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.

Return repo_metadata(reproducible = True) from the toolchain repo rules

2 participants