Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
# limitations under the License.

load("@bazel_gazelle//:def.bzl", "gazelle")
load("@io_bazel_stardoc//stardoc:stardoc.bzl", "stardoc")
load("@com_github_bazelbuild_buildtools//buildifier:def.bzl", "buildifier")
load("@io_bazel_stardoc//stardoc:stardoc.bzl", "stardoc")

# gazelle:prefix github.com/bufbuild/rules_buf
# gazelle:exclude examples/
Expand Down
2 changes: 1 addition & 1 deletion MODULE.bazel.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion buf/defs.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@ Use [gazelle](/gazelle/buf) to auto generate all of these rules based on `buf.ya
"""

load("//buf/internal:breaking.bzl", _buf_breaking_test = "buf_breaking_test")
load("//buf/internal:format.bzl", _buf_format = "buf_format")
load("//buf/internal:lint.bzl", _buf_lint_test = "buf_lint_test")
load("//buf/internal:repo.bzl", _buf_dependencies = "buf_dependencies")
load("//buf/internal:format.bzl", _buf_format = "buf_format")

buf_format = _buf_format
buf_dependencies = _buf_dependencies
Expand Down
2 changes: 1 addition & 1 deletion buf/extensions.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
See https://bazel.build/docs/bzlmod#extension-definition
"""

load("//buf/internal:toolchain.bzl", "buf_download_releases")
load("//buf/internal:repo.bzl", "buf_dependencies")
load("//buf/internal:toolchain.bzl", "buf_download_releases")

_DEFAULT_VERSION = "v1.47.2"
_DEFAULT_SHA256 = "1b37b75dc0a777a0cba17fa2604bc9906e55bb4c578823d8b7a8fe3fc9fe4439"
Expand Down
2 changes: 1 addition & 1 deletion buf/internal/breaking.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
"""Defines buf_breaking_test rule"""

load("@rules_proto//proto:defs.bzl", "ProtoInfo")
load(":plugin.bzl", "protoc_plugin_test")
load("@rules_proto//proto:proto_common.bzl", proto_toolchains = "toolchains")
load(":plugin.bzl", "protoc_plugin_test")
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Ran make format which made these changes. I'm accumulating all of this stuff to automate in a CI check.


_PROTO_TOOLCHAIN_TYPE = "@rules_proto//proto:toolchain_type"

Expand Down
2 changes: 1 addition & 1 deletion buf/internal/dependencies.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@

"""rules_buf dependencies"""

load("@bazel_tools//tools/build_defs/repo:utils.bzl", "maybe")
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
load("@bazel_tools//tools/build_defs/repo:utils.bzl", "maybe")

bazel_dependencies = {
"bazel_skylib": {
Expand Down
2 changes: 1 addition & 1 deletion buf/internal/lint.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
"""Defines buf_lint_test rule"""

load("@rules_proto//proto:defs.bzl", "ProtoInfo")
load(":plugin.bzl", "protoc_plugin_test")
load("@rules_proto//proto:proto_common.bzl", proto_toolchains = "toolchains")
load(":plugin.bzl", "protoc_plugin_test")

_PROTO_TOOLCHAIN_TYPE = "@rules_proto//proto:toolchain_type"

Expand Down
2 changes: 1 addition & 1 deletion examples/bzlmod/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@
# See the License for the specific language governing permissions and
# limitations under the License.

load("@gazelle//:def.bzl", "gazelle", "gazelle_binary")
load("@rules_buf//buf:defs.bzl", "buf_format", "buf_lint_test")
load("@rules_proto//proto:defs.bzl", "proto_library")
load("@gazelle//:def.bzl", "gazelle", "gazelle_binary")

exports_files(
["buf.yaml"],
Expand Down
4 changes: 2 additions & 2 deletions examples/bzlmod/MODULE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@
"Bazel dependencies"

bazel_dep(name = "rules_buf", version = "0.0.0", dev_dependency = True)
bazel_dep(name = "gazelle", version = "0.34.0", dev_dependency = True)
bazel_dep(name = "gazelle", version = "0.40.0", dev_dependency = True)

bazel_dep(name = "protobuf", version = "29.0", repo_name = "com_google_protobuf")
bazel_dep(name = "protobuf", version = "29.1", repo_name = "com_google_protobuf")
bazel_dep(name = "rules_proto", version = "7.0.2")

local_path_override(
Expand Down
3 changes: 1 addition & 2 deletions examples/bzlmod/MODULE.bazel.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

17 changes: 9 additions & 8 deletions examples/echo/MODULE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -15,35 +15,36 @@
"Bazel dependencies"

bazel_dep(name = "rules_buf", version = "0.0.0", dev_dependency = True)
bazel_dep(name = "gazelle", version = "0.36.0", dev_dependency = True)
bazel_dep(name = "gazelle", version = "0.40.0", dev_dependency = True)
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Updated to keep in sync w/ the rules_buf dependencies. This worked but led to warnings at runtime.


bazel_dep(name = "protobuf", version = "29.1", repo_name = "com_google_protobuf")
bazel_dep(name = "rules_proto", version = "7.0.2")
bazel_dep(name = "rules_go", version = "0.54.1")
bazel_dep(name = "rules_go", version = "0.59.0")

local_path_override(
module_name = "rules_buf",
path = "../..",
)

go_sdk = use_extension("@rules_go//go:extensions.bzl", "go_sdk")

go_sdk.from_file(go_mod = "//:go.mod")

go_deps = use_extension("@gazelle//:extensions.bzl", "go_deps")
go_deps.from_file(go_mod = "//:go.mod")


use_repo(
go_deps,
"org_golang_google_protobuf",
"com_connectrpc_connect",
"org_golang_x_net"
"org_golang_google_protobuf",
"org_golang_x_net",
)

buf = use_extension("@rules_buf//buf:extensions.bzl", "buf")

# Override the default version of buf
buf.toolchains(version = "v1.47.2", sha256 = "1b37b75dc0a777a0cba17fa2604bc9906e55bb4c578823d8b7a8fe3fc9fe4439")
buf.toolchains(
sha256 = "1b37b75dc0a777a0cba17fa2604bc9906e55bb4c578823d8b7a8fe3fc9fe4439",
version = "v1.47.2",
)

# Allow people to use `bazel run @rules_buf_toolchains//:buf -- --version`
use_repo(buf, "rules_buf_toolchains")
5 changes: 2 additions & 3 deletions examples/echo/MODULE.bazel.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions examples/echo/go.mod
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
module echo

