Skip to content

Conversation

@bazel-contrib-bot
Copy link
Contributor

@bazel-io
Copy link
Member

Hello @loosebazooka, @thesayyn, modules you maintain (rules_distroless) have been updated in this PR.
Please review the changes. You can view a diff against the previous version in the "Generate module diff" check.

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request adds version 0.6.1 of rules_distroless to the Bazel Central Registry. The new version definition is mostly correct and follows the BCR guidelines. However, there is a significant issue in the MODULE.bazel file where several http_archive repositories for examples are defined as regular dependencies. This will cause all downstream users of this module to download unnecessary files. I have provided a high-severity comment with a recommendation to move this logic into a development-only dependency.

Comment on lines +42 to +63
http_archive = use_repo_rule("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")

http_archive(
name = "example-bullseye-ca-certificates",
build_file_content = 'exports_files(["data.tar.xz", "control.tar.xz"])',
sha256 = "b2d488ad4d8d8adb3ba319fc9cb2cf9909fc42cb82ad239a26c570a2e749c389",
urls = ["https://snapshot.debian.org/archive/debian/20231106T210201Z/pool/main/c/ca-certificates/ca-certificates_20210119_all.deb"],
)

http_archive(
name = "example-bullseye-libc-bin",
build_file_content = 'exports_files(["data.tar.xz"])',
sha256 = "8b048ab5c7e9f5b7444655541230e689631fd9855c384e8c4a802586d9bbc65a",
urls = ["https://snapshot.debian.org/archive/debian-security/20231106T230332Z/pool/updates/main/g/glibc/libc-bin_2.31-13+deb11u7_amd64.deb"],
)

http_archive(
name = "example-bookworm-libc-bin",
build_file_content = 'exports_files(["data.tar.xz"])',
sha256 = "38c44247c5b3e864d6db2877edd9c9a0555fc4e23ae271b73d7f527802616df5",
urls = ["https://snapshot.debian.org/archive/debian-security/20231106T230332Z/pool/updates/main/g/glibc/libc-bin_2.36-9+deb12u3_armhf.deb"],
)
Copy link
Contributor

Choose a reason for hiding this comment

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

high

The http_archive repositories defined here are for examples, but they are not declared as development dependencies. This means that any downstream project that depends on rules_distroless will unconditionally download these .deb files and create these external repositories (example-bullseye-ca-certificates, example-bullseye-libc-bin, example-bookworm-libc-bin), even if they are not used. This adds unnecessary download overhead and pollutes the user's external repository space.

These repository definitions should only be evaluated when rules_distroless is the main module being built (i.e., for development and testing). To fix this, these http_archive calls should be moved into a module extension that is loaded with dev_dependency = True.

Copy link
Member

@bazel-io bazel-io left a comment

Choose a reason for hiding this comment

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

All modules in this PR have been approved by their maintainers. This PR will be merged if all presubmit checks pass.

@bazel-io bazel-io merged commit 8ad160e into bazelbuild:main Oct 25, 2025
16 checks passed
@bazel-io bazel-io added the auto-merged This PR is automatically merged by the BCR reviewer bot. label Oct 25, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

auto-merged This PR is automatically merged by the BCR reviewer bot.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants