• Home
  • History
  • Annotate
Name Date Size #Lines LOC

..--

.cargo/25-Apr-2025-1714

connections/ukey2/25-Apr-2025-12,6229,484

crypto/25-Apr-2025-16,18211,935

presence/25-Apr-2025-96,81372,505

src/25-Apr-2025-778523

.gitignoreD25-Apr-202575 76

Android.bpD25-Apr-20256.9 KiB298277

Cargo.lockD25-Apr-202562.4 KiB2,6732,387

Cargo.tomlD25-Apr-20256.7 KiB216202

README.androidD25-Apr-20251.1 KiB2216

README.mdD25-Apr-20252.6 KiB11979

deny.tomlD25-Apr-20258.2 KiB186173

rustfmt.tomlD25-Apr-202568 33

README.android

1# Import process
2
31. `git pull` to pull a new version from sso://team/beto-rust-devs/beto-rust
4
5## If the dependency tree did not change significantly
6
72. It will be easier to manually update the Android.bp file to include the new dependencies.
8   For each new library that is needed, add it to the `rustlibs` section of the build rule. The
9   build rule is typically `lib<crate_name>`, but sometimes variants with different features exist,
10   in which case you will have to look up the target name in the relevent `Android.bp` file in code
11   search.
12
13## If the dependency tree changed significantly
14
152. Locally check out the `beto-core-staging` project, and run `scripts/prepare-boringssl.sh`.
164. Modify `.cargo/config.toml` to point to the external `rust-openssl` and `bssl-sys` crates.
175. Run `cargo2android.py --config cargo2android.json`
186. There are probably going to be merge conflicts. Fix them manually. Remove the
19   "Do not modify this file" comment added by cargo2android.json
207. Also modify `patches/Android.bp.patch` to include your manual changes.
218. Remove `cargo.out` and `target.tmp`, as those should not be checked in
22

README.md

1# Nearby Rust
2
3## Folder Structure
4
5Root repo of the nearby Rust components, folder structure:
6
7`/connections` nearby connections rust components
8
9`/crypto` shared crypto components
10
11`/presence` nearby presence rust components
12
13## Setup
14
15### Toolchain
16
17If you don't already have a Rust toolchain, see [rustup.rs](https://rustup.rs/).
18
19### Cargo
20
21Install [`cargo-deny`](https://github.com/EmbarkStudios/cargo-deny)
22and [`cargo-fuzz`](https://github.com/rust-fuzz/cargo-fuzz):
23
24```
25cargo install --locked cargo-deny
26cargo install cargo-fuzz
27```
28
29### Setting up a Docker dev environment
30
31Our project requires specific versions of system dependencies like OpenSSL and
32protobuf in order to build correctly. To make the setup of this easier you can
33use Docker to handle setting up the environment in a container.
34
35First install Docker then build and run the image from repo root:
36
37```
38sudo docker build -t nearby_rust:v1.0 .
39sudo docker run --rm -it nearby_rust:v1.0
40```
41
42Building the image creates a snapshot of the environment that has all of the
43system dependencies needed to start building and running all of the artifacts in
44the codebase.
45
46Running the image runs `cargo run -- check-everything` to verify all of the targets can
47successfully build and all of the tests pass in your new container environment.
48
49To open a bash shell from the container environment:
50
51```
52sudo docker run -it nearby_rust:v1.0 bash
53```
54
55You can also setup VSCode
56to [develop in a Docker container on a remote host](https://code.visualstudio.com/remote/advancedcontainers/develop-remote-host)
57that way you can make code changes and test them in the same environment without
58having to re-build the image.
59
60## Common tasks
61
62See `cargo run -- --help` for all the available subcommands.
63
64Check everything:
65
66```
67cargo run -- check-everything
68```
69
70Build everything:
71
72```
73cargo build --workspace --all-targets
74```
75
76Run tests:
77
78```
79cargo test --workspace
80```
81
82Generate Docs:
83
84```
85cargo doc --no-deps --workspace --open
86```
87
88Run linter on dependencies as configured in `deny.toml` <br>
89This will make sure all of our dependencies are using valid licenses and check
90for known existing security
91vulnerabilities, bugs and deprecated versions
92
93```
94cargo deny --workspace check
95```
96
97Update dependencies in `Cargo.lock` to their latest in the currently specified
98version ranges (i.e. transitive deps):
99
100```
101cargo update
102```
103
104Check for outdated dependencies
105with [cargo-outdated](https://github.com/kbknapp/cargo-outdated):
106
107```
108cargo outdated
109```
110
111## Benchmarks
112
113Benchmarks are in `benches`, and use
114[Criterion](https://bheisler.github.io/criterion.rs/book/getting_started.html) .
115
116```
117cargo bench --workspace
118```
119