go 1.24.2
go 1.25.0

require (
connectrpc.com/connect v1.18.1
golang.org/x/net v0.23.0
golang.org/x/net v0.53.0
google.golang.org/protobuf v1.36.6
)

require golang.org/x/text v0.14.0 // indirect
require golang.org/x/text v0.36.0 // indirect
8 changes: 4 additions & 4 deletions examples/echo/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ connectrpc.com/connect v1.18.1 h1:PAg7CjSAGvscaf6YZKUefjoih5Z/qYkyaTrBW8xvYPw=
connectrpc.com/connect v1.18.1/go.mod h1:0292hj1rnx8oFrStN7cB4jjVBeqs+Yx5yDIC2prWDO8=
github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38=
github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
golang.org/x/net v0.23.0 h1:7EYJ93RZ9vYSZAIb2x3lnuvqO5zneoD6IvWjuhfxjTs=
golang.org/x/net v0.23.0/go.mod h1:JKghWKKOSdJwpW2GEx0Ja7fmaKnMsbu+MWVZTokSYmg=
golang.org/x/text v0.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ=
golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU=
golang.org/x/net v0.53.0 h1:d+qAbo5L0orcWAr0a9JweQpjXF19LMXJE8Ey7hwOdUA=
golang.org/x/net v0.53.0/go.mod h1:JvMuJH7rrdiCfbeHoo3fCQU24Lf5JJwT9W3sJFulfgs=
golang.org/x/text v0.36.0 h1:JfKh3XmcRPqZPKevfXVpI1wXPTqbkE5f7JA92a55Yxg=
golang.org/x/text v0.36.0/go.mod h1:NIdBknypM8iqVmPiuco0Dh6P5Jcdk8lJL0CUebqK164=
google.golang.org/protobuf v1.36.6 h1:z1NpPI8ku2WgiWnf+t9wTPsn6eP1L7ksHUlkfLvd9xY=
google.golang.org/protobuf v1.36.6/go.mod h1:jduwjTPXsFjZGTmRluh+L6NjiWu7pchiJ2/5YcXBHnY=
6 changes: 0 additions & 6 deletions examples/echo/proto/echo/v1/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1,12 +1,6 @@
load("@rules_buf//buf:defs.bzl", "buf_lint_test")
load("@rules_proto//proto:defs.bzl", "proto_library")

buf_lint_test(
Comment thread
jonbodner-buf marked this conversation as resolved.
name = "eliza_v1_proto_lint",
module = "proto",
targets = [":eliza_v1_proto"],
)

Comment thread
jonbodner-buf marked this conversation as resolved.
proto_library(
name = "echo_v1_proto",
srcs = ["echo.proto"],
Expand Down
2 changes: 1 addition & 1 deletion examples/gazelle/WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ http_archive(
],
)

load("@io_bazel_rules_go//go:deps.bzl", "go_register_toolchains", "go_rules_dependencies")
load("@bazel_gazelle//:deps.bzl", "gazelle_dependencies")
load("@io_bazel_rules_go//go:deps.bzl", "go_register_toolchains", "go_rules_dependencies")

go_rules_dependencies()

Expand Down
2 changes: 1 addition & 1 deletion examples/toolchain/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@
# See the License for the specific language governing permissions and
# limitations under the License.

load("@gazelle//:def.bzl", "gazelle", "gazelle_binary")
load("@rules_buf//buf:defs.bzl", "buf_format", "buf_lint_test")
load("@rules_proto//proto:defs.bzl", "proto_library")
load("@gazelle//:def.bzl", "gazelle", "gazelle_binary")

exports_files(
["buf.yaml"],
Expand Down
2 changes: 1 addition & 1 deletion examples/toolchain/MODULE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"Bazel dependencies"

bazel_dep(name = "rules_buf", version = "0.0.0", dev_dependency = True)
bazel_dep(name = "gazelle", version = "0.34.0", dev_dependency = True)
bazel_dep(name = "gazelle", version = "0.40.0", dev_dependency = True)

bazel_dep(name = "rules_proto", version = "7.0.2")
bazel_dep(name = "toolchains_protoc", version = "0.4.1")
Expand Down
2 changes: 1 addition & 1 deletion examples/toolchain/MODULE.bazel.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion examples/unused/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@
# See the License for the specific language governing permissions and
# limitations under the License.

load("@gazelle//:def.bzl", "gazelle", "gazelle_binary")
load("@rules_buf//buf:defs.bzl", "buf_format", "buf_lint_test")
load("@rules_proto//proto:defs.bzl", "proto_library")
load("@gazelle//:def.bzl", "gazelle", "gazelle_binary")

exports_files(
["buf.yaml"],
Expand Down
4 changes: 2 additions & 2 deletions examples/unused/MODULE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@
"Bazel dependencies"

bazel_dep(name = "rules_buf", version = "0.0.0", dev_dependency = True)
bazel_dep(name = "gazelle", version = "0.34.0", dev_dependency = True)
bazel_dep(name = "gazelle", version = "0.40.0", dev_dependency = True)

bazel_dep(name = "protobuf", version = "29.0", repo_name = "com_google_protobuf")
bazel_dep(name = "protobuf", version = "29.1", repo_name = "com_google_protobuf")
bazel_dep(name = "rules_proto", version = "7.0.2")

local_path_override(
Expand Down
3 changes: 1 addition & 2 deletions examples/unused/MODULE.bazel.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions gazelle/buf/BUILD
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test")
load("@bazel_skylib//:bzl_library.bzl", "bzl_library")
load("@bazel_gazelle//:def.bzl", "gazelle", "gazelle_binary")
load("@bazel_skylib//:bzl_library.bzl", "bzl_library")
load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test")

# gazelle:exclude testdata/*

Expand Down
8 changes: 4 additions & 4 deletions gazelle/buf/repositories.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ def gazelle_buf_dependencies():
go_repository(
name = "com_github_bazelbuild_bazel_gazelle",
importpath = "github.com/bazelbuild/bazel-gazelle",
sum = "h1:umlCZxzCEr8BHdesfY2sv5T8NTv9+JiPL8f/Vk83Aag=",
version = "v0.25.0",
sum = "h1:SAYys3KRG5i3KTgQAvO423bLT1rQMSgqEKReMkM/CW0=",
version = "v0.40.0",
)
go_repository(
name = "in_gopkg_yaml_v3",
Expand All @@ -34,6 +34,6 @@ def gazelle_buf_dependencies():
go_repository(
name = "com_github_bazelbuild_buildtools",
importpath = "github.com/bazelbuild/buildtools",
sum = "h1:fmdo+fvvWlhldUcqkhAMpKndSxMN3vH5l7yow5cEaiQ=",
version = "v0.0.0-20220531122519-a43aed7014c8",
sum = "h1:FGzENZi+SX9I7h9xvMtRA3rel8hCEfyzSixteBgn7MU=",
version = "v0.0.0-20240918101019-be1c24cc9a44",
)
Loading
Loading