1// This file is generated by cargo_embargo. 2// Do not modify this file as changes will be overridden on upgrade. 3 4package { 5 // See: http://go/android-license-faq 6 // A large-scale-change added 'default_applicable_licenses' to import 7 // all of the 'license_kinds' from "external_crosvm_license" 8 // to get the below license kinds: 9 // SPDX-license-identifier-BSD 10 default_applicable_licenses: ["external_crosvm_license"], 11} 12 13rust_test { 14 name: "base_test_src_lib", 15 defaults: ["crosvm_inner_defaults"], 16 host_supported: false, // Can't seem to access syslog in TH host tests. 17 crate_name: "base", 18 cargo_env_compat: true, 19 cargo_pkg_version: "0.1.0", 20 srcs: ["src/lib.rs"], 21 test_suites: ["general-tests"], 22 auto_gen_config: true, 23 test_options: { 24 unit_test: true, 25 }, 26 edition: "2021", 27 rustlibs: [ 28 "libaudio_streams", 29 "libcfg_if", 30 "libchrono", 31 "libdata_model", 32 "libenv_logger", 33 "liblibc", 34 "liblog_rust", 35 "libminijail_rust", 36 "libonce_cell", 37 "libserde", 38 "libserde_json", 39 "libsmallvec", 40 "libsync_rust", 41 "libtempfile", 42 "libthiserror", 43 "libuuid", 44 "libzerocopy", 45 ], 46 proc_macros: [ 47 "libbase_event_token_derive", 48 "libremain", 49 ], 50 target: { 51 android: { 52 rustlibs: ["libandroid_log_sys"], 53 }, 54 linux_bionic_arm64: { 55 // For ARM architecture, we use aarch64-linux-android for BOTH 56 // device and host targets. As a result, host targets are also 57 // built with target_os = "android". Therefore, sys_util/src/android 58 // is used and thus this android module is required. 59 // This seems incorrect, but is inevitable because rustc doesn't 60 // yet support a Linux-based target using Bionic as libc. We can't 61 // use aarch64-unknown-linux-gnu because it's using glibc which 62 // we don't support for cross-host builds. 63 rustlibs: [ 64 "libandroid_log_sys", 65 ], 66 }, 67 }, 68 shared_libs: ["libcap"], // specified in src/unix/capabilities.rs 69} 70 71rust_test { 72 name: "base_test_tests_tube", 73 defaults: ["crosvm_inner_defaults"], 74 host_supported: true, 75 crate_name: "tube", 76 cargo_env_compat: true, 77 cargo_pkg_version: "0.1.0", 78 srcs: ["tests/tube.rs"], 79 test_suites: ["general-tests"], 80 auto_gen_config: true, 81 test_options: { 82 unit_test: true, 83 }, 84 edition: "2021", 85 rustlibs: [ 86 "libaudio_streams", 87 "libbase_rust", 88 "libcfg_if", 89 "libchrono", 90 "libdata_model", 91 "libenv_logger", 92 "liblibc", 93 "liblog_rust", 94 "libminijail_rust", 95 "libonce_cell", 96 "libserde", 97 "libserde_json", 98 "libsmallvec", 99 "libsync_rust", 100 "libtempfile", 101 "libthiserror", 102 "libuuid", 103 "libzerocopy", 104 ], 105 proc_macros: [ 106 "libbase_event_token_derive", 107 "libremain", 108 ], 109} 110 111rust_test { 112 name: "base_test_tests_unix_main", 113 defaults: ["crosvm_inner_defaults"], 114 host_supported: false, // Can't seem to access syslog in TH host tests. 115 crate_name: "unix", 116 cargo_env_compat: true, 117 cargo_pkg_version: "0.1.0", 118 srcs: ["tests/unix/main.rs"], 119 test_suites: ["general-tests"], 120 auto_gen_config: true, 121 test_options: { 122 unit_test: true, 123 }, 124 edition: "2021", 125 rustlibs: [ 126 "libaudio_streams", 127 "libbase_rust", 128 "libcfg_if", 129 "libchrono", 130 "libdata_model", 131 "libenv_logger", 132 "liblibc", 133 "liblog_rust", 134 "libminijail_rust", 135 "libonce_cell", 136 "libserde", 137 "libserde_json", 138 "libsmallvec", 139 "libsync_rust", 140 "libtempfile", 141 "libthiserror", 142 "libuuid", 143 "libzerocopy", 144 ], 145 proc_macros: [ 146 "libbase_event_token_derive", 147 "libremain", 148 ], 149 target: { 150 android: { 151 rustlibs: ["libandroid_log_sys"], 152 }, 153 linux_bionic_arm64: { 154 // For ARM architecture, we use aarch64-linux-android for BOTH 155 // device and host targets. As a result, host targets are also 156 // built with target_os = "android". Therefore, sys_util/src/android 157 // is used and thus this android module is required. 158 // This seems incorrect, but is inevitable because rustc doesn't 159 // yet support a Linux-based target using Bionic as libc. We can't 160 // use aarch64-unknown-linux-gnu because it's using glibc which 161 // we don't support for cross-host builds. 162 rustlibs: [ 163 "libandroid_log_sys", 164 ], 165 }, 166 }, 167 shared_libs: ["libcap"], // specified in src/unix/capabilities.rs 168} 169 170rust_library { 171 name: "libbase_rust", 172 defaults: ["crosvm_inner_defaults"], 173 stem: "libbase", 174 host_supported: true, 175 crate_name: "base", 176 cargo_env_compat: true, 177 cargo_pkg_version: "0.1.0", 178 srcs: ["src/lib.rs"], 179 edition: "2021", 180 rustlibs: [ 181 "libaudio_streams", 182 "libcfg_if", 183 "libchrono", 184 "libdata_model", 185 "libenv_logger", 186 "liblibc", 187 "liblog_rust", 188 "libminijail_rust", 189 "libonce_cell", 190 "libserde", 191 "libserde_json", 192 "libsmallvec", 193 "libsync_rust", 194 "libtempfile", 195 "libthiserror", 196 "libuuid", 197 "libzerocopy", 198 ], 199 proc_macros: [ 200 "libbase_event_token_derive", 201 "libremain", 202 ], 203 target: { 204 android: { 205 rustlibs: ["libandroid_log_sys"], 206 }, 207 linux_bionic_arm64: { 208 // For ARM architecture, we use aarch64-linux-android for BOTH 209 // device and host targets. As a result, host targets are also 210 // built with target_os = "android". Therefore, sys_util/src/android 211 // is used and thus this android module is required. 212 // This seems incorrect, but is inevitable because rustc doesn't 213 // yet support a Linux-based target using Bionic as libc. We can't 214 // use aarch64-unknown-linux-gnu because it's using glibc which 215 // we don't support for cross-host builds. 216 rustlibs: [ 217 "libandroid_log_sys", 218 ], 219 }, 220 }, 221 shared_libs: ["libcap"], // specified in src/unix/capabilities.rs 222 visibility: [ 223 "//packages/modules/Virtualization/virtualizationmanager", 224 "//vendor:__subpackages__", 225 ], 226} 227