Skip to content
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

Add support for bzlmod + Bazel 8 #289

Merged
merged 3 commits into from
Jan 7, 2025
Merged

Add support for bzlmod + Bazel 8 #289

merged 3 commits into from
Jan 7, 2025

Conversation

jchadwick-buf
Copy link
Member

This is a full-rewrite of the WORKSPACE.bazel rules + a bzlmod MODULE.bazel implementation.

For both Bazel 7.x and Bazel 8.x, all of the following combinations will work:

# Legacy WORKSPACE mode
bazel build --noenable_bzlmod --enable_workspace //... && bazel test --noenable_bzlmod --enable_workspace //...

# Bzlmod-only mode
bazel build --enable_bzlmod --noenable_workspace //... && bazel test --enable_bzlmod --noenable_workspace //...

# Hybrid incremental migration mode
bazel build --enable_bzlmod --enable_workspace //... && bazel test --enable_bzlmod --enable_workspace //...

Some modules needed to be updated for Bazel 8.x compatibility. Also, some WORKSPACE code need to be retained for Bazel 7.x compatibility that could otherwise be omitted.

Gazelle is set up to function in bzlmod mode and can be invoked using bazel mod tidy.

I don't think we should need to substantially change CI except to test all of the possible configuration modes to ensure they do not break on accident.

Copy link

github-actions bot commented Jan 6, 2025

The latest Buf updates on your PR. Results from workflow Buf CI / buf (pull_request).

BuildFormatLintBreakingUpdated (UTC)
✅ passed✅ passed✅ passed✅ passedJan 6, 2025, 10:26 PM

@jchadwick-buf jchadwick-buf marked this pull request as ready for review January 6, 2025 22:30
###############################################################################
module(
name = "protovalidate",
version = "0.10.0",
Copy link
Member

Choose a reason for hiding this comment

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

How can we automate setting this value so cutting releases does not need to remember to set it?

Copy link
Member Author

Choose a reason for hiding this comment

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

Per discussion: Let's restrict release tagging to a release workflow, and have it do the work of ensuring that the module version is consistent with the tag.

@jchadwick-buf jchadwick-buf merged commit 056a873 into main Jan 7, 2025
6 checks passed
@jchadwick-buf jchadwick-buf deleted the jchadwick/bzlmod branch January 7, 2025 18:12
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