diff options
author | Andrew Walbran <qwandor@google.com> | 2024-03-19 16:31:52 +0000 |
---|---|---|
committer | Andrew Walbran <qwandor@google.com> | 2024-03-19 16:31:52 +0000 |
commit | 58d5197ca7782da91daae36d6c2c943405c58288 (patch) | |
tree | 07e417965430c949b82f3fdbfc899805953b77c1 | |
parent | 9287f1a3093dfe4064418ff669cf3faf676e6bde (diff) | |
download | grpcio-58d5197ca7782da91daae36d6c2c943405c58288.tar.gz |
Hack to rename protobuf dependency is no longer necessary.
cargo_embargo will now use the aliases property.
Bug: 308790322
Test: m libgrpcio
Change-Id: I0c82f330573238457039005ec4fa78c77926216c
-rw-r--r-- | Android.bp | 10 | ||||
-rw-r--r-- | cargo2android_cfgs.bp | 5 | ||||
-rw-r--r-- | cargo_embargo.json | 5 | ||||
-rw-r--r-- | patches/lib.rs | 17 | ||||
-rw-r--r-- | src/lib.rs | 6 |
5 files changed, 3 insertions, 40 deletions
@@ -1,5 +1,6 @@ // This file is generated by cargo_embargo. -// Do not modify this file as changes will be overridden on upgrade. +// Do not modify this file as most changes will be overridden on upgrade. +// Content before the first "rust_*" or "genrule" module is preserved. package { default_applicable_licenses: ["external_rust_crates_grpcio_license"], @@ -41,13 +42,8 @@ rust_library { "libparking_lot", "libprotobuf", ], + aliases: ["protobuf:protobufv3"], apex_available: ["//apex_available:platform"], vendor_available: true, min_sdk_version: "29", - cfgs: [ - // cfg(soong) is used to distinguish code that only builds on Android, so - // that (most of) the same code can be built under both Soong and cargo. - "soong", - ], - } diff --git a/cargo2android_cfgs.bp b/cargo2android_cfgs.bp deleted file mode 100644 index 328d17d..0000000 --- a/cargo2android_cfgs.bp +++ /dev/null @@ -1,5 +0,0 @@ -cfgs: [ - // cfg(soong) is used to distinguish code that only builds on Android, so - // that (most of) the same code can be built under both Soong and cargo. - "soong", -] diff --git a/cargo_embargo.json b/cargo_embargo.json index 5d8821e..dfb3166 100644 --- a/cargo_embargo.json +++ b/cargo_embargo.json @@ -8,10 +8,5 @@ "protobufv3-codec" ], "min_sdk_version": "29", - "package": { - "grpcio": { - "add_module_block": "cargo2android_cfgs.bp" - } - }, "product_available": false } diff --git a/patches/lib.rs b/patches/lib.rs deleted file mode 100644 index 0a1d2e9..0000000 --- a/patches/lib.rs +++ /dev/null @@ -1,17 +0,0 @@ -diff --git a/src/lib.rs b/src/lib.rs -index c8cebca..ba47f95 100644 ---- a/src/lib.rs -+++ b/src/lib.rs -@@ -29,6 +29,12 @@ use grpcio_sys as grpc_sys; - #[macro_use] - extern crate log; - -+// grpcio with feature protobufv3-codec expects a "protobufv3" dependency, -+// but Android.bp is not able to rename dependencies yet. See b/308790322. -+// It is enabled unconditionally since protobufv3-codec also is. -+#[cfg(soong)] -+extern crate protobuf as protobufv3; -+ - mod buf; - mod call; - mod channel; @@ -29,12 +29,6 @@ use grpcio_sys as grpc_sys; #[macro_use] extern crate log; -// grpcio with feature protobufv3-codec expects a "protobufv3" dependency, -// but Android.bp is not able to rename dependencies yet. See b/308790322. -// It is enabled unconditionally since protobufv3-codec also is. -#[cfg(soong)] -extern crate protobuf as protobufv3; - mod buf; mod call; mod channel; |