-
Compile the C SDK
-
Some libraries are required to build the app:
libc.a
to build the app for a RISC-V targetlibcrypto.a
to run tests on a Linux target
These libraries can be retrieved from Docker images thanks to the script:
./lib/create-lib.sh
They are also generated as artifacts by the GitHub CI.
-
Build the Rust Docker image
docker build -t rust -f rust.Dockerfile . docker run --rm -ti -v $(pwd):/usr/src/vanadium -w /usr/src/vanadium/app/rust rust:latest
cargo build --release
cargo build --release --target aarch64-unknown-linux-gnu
cargo build --release --target x86_64-unknown-linux-gnu
Tests are ran on native thanks to libspeculos.so
.
--test-threads=1
is required because libspeculos.so
isn't thread safe.
docker run --rm -ti -v $(pwd):/usr/src/vanadium -w /usr/src/vanadium rust:latest
cd app/rust
cargo test --target aarch64-unknown-linux-gnu -- --test-threads=1
docker run --rm -ti -v $(pwd):/usr/src/vanadium -w /usr/src/vanadium rust:latest
cd app/rust
cargo test --target x86_64-unknown-linux-gnu -- --test-threads=1
- Find which functions take the most of space with
cargo install bloat && cargo bloat --release -n 10