From e0cc5d5a1de2038e55acc4bff322a0018f66ed63 Mon Sep 17 00:00:00 2001 From: Victor Hsieh Date: Fri, 8 Jan 2021 11:35:40 -0800 Subject: Fix build on aosp-master/mainline_modules Apply the same default as crosvm to avoid inconsistency. Previous error: error: external/libchromeos-rs/Android.bp:35:1: module "liblibchromeos" variant "linux_bionic_x86_64_rlib_rlib-std": depends on disabled module "libdata_model" Bug: 174797066 Test: build/soong/scripts/build-mainline-modules.sh Change-Id: I60725421b9fc40d7f30bf78eba876bb2b1adb832 --- Android.bp | 40 ++++++++++++++-------------------------- patches/Android.bp.patch | 31 ------------------------------- 2 files changed, 14 insertions(+), 57 deletions(-) delete mode 100644 patches/Android.bp.patch diff --git a/Android.bp b/Android.bp index 63b9fdd..bfdcb10 100644 --- a/Android.bp +++ b/Android.bp @@ -1,7 +1,8 @@ -// This file is generated by cargo2android.py --run --device --tests --dependencies --patch=patches/Android.bp.patch. +// This file is generated by cargo2android.py --run --device --tests --dependencies --global_defaults=crosvm_defaults. rust_defaults { name: "libchromeos-rs_defaults", + defaults: ["crosvm_defaults"], crate_name: "libchromeos", srcs: ["src/lib.rs"], test_suites: ["general-tests"], @@ -27,13 +28,11 @@ rust_test_host { rust_test { name: "libchromeos-rs_device_test_src_lib", defaults: ["libchromeos-rs_defaults"], - // Manually limit to 64-bit to avoid depending on non-existing 32-bit build - // of libdata_model currently. - compile_multilib: "64", } rust_library { name: "liblibchromeos", + defaults: ["crosvm_defaults"], host_supported: true, crate_name: "libchromeos", srcs: ["src/lib.rs"], @@ -46,16 +45,6 @@ rust_library { "liblog_rust", "libprotobuf", ], - apex_available: [ - "//apex_available:platform", - "com.android.virt", - ], - // This library depends on libdata_model that is is part of crosvm project. - // Projects within crosvm on Android have only 64-bit target build enabled. - // As a result, we need to manually limit this build to 64-bit only, too. - // This is fine because this library is only used by crosvm now (thus 64-bit - // only). - compile_multilib: "64", } // dependent_library ["feature_list"] @@ -63,15 +52,15 @@ rust_library { // ../crosvm/data_model/src/lib.rs // autocfg-1.0.1 // cfg-if-0.1.10 -// futures-0.3.8 "alloc,async-await,default,executor,futures-executor,std" -// futures-channel-0.3.8 "alloc,futures-sink,sink,std" -// futures-core-0.3.8 "alloc,std" -// futures-executor-0.3.8 "default,num_cpus,std,thread-pool" -// futures-io-0.3.8 "std" -// futures-macro-0.3.8 -// futures-sink-0.3.8 "alloc,std" -// futures-task-0.3.8 "alloc,once_cell,std" -// futures-util-0.3.8 "alloc,async-await,async-await-macro,channel,default,futures-channel,futures-io,futures-macro,futures-sink,io,memchr,proc-macro-hack,proc-macro-nested,sink,slab,std" +// futures-0.3.9 "alloc,async-await,default,executor,futures-executor,std" +// futures-channel-0.3.9 "alloc,futures-sink,sink,std" +// futures-core-0.3.9 "alloc,std" +// futures-executor-0.3.9 "default,num_cpus,std,thread-pool" +// futures-io-0.3.9 "std" +// futures-macro-0.3.9 +// futures-sink-0.3.9 "alloc,std" +// futures-task-0.3.9 "alloc,once_cell,std" +// futures-util-0.3.9 "alloc,async-await,async-await-macro,channel,default,futures-channel,futures-io,futures-macro,futures-sink,io,memchr,proc-macro-hack,proc-macro-nested,sink,slab,std" // intrusive-collections-0.9.0 "alloc,default" // libc-0.2.82 "default,std" // log-0.4.11 @@ -79,8 +68,7 @@ rust_library { // memoffset-0.5.6 "default" // num_cpus-1.13.0 // once_cell-1.5.2 "alloc,std" -// pin-project-1.0.3 -// pin-project-internal-1.0.3 +// pin-project-lite-0.2.1 // pin-utils-0.1.0 // proc-macro-hack-0.5.19 // proc-macro-nested-0.1.6 @@ -88,5 +76,5 @@ rust_library { // protobuf-2.20.0 // quote-1.0.8 "default,proc-macro" // slab-0.4.2 -// syn-1.0.58 "clone-impls,default,derive,full,parsing,printing,proc-macro,quote,visit-mut" +// syn-1.0.58 "clone-impls,default,derive,full,parsing,printing,proc-macro,quote" // unicode-xid-0.2.1 "default" diff --git a/patches/Android.bp.patch b/patches/Android.bp.patch deleted file mode 100644 index 32234ed..0000000 --- a/patches/Android.bp.patch +++ /dev/null @@ -1,31 +0,0 @@ -diff --git a/Android.bp b/Android.bp -index fc2c8b8..c4e3c5b 100644 ---- a/Android.bp -+++ b/Android.bp -@@ -27,6 +27,9 @@ rust_test_host { - rust_test { - name: "libchromeos-rs_device_test_src_lib", - defaults: ["libchromeos-rs_defaults"], -+ // Manually limit to 64-bit to avoid depending on non-existing 32-bit build -+ // of libdata_model currently. -+ compile_multilib: "64", - } - - rust_library { -@@ -43,6 +46,16 @@ rust_library { - "liblog_rust", - "libprotobuf", - ], -+ apex_available: [ -+ "//apex_available:platform", -+ "com.android.virt", -+ ], -+ // This library depends on libdata_model that is is part of crosvm project. -+ // Projects within crosvm on Android have only 64-bit target build enabled. -+ // As a result, we need to manually limit this build to 64-bit only, too. -+ // This is fine because this library is only used by crosvm now (thus 64-bit -+ // only). -+ compile_multilib: "64", - } - - // dependent_library ["feature_list"] -- cgit v1.2.3