• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1// This file is generated by cargo_embargo.
2// Do not modify this file after the first "rust_*" or "genrule" module
3// because the changes will be overridden on upgrade.
4// Content before the first "rust_*" or "genrule" module is preserved.
5
6package {
7    // See: http://go/android-license-faq
8    // A large-scale-change added 'default_applicable_licenses' to import
9    // all of the 'license_kinds' from "external_crosvm_license"
10    // to get the below license kinds:
11    //   SPDX-license-identifier-BSD
12    default_applicable_licenses: ["external_crosvm_license"],
13}
14
15rust_test {
16    name: "base_test_src_lib",
17    defaults: ["crosvm_inner_defaults"],
18    host_supported: false, // Can't seem to access syslog in TH host tests.
19    crate_name: "base",
20    cargo_env_compat: true,
21    cargo_pkg_version: "0.1.0",
22    srcs: ["src/lib.rs"],
23    test_suites: ["general-tests"],
24    auto_gen_config: true,
25    test_options: {
26        unit_test: true,
27    },
28    edition: "2021",
29    rustlibs: [
30        "libaudio_streams",
31        "libcfg_if",
32        "libchrono",
33        "libenv_logger",
34        "liblibc",
35        "liblog_rust",
36        "libminijail_rust",
37        "libonce_cell",
38        "libserde",
39        "libserde_json",
40        "libsmallvec",
41        "libsync_rust",
42        "libtempfile",
43        "libthiserror",
44        "libuuid",
45        "libzerocopy",
46    ],
47    proc_macros: [
48        "libbase_event_token_derive",
49        "libremain",
50    ],
51    target: {
52        android: {
53            rustlibs: ["libandroid_log_sys"],
54        },
55        linux_bionic_arm64: {
56            // For ARM architecture, we use aarch64-linux-android for BOTH
57            // device and host targets. As a result, host targets are also
58            // built with target_os = "android". Therefore, sys_util/src/android
59            // is used and thus this android module is required.
60            // This seems incorrect, but is inevitable because rustc doesn't
61            // yet support a Linux-based target using Bionic as libc. We can't
62            // use aarch64-unknown-linux-gnu because it's using glibc which
63            // we don't support for cross-host builds.
64            rustlibs: [
65                "libandroid_log_sys",
66            ],
67        },
68    },
69    shared_libs: ["libcap"], // specified in src/linux/capabilities.rs
70}
71
72rust_test {
73    name: "base_test_tests_linux_main",
74    defaults: ["crosvm_inner_defaults"],
75    host_supported: false, // Can't seem to access syslog in TH host tests.
76    crate_name: "linux",
77    cargo_env_compat: true,
78    cargo_pkg_version: "0.1.0",
79    srcs: ["tests/linux/main.rs"],
80    test_suites: ["general-tests"],
81    auto_gen_config: true,
82    test_options: {
83        unit_test: true,
84    },
85    edition: "2021",
86    rustlibs: [
87        "libaudio_streams",
88        "libbase_rust",
89        "libcfg_if",
90        "libchrono",
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_syslog",
113    defaults: ["crosvm_inner_defaults"],
114    host_supported: true,
115    crate_name: "syslog",
116    cargo_env_compat: true,
117    cargo_pkg_version: "0.1.0",
118    srcs: ["tests/syslog.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        "libenv_logger",
131        "liblibc",
132        "liblog_rust",
133        "libminijail_rust",
134        "libonce_cell",
135        "libserde",
136        "libserde_json",
137        "libsmallvec",
138        "libsync_rust",
139        "libtempfile",
140        "libthiserror",
141        "libuuid",
142        "libzerocopy",
143    ],
144    proc_macros: [
145        "libbase_event_token_derive",
146        "libremain",
147    ],
148}
149
150rust_test {
151    name: "base_test_tests_tube",
152    defaults: ["crosvm_inner_defaults"],
153    host_supported: true,
154    crate_name: "tube",
155    cargo_env_compat: true,
156    cargo_pkg_version: "0.1.0",
157    srcs: ["tests/tube.rs"],
158    test_suites: ["general-tests"],
159    auto_gen_config: true,
160    test_options: {
161        unit_test: true,
162    },
163    edition: "2021",
164    rustlibs: [
165        "libaudio_streams",
166        "libbase_rust",
167        "libcfg_if",
168        "libchrono",
169        "libenv_logger",
170        "liblibc",
171        "liblog_rust",
172        "libminijail_rust",
173        "libonce_cell",
174        "libserde",
175        "libserde_json",
176        "libsmallvec",
177        "libsync_rust",
178        "libtempfile",
179        "libthiserror",
180        "libuuid",
181        "libzerocopy",
182    ],
183    proc_macros: [
184        "libbase_event_token_derive",
185        "libremain",
186    ],
187    target: {
188        android: {
189            rustlibs: ["libandroid_log_sys"],
190        },
191        linux_bionic_arm64: {
192            // For ARM architecture, we use aarch64-linux-android for BOTH
193            // device and host targets. As a result, host targets are also
194            // built with target_os = "android". Therefore, sys_util/src/android
195            // is used and thus this android module is required.
196            // This seems incorrect, but is inevitable because rustc doesn't
197            // yet support a Linux-based target using Bionic as libc. We can't
198            // use aarch64-unknown-linux-gnu because it's using glibc which
199            // we don't support for cross-host builds.
200            rustlibs: [
201                "libandroid_log_sys",
202            ],
203        },
204    },
205    shared_libs: ["libcap"], // specified in src/linux/capabilities.rs
206}
207
208rust_library {
209    name: "libbase_rust",
210    defaults: ["crosvm_inner_defaults"],
211    host_supported: true,
212    crate_name: "base",
213    cargo_env_compat: true,
214    cargo_pkg_version: "0.1.0",
215    srcs: ["src/lib.rs"],
216    edition: "2021",
217    rustlibs: [
218        "libaudio_streams",
219        "libcfg_if",
220        "libchrono",
221        "libenv_logger",
222        "liblibc",
223        "liblog_rust",
224        "libminijail_rust",
225        "libonce_cell",
226        "libserde",
227        "libserde_json",
228        "libsmallvec",
229        "libsync_rust",
230        "libtempfile",
231        "libthiserror",
232        "libuuid",
233        "libzerocopy",
234    ],
235    proc_macros: [
236        "libbase_event_token_derive",
237        "libremain",
238    ],
239    target: {
240        android: {
241            rustlibs: ["libandroid_log_sys"],
242        },
243        linux_bionic_arm64: {
244            // For ARM architecture, we use aarch64-linux-android for BOTH
245            // device and host targets. As a result, host targets are also
246            // built with target_os = "android". Therefore, sys_util/src/android
247            // is used and thus this android module is required.
248            // This seems incorrect, but is inevitable because rustc doesn't
249            // yet support a Linux-based target using Bionic as libc. We can't
250            // use aarch64-unknown-linux-gnu because it's using glibc which
251            // we don't support for cross-host builds.
252            rustlibs: [
253                "libandroid_log_sys",
254            ],
255        },
256    },
257    shared_libs: ["libcap"], // specified in src/linux/capabilities.rs
258    visibility: [
259        "//packages/modules/Virtualization/virtualizationmanager",
260        "//vendor:__subpackages__",
261    ],
262}
263