aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorandroid-build-team Robot <android-build-team-robot@google.com>2021-05-07 00:34:13 +0000
committerandroid-build-team Robot <android-build-team-robot@google.com>2021-05-07 00:34:13 +0000
commit0d3c237a506723e749797f2de7192d122cce5c1a (patch)
tree9a0d8f711d29ef10cada1eca97bdda6252989cd9
parentdc070ba1c84b9d492bee298bd51a86096f18ee47 (diff)
parent79401926776fe75253e92c83c8ebc92a99e248d9 (diff)
downloaduntrusted-android-mainline-12.0.0_r4.tar.gz
Snap for 7343852 from 79401926776fe75253e92c83c8ebc92a99e248d9 to sc-mainline-releaseandroid-mainline-12.0.0_r4android-mainline-12.0.0_r36android12--mainline-release
Change-Id: I3002a8baaef910631b5c1026d320bd45ab63e613
-rw-r--r--Android.bp12
-rw-r--r--cargo2android.json11
-rw-r--r--patches/Android.bp.patch16
-rw-r--r--src/untrusted.rs3
4 files changed, 25 insertions, 17 deletions
diff --git a/Android.bp b/Android.bp
index 539722d..cab84c6 100644
--- a/Android.bp
+++ b/Android.bp
@@ -1,4 +1,5 @@
-// This file is generated by cargo2android.py --run --device --dependencies --tests --patch=patches/Android.bp.patch.
+// This file is generated by cargo2android.py --config cargo2android.json.
+// Do not modify this file as changes will be overridden on upgrade.
package {
default_applicable_licenses: ["external_rust_crates_untrusted_license"],
@@ -19,6 +20,7 @@ license {
rust_library {
name: "libuntrusted",
+ // has rustc warnings
host_supported: true,
crate_name: "untrusted",
srcs: ["src/untrusted.rs"],
@@ -33,6 +35,7 @@ rust_library {
rust_defaults {
name: "untrusted_defaults",
crate_name: "untrusted",
+ // has rustc warnings
srcs: ["src/untrusted.rs"],
test_suites: ["general-tests"],
auto_gen_config: true,
@@ -42,6 +45,9 @@ rust_defaults {
rust_test_host {
name: "untrusted_host_test_src_untrusted",
defaults: ["untrusted_defaults"],
+ test_options: {
+ unit_test: true,
+ },
}
rust_test {
@@ -52,6 +58,7 @@ rust_test {
rust_defaults {
name: "untrusted_defaults_tests",
crate_name: "tests",
+ // has rustc warnings
srcs: ["tests/tests.rs"],
test_suites: ["general-tests"],
auto_gen_config: true,
@@ -64,6 +71,9 @@ rust_defaults {
rust_test_host {
name: "untrusted_host_test_tests_tests",
defaults: ["untrusted_defaults_tests"],
+ test_options: {
+ unit_test: true,
+ },
}
rust_test {
diff --git a/cargo2android.json b/cargo2android.json
new file mode 100644
index 0000000..911c36f
--- /dev/null
+++ b/cargo2android.json
@@ -0,0 +1,11 @@
+{
+ "apex-available": [
+ "//apex_available:platform",
+ "com.android.resolv"
+ ],
+ "dependencies": true,
+ "device": true,
+ "min-sdk-version": "29",
+ "run": true,
+ "tests": true
+} \ No newline at end of file
diff --git a/patches/Android.bp.patch b/patches/Android.bp.patch
deleted file mode 100644
index 90cc841..0000000
--- a/patches/Android.bp.patch
+++ /dev/null
@@ -1,16 +0,0 @@
-diff --git a/Android.bp b/Android.bp
-index 52ab13d..eaf9020 100644
---- a/Android.bp
-+++ b/Android.bp
-@@ -6,6 +6,11 @@ rust_library {
- crate_name: "untrusted",
- srcs: ["src/untrusted.rs"],
- edition: "2018",
-+ apex_available: [
-+ "//apex_available:platform",
-+ "com.android.resolv",
-+ ],
-+ min_sdk_version: "29",
- }
-
- rust_defaults {
diff --git a/src/untrusted.rs b/src/untrusted.rs
index b9f1439..a9d7f7b 100644
--- a/src/untrusted.rs
+++ b/src/untrusted.rs
@@ -100,6 +100,9 @@
variant_size_differences,
warnings
)]
+// ANDROID: This lint is included in warnings and thus forbidden, but this version of the library
+// is not compatible with it.
+#![allow(non_autolinks)]
#![no_std]
// ANDROID: Unconditionally use std to allow building as a dylib.