-
Notifications
You must be signed in to change notification settings - Fork 3
[bzlmod] Migrate necessary pieces to bzlmod #5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: nmj/migrate-rules-go
Are you sure you want to change the base?
Conversation
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.
extension.bzl
Outdated
| 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() |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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
| #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", | ||
| #) |
There was a problem hiding this comment.
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
| 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", | ||
| ) |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
denbeigh2000
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cool bean-anas 👍
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:
to have a MODULE.bazel file (e.g. skylib)
though that might not actually be necessary in the end.