-
Notifications
You must be signed in to change notification settings - Fork 421
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
Migrate to Bzlmod for managing external dependencies #1204
Comments
I would love to use this repo through a Bazel module as well! I use Bazel modules and I had to write my own module extension to load it as an http_archive which is a hassle. I would be open to helping with the migration if there are any well scoped tasks I could take on. |
@AttilaTheFun This issue is more about migrating buildtools to be built and tested with external deps fetched from Bzlmod. Do you mean you want to buildtools as an external dependency? Can you explain a bit about why you need to do that? |
@meteorcloudy I know you can install buildifier and buildozer as prebuilt binaries, but I much prefer to add them as bazel dependencies and build from source. This is especially useful if I want to use forked copy of the repo while waiting for changes to be merged upstream. I also don't need to worry about selecting the right binary for use on the machine (macos arm vs intel, linux on ci). |
I see, that sounds doable. @vladmos is the main maintainer of buildtools, I assume he'll be happy to accept the contributions ;) |
@meteorcloudy @vladmos FYI other people are requesting this on the bazelbuild/bazel-central-registry side too: |
I tried and took a stab at adding support, but the check on the generated proto files fails due to the version mismatch between |
For the record, there's an unofficial repo that allows setting up Example:
$ bazel run -- //:buildifier.check
INFO: Analyzed target //:buildifier.check (68 packages loaded, 343 targets configured).
INFO: Found 1 target...
Target //:buildifier.check up-to-date:
bazel-bin/buildifier.check.bash
INFO: Elapsed time: 0.387s, Critical Path: 0.01s
INFO: 1 process: 1 internal.
INFO: Build completed successfully, 1 total action
INFO: Running command line: bazel-bin/buildifier.check.bash
./tests/BUILD:
--- ./tests/BUILD 2024-02-20 20:26:07.852510800 -0800
+++ /tmp/buildifier-tmp-1708334010 2024-02-20 20:26:09.836148000 -0800
@@ -4,8 +4,8 @@
py_library(
name = "__init__",
- deps = [],
srcs = ["__init__.py"],
+ deps = [],
)
py_library(
exit status 1 |
- Removed C++ options in .bazelrc since we by default using Bazel 7 which defauts to c++17 - Shorten the workspace name to avoid long path issue on Windows. Fixes #1210
https://github.com/bazelbuild/buildtools/blob/main/MODULE.bazel seems pretty complete. Is anything left to do? |
Looks like the default build on CI is already Bzlmod enabled, we can close this one now! |
With future Bazel LTS versions, Bzlmod will become the default system for external dependencies management.
Please consider migrating all your external dependencies in WORKSPACE to MODULE.bazel
For more information, please check bazelbuild/bazel#18958
The text was updated successfully, but these errors were encountered: