Skip to content

Commit c464fb6

Browse files
authored
Merge pull request #24 from isaacparker0/main
Switch from rust-protobuf to prost
2 parents da4a09f + 72cc0e0 commit c464fb6

16 files changed

Lines changed: 158 additions & 101 deletions

File tree

BUILD.bazel

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,8 @@ gazelle(
4949
command = "update-repos",
5050
)
5151

52-
# NOTE: need to use the version of protobuf from rules_rust so that it matches
53-
# gazelle:resolve rust protobuf @rules_rust_protobuf//3rdparty/crates:protobuf
52+
# NOTE: need to use the version of prost from rules_rust so that it matches
53+
# gazelle:resolve rust prost @rules_rust_prost//private/3rdparty/crates:prost
5454

5555
# NOTE: use cargo_bazel to parse the lockfile
5656
# gazelle:resolve rust cargo_bazel @rules_rust//crate_universe:cargo_bazel

MODULE.bazel

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,9 @@ use_repo(rust, "rust_toolchains")
3131

3232
register_toolchains("@rust_toolchains//:all")
3333

34-
### Protobuf
34+
### Protobuf (prost)
3535

36-
bazel_dep(name = "rules_rust_protobuf", version = "0.67.0")
36+
bazel_dep(name = "rules_rust_prost", version = "0.67.0")
3737

3838
# Rust dependencies
3939
crate = use_extension("@rules_rust//crate_universe:extension.bzl", "crate", isolate=True)

MODULE.bazel.lock

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

example/MODULE.bazel.lock

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

generation_tests/prost/BUILD.in

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
load("@rules_proto//proto:defs.bzl", "proto_library")
2+
3+
proto_library(
4+
name = "foo_proto",
5+
srcs = ["foo.proto"],
6+
)
7+
8+
rust_prost_library(
9+
name = "foo_rust_proto",
10+
proto = ":foo_proto",
11+
)
12+
13+
rust_library(
14+
name = "lib",
15+
srcs = ["lib.rs"],
16+
)

generation_tests/prost/BUILD.out

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
load("@rules_proto//proto:defs.bzl", "proto_library")
2+
load("@rules_rust//rust:defs.bzl", "rust_library")
3+
load("@rules_rust_prost//:defs.bzl", "rust_prost_library")
4+
5+
proto_library(
6+
name = "foo_proto",
7+
srcs = ["foo.proto"],
8+
)
9+
10+
rust_prost_library(
11+
name = "foo_rust_proto",
12+
proto = ":foo_proto",
13+
)
14+
15+
rust_library(
16+
name = "lib",
17+
srcs = ["lib.rs"],
18+
deps = [":foo_rust_proto"],
19+
)

generation_tests/prost/README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
2+
rust_prost_library dependency resolution.

generation_tests/prost/WORKSPACE

Whitespace-only changes.

generation_tests/prost/foo.proto

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
syntax = "proto3";
2+
message Foo {}

generation_tests/prost/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
use foo_proto::Foo;

0 commit comments

Comments
 (0)