summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Jeff Vander Stoep <jeffv@google.com> 2023-03-22 15:09:00 +0100
committer Jeff Vander Stoep <jeffv@google.com> 2023-03-24 09:32:36 +0100
commit91c0466094ee93f368f3af3284a097024aef7162 (patch)
tree0d4b720573ffd047b0a02a857289ecf81c48a520
parentcd7db25738893ce424757527de6b25193525ae25 (diff)
rust_proto: use protobuf crate version 2.x
Test: build Bug: 270895633 Change-Id: I04e5e7fe70b8c509cd1b35852b75a0f24a633ce9
-rw-r--r--rust/protobuf.go4
-rw-r--r--rust/protobuf_test.go6
-rw-r--r--rust/testing.go2
3 files changed, 6 insertions, 6 deletions
diff --git a/rust/protobuf.go b/rust/protobuf.go
index 88e80fe35..e30f25d95 100644
--- a/rust/protobuf.go
+++ b/rust/protobuf.go
@@ -73,7 +73,7 @@ func (proto *protobufDecorator) GenerateSource(ctx ModuleContext, deps PathDeps)
outDir := android.PathForModuleOut(ctx)
protoFiles := android.PathsForModuleSrc(ctx, proto.Properties.Protos)
grpcFiles := android.PathsForModuleSrc(ctx, proto.Properties.Grpc_protos)
- protoPluginPath := ctx.Config().HostToolPath(ctx, "protoc-gen-rust")
+ protoPluginPath := ctx.Config().HostToolPath(ctx, "protoc-gen-rust-deprecated")
commonProtoFlags = append(commonProtoFlags, defaultProtobufFlags...)
commonProtoFlags = append(commonProtoFlags, proto.Properties.Proto_flags...)
@@ -206,7 +206,7 @@ func (proto *protobufDecorator) SourceProviderProps() []interface{} {
func (proto *protobufDecorator) SourceProviderDeps(ctx DepsContext, deps Deps) Deps {
deps = proto.BaseSourceProvider.SourceProviderDeps(ctx, deps)
- deps.Rustlibs = append(deps.Rustlibs, "libprotobuf")
+ deps.Rustlibs = append(deps.Rustlibs, "libprotobuf_deprecated")
deps.HeaderLibs = append(deps.SharedLibs, proto.Properties.Header_libs...)
if len(proto.Properties.Grpc_protos) > 0 {
diff --git a/rust/protobuf_test.go b/rust/protobuf_test.go
index f0f5ec0e9..0aa454975 100644
--- a/rust/protobuf_test.go
+++ b/rust/protobuf_test.go
@@ -42,14 +42,14 @@ func TestRustProtobuf(t *testing.T) {
`)
// Check that libprotobuf is added as a dependency.
librust_proto := ctx.ModuleForTests("librust_proto", "android_arm64_armv8-a_dylib").Module().(*Module)
- if !android.InList("libprotobuf", librust_proto.Properties.AndroidMkDylibs) {
- t.Errorf("libprotobuf dependency missing for rust_protobuf (dependency missing from AndroidMkDylibs)")
+ if !android.InList("libprotobuf_deprecated", librust_proto.Properties.AndroidMkDylibs) {
+ t.Errorf("libprotobuf_deprecated dependency missing for rust_protobuf (dependency missing from AndroidMkDylibs)")
}
// Make sure the correct plugin is being used.
librust_proto_out := ctx.ModuleForTests("librust_proto", "android_arm64_armv8-a_source").Output("buf.rs")
cmd := librust_proto_out.RuleParams.Command
- if w := "protoc-gen-rust"; !strings.Contains(cmd, w) {
+ if w := "protoc-gen-rust-deprecated"; !strings.Contains(cmd, w) {
t.Errorf("expected %q in %q", w, cmd)
}
diff --git a/rust/testing.go b/rust/testing.go
index 24ca3d627..a33d948db 100644
--- a/rust/testing.go
+++ b/rust/testing.go
@@ -127,7 +127,7 @@ func GatherRequiredDepsForTest() string {
min_sdk_version: "29",
}
rust_library {
- name: "libprotobuf",
+ name: "libprotobuf_deprecated",
crate_name: "protobuf",
srcs: ["foo.rs"],
host_supported: true,