aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndroid Build Coastguard Worker <android-build-coastguard-worker@google.com>2024-02-02 23:53:12 +0000
committerAndroid Build Coastguard Worker <android-build-coastguard-worker@google.com>2024-02-02 23:53:12 +0000
commit9fb0c0c862733519ccc46d4f32dab99724ed0dcb (patch)
tree3de276b597a91a41f8159bf28d07deaa18fa6d3c
parenta83d5f3b356896f4f6a10074533fa1ac30e2dfe8 (diff)
parent03b74fdb2b6390a89a5571a39c01640fab37f4ec (diff)
downloadgrpcio-simpleperf-release.tar.gz
Snap for 11400057 from 03b74fdb2b6390a89a5571a39c01640fab37f4ec to simpleperf-releasesimpleperf-release
Change-Id: Id9ed242e7e8cac42bd0e484ab9d57356980d348c
-rw-r--r--Android.bp18
-rw-r--r--cargo2android.json14
-rw-r--r--cargo2android_cfgs.bp5
-rw-r--r--cargo_embargo.json17
-rw-r--r--patches/lib.rs17
-rw-r--r--src/lib.rs6
6 files changed, 56 insertions, 21 deletions
diff --git a/Android.bp b/Android.bp
index 2fb65f0..0a99629 100644
--- a/Android.bp
+++ b/Android.bp
@@ -1,4 +1,4 @@
-// This file is generated by cargo2android.py --config cargo2android.json.
+// This file is generated by cargo_embargo.
// Do not modify this file as changes will be overridden on upgrade.
package {
@@ -29,8 +29,8 @@ rust_library {
features: [
"_secure",
"boringssl",
- "protobuf",
- "protobuf-codec",
+ "protobufv3",
+ "protobufv3-codec",
],
rustlibs: [
"libfutures_executor",
@@ -39,11 +39,15 @@ rust_library {
"liblibc",
"liblog_rust",
"libparking_lot",
- "libprotobuf_deprecated",
- ],
- apex_available: [
- "//apex_available:platform",
+ "libprotobuf",
],
+ 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.json b/cargo2android.json
deleted file mode 100644
index bc4594d..0000000
--- a/cargo2android.json
+++ /dev/null
@@ -1,14 +0,0 @@
-{
- "apex-available": [
- "//apex_available:platform"
- ],
- "device": true,
- "features": "_secure,boringssl,protobuf-codec,protobuf",
- "min-sdk-version": "29",
- "run": true,
- "vendor-available": true,
- "product-available": false,
- "dep-suffixes": {
- "protobuf": "_deprecated"
- }
-}
diff --git a/cargo2android_cfgs.bp b/cargo2android_cfgs.bp
new file mode 100644
index 0000000..328d17d
--- /dev/null
+++ b/cargo2android_cfgs.bp
@@ -0,0 +1,5 @@
+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
new file mode 100644
index 0000000..5d8821e
--- /dev/null
+++ b/cargo_embargo.json
@@ -0,0 +1,17 @@
+{
+ "apex_available": [
+ "//apex_available:platform"
+ ],
+ "features": [
+ "_secure",
+ "boringssl",
+ "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
new file mode 100644
index 0000000..0a1d2e9
--- /dev/null
+++ b/patches/lib.rs
@@ -0,0 +1,17 @@
+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 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;