Skip to content

Conversation

@nataliejameson
Copy link

This is a partial migration of rules_docker to bzlmod. It is mostly
scoped to the pieces that we use, so mostly just getting the go binaries
to build, and to expose the macros/rules that we need.

Notable things:

  • Added a go.mod/go.sum for container/go
  • Some minor version changes to get new enough versions of bazel modules
    to have a MODULE.bazel file (e.g. skylib)
  • Moved to gazelle's go_deps for go repositories
  • Moved to rules_python's pip parser for python deps
  • Hooked up a docker extension to pull in the various base images,
    though that might not actually be necessary in the end.

This is a partial migration of rules_docker to bzlmod. It is mostly
scoped to the pieces that we use, so mostly just getting the go binaries
to build, and to expose the macros/rules that we need.

Notable things:
- Added a go.mod/go.sum for container/go
- Some minor version changes to get new enough versions of bazel modules
  to have a MODULE.bazel file (e.g. skylib)
- Moved to gazelle's go_deps for go repositories
- Moved to rules_python's pip parser for python deps
- Hooked up a docker extension to pull in the various base images,
  though that might not actually be necessary in the end.
@nataliejameson nataliejameson changed the base branch from nmj/allow-classpath-argfiles to nmj/migrate-rules-go February 10, 2026 22:31
extension.bzl Outdated
Comment on lines 23 to 32
for tag in module.tags.cc_images:
_cc_images()
for tag in module.tags.py_images:
_py_images()
for tag in module.tags.py3_images:
_py3_images()
for tag in module.tags.scala_images:
_scala_images()
for tag in module.tags.java_images:
_java_images()
Copy link
Member

Choose a reason for hiding this comment

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

this is....weird, do we want to make use of tag here somehow, or just call this once?

otherwise it looks like we're just calling an identical function in a loop

Copy link
Author

Choose a reason for hiding this comment

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

I'll probably just strip this out. AFAICT, we didn't actually need this in the end.

MODULE.bazel Outdated
Comment on lines 82 to 101
#go_sdk = use_extension("@io_bazel_rules_go//go:extensions.bzl", "go_sdk")
#go_sdk.download(
# name = "go_sdk",
# version = "1.23.0",
#)
#
#http_archive(
# name = "io_bazel_rules_go",
# sha256 = "08c3cd71857d58af3cda759112437d9e63339ac9c6e0042add43f4d94caf632d",
# urls = [
# "https://storage.googleapis.com/bazel-mirror/github.com/bazelbuild/rules_go/releases/download/v0.24.2/rules_go-v0.24.2.tar.gz",
# "https://github.com/bazelbuild/rules_go/releases/download/v0.24.2/rules_go-v0.24.2.tar.gz",
# ],
#)
#
#http_archive(
# name = "rules_python",
# sha256 = "b6d46438523a3ec0f3cead544190ee13223a52f6a6765a29eae7b7cc24cc83a0",
# url = "https://github.com/bazelbuild/rules_python/releases/download/0.1.0/rules_python-0.1.0.tar.gz",
#)
Copy link
Member

Choose a reason for hiding this comment

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

i think we can delete this? should be obsoleted by the bazel_dep calls above

Comment on lines +164 to +169
pip = use_extension("@rules_python//python/extensions:pip.bzl", "pip")
pip.parse(
hub_name = "io_bazel_rules_docker_pip_deps",
python_version = "3.11",
requirements_lock = "@io_bazel_rules_docker//repositories:requirements-pip.txt",
)
Copy link
Member

Choose a reason for hiding this comment

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

does this need a use_repo call?

Copy link
Author

Choose a reason for hiding this comment

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

Didn't seem so, but can't hurt.

Copy link
Member

@denbeigh2000 denbeigh2000 left a comment

Choose a reason for hiding this comment

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

cool bean-anas 👍

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