Development
Setting Up Your Environment
In order to work on and build iamb locally, you will need:
stable
Rust toolchain withclippy
installednightly
Rust toolchain withrustfmt
installed
You can install the necessary Rust dependencies using rustup:
rustup toolchain install stable --component clippy
rustup toolchain install nightly --component rustfmt
You will also likely want to use rust-analyzer during your development. Refer to its documentation for help on setting it up in your preferred editor.
Programming in Rust
If you are new to Rust, some helpful resources to learn or refer to are:
- The Rust Book (or an alternative version with quizzes and visualizations)
- The Rust Standard Library documentation
- Asynchronous Programming in Rust
- Rust Playground is helpful for trying small examples and learning how things work
You can find more resources on the Rust website.
At some point while working on iamb, you will have to touch one of its dependencies. Some of the libraries whose docs you may need are:
- matrix-sdk
- modalkit
- modalkit-ratatui
- ratatui (see also the ratatui book, which includes small demos and How-Tos)
- tokio (see also the tokio tutorial)
Finding an Issue
You may already have an idea of a feature you want to add or a bug that’s affecting you, but if you’re looking for something to get started learning how to contribute to iamb, you can search for a GitHub issue that interests you, and comment on it when you start working on it!
A couple useful ways to search through the open issues are:
- The
good first issue
label - The Future Release milestone for things that would be useful in iamb, but is currently unplanned/not started.
Building, Formatting and Testing
The commands you will want to run the most are:
cargo check
to run the type checker and borrow checkercargo build
to build a debug binary (outputs totarget/debug/iamb
)cargo test
to run the unit testscargo clippy
to run lints and get suggestions for simplifying codecargo +nightly fmt
to apply the crate’s standard formatting to your changes
Once you have something you’re happy with, you can run cargo build --release
to get a release binary. If you have a machine with plenty of RAM, you can use
cargo build --profile release-lto
to build a smaller, optimized binary using
Link-Time Optimization.
Making a Pull Request
If you are unfamiliar with Git or GitHub, refer to the Git Book or Creating a pull request to get started.
If you want feedback while you’re still working on something, then please open a Draft Pull Request, so that someone can take a look.
Getting Help
There are several different places you can reach out for help:
- #iamb-dev:0x.badd.cafe to discuss in a Matrix room
- File a GitHub issue to discuss your change (or comment on an existing one)
- Open a Draft Pull Request to show and discuss code