From 58d5197ca7782da91daae36d6c2c943405c58288 Mon Sep 17 00:00:00 2001 From: Andrew Walbran Date: Tue, 19 Mar 2024 16:31:52 +0000 Subject: 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 --- Android.bp | 10 +++------- cargo2android_cfgs.bp | 5 ----- cargo_embargo.json | 5 ----- patches/lib.rs | 17 ----------------- src/lib.rs | 6 ------ 5 files changed, 3 insertions(+), 40 deletions(-) delete mode 100644 cargo2android_cfgs.bp delete mode 100644 patches/lib.rs diff --git a/Android.bp b/Android.bp index 0a99629..e054608 100644 --- a/Android.bp +++ b/Android.bp @@ -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; diff --git a/src/lib.rs b/src/lib.rs index ba47f95..c8cebca 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -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; -- cgit v1.2.3