1
0
mirror of https://github.com/google/comprehensive-rust.git synced 2025-07-03 05:27:04 +02:00

More speaker notes about Android (#1501)

Helps with https://github.com/google/comprehensive-rust/issues/1083
This commit is contained in:
gurchetansingh
2023-11-28 11:19:04 -08:00
committed by GitHub
parent 6de9413ac3
commit d2aab63d15
3 changed files with 49 additions and 6 deletions

View File

@ -3,7 +3,7 @@
The Android build system (Soong) supports Rust via a number of modules:
| Module Type | Description |
|-------------------|----------------------------------------------------------------------------------------------------|
| ----------------- | -------------------------------------------------------------------------------------------------- |
| `rust_binary` | Produces a Rust binary. |
| `rust_library` | Produces a Rust library, and provides both `rlib` and `dylib` variants. |
| `rust_ffi` | Produces a Rust C library usable by `cc` modules, and provides both static and shared variants. |
@ -14,3 +14,21 @@ The Android build system (Soong) supports Rust via a number of modules:
| `rust_bindgen` | Generates source and produces a Rust library containing Rust bindings to C libraries. |
We will look at `rust_binary` and `rust_library` next.
<details>
Additional items speaker may mention:
- cargo is not optimized for multi-language repos, and also downloads packages from the internet.
- For compliance and performance, Android must have crates in-tree. It must also interop with C/C++/Java code. Soong fills that gap.
- Soong has many similarities to Bazel, which is the open-source variant of Blaze (used in google3).
- There is a plan to transition [Android](https://source.android.com/docs/setup/build/bazel/introduction), [ChromeOS](https://chromium.googlesource.com/chromiumos/bazel/), and [Fuchsia](https://source.android.com/docs/setup/build/bazel/introduction) to Bazel.
- Learning Bazel-like build rules is useful for all Rust OS developers.
- Fun fact: Data from Star Trek is a Soong-type Android.
</details>

View File

@ -1,7 +1,7 @@
# Setup
We will be using an Android Virtual Device to test our code. Make sure you have
access to one or create a new one with:
We will be using a Cuttlefish Android Virtual Device to test our code. Make sure you
have access to one or create a new one with:
```shell
source build/envsetup.sh
@ -11,3 +11,13 @@ acloud create
Please see the [Android Developer
Codelab](https://source.android.com/docs/setup/start) for details.
<details>
Key points:
- Cuttlefish is a reference Android device designed to work on generic Linux desktops. MacOS support is also planned.
- The Cuttlefish system image maintains high fidelity to real devices, and is the ideal emulator to run many Rust use cases.
</details>