aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Walbran <qwandor@google.com>2023-05-12 16:32:33 +0000
committerAndrew Walbran <qwandor@google.com>2023-05-12 16:32:33 +0000
commit19e116cf1e1adee50e5f8bb09b0699f65b75814e (patch)
treeee8588478eee7fc14e8d8b87c3c28b0df8dce1f0
parent99bf616a5f6f4ccd463fa737fb82b1187cc100f7 (diff)
downloadonce_cell-19e116cf1e1adee50e5f8bb09b0699f65b75814e.tar.gz
Use new no-std flag to cargo2android.
Bug: 279614907 Test: m pvmfw Change-Id: I2f6d79cf2ecc5057aa05e4394d307a5565bc1c33
-rw-r--r--Android.bp13
-rw-r--r--cargo2android.json19
-rw-r--r--patches/Android.bp.patch47
3 files changed, 26 insertions, 53 deletions
diff --git a/Android.bp b/Android.bp
index e9b9198..b8d60b6 100644
--- a/Android.bp
+++ b/Android.bp
@@ -64,18 +64,25 @@ rust_library_rlib {
name: "libonce_cell_nostd",
crate_name: "once_cell",
cargo_env_compat: true,
- cargo_pkg_version: "1.16.0",
+ cargo_pkg_version: "1.17.1",
srcs: ["src/lib.rs"],
edition: "2021",
features: [
"alloc",
- "default",
"race",
],
apex_available: [
"//apex_available:platform",
- "//apex_available:anyapex"
+ "//apex_available:anyapex",
],
+ prefer_rlib: true,
+ no_stdlibs: true,
+ stdlibs: [
+ "liballoc.rust_sysroot",
+ "libcompiler_builtins.rust_sysroot",
+ "libcore.rust_sysroot",
+ ],
+ product_available: true,
vendor_available: true,
min_sdk_version: "29",
}
diff --git a/cargo2android.json b/cargo2android.json
index 674f610..dcdc20f 100644
--- a/cargo2android.json
+++ b/cargo2android.json
@@ -1,9 +1,22 @@
{
"dependencies": true,
+ "dependency-blocklist": [
+ "critical_section"
+ ],
"device": true,
"min-sdk-version": "29",
- "patch": "patches/Android.bp.patch",
"run": true,
- "tests": true,
- "vendor-available": true
+ "variants": [
+ {
+ "tests": true
+ },
+ {
+ "alloc": true,
+ "features": "alloc,race",
+ "force-rlib": true,
+ "no-host": true,
+ "suffix": "_nostd",
+ "no-std": true
+ }
+ ]
}
diff --git a/patches/Android.bp.patch b/patches/Android.bp.patch
deleted file mode 100644
index 6dee374..0000000
--- a/patches/Android.bp.patch
+++ /dev/null
@@ -1,47 +0,0 @@
-diff --git a/Android.bp b/Android.bp
-index d6878ec..59ae682 100644
---- a/Android.bp
-+++ b/Android.bp
-@@ -59,6 +59,26 @@ rust_library {
- min_sdk_version: "29",
- }
-
-+rust_library_rlib {
-+ name: "libonce_cell_nostd",
-+ crate_name: "once_cell",
-+ cargo_env_compat: true,
-+ cargo_pkg_version: "1.16.0",
-+ srcs: ["src/lib.rs"],
-+ edition: "2021",
-+ features: [
-+ "alloc",
-+ "default",
-+ "race",
-+ ],
-+ apex_available: [
-+ "//apex_available:platform",
-+ "//apex_available:anyapex"
-+ ],
-+ vendor_available: true,
-+ min_sdk_version: "29",
-+}
-+
- rust_test {
- name: "once_cell_test_src_lib",
- host_supported: true,
-@@ -79,7 +99,6 @@ rust_test {
- "std",
- ],
- rustlibs: [
-- "libcritical_section",
- "libcrossbeam_utils",
- "liblazy_static",
- "libregex",
-@@ -106,7 +125,6 @@ rust_test {
- "std",
- ],
- rustlibs: [
-- "libcritical_section",
- "libcrossbeam_utils",
- "liblazy_static",
- "libonce_cell",