Skip to content

Commit

Permalink
docs(contributing): add dependencies overriding section
Browse files Browse the repository at this point in the history
  • Loading branch information
soywod committed Jan 11, 2025
1 parent c79cabc commit 9d773e9
Showing 1 changed file with 55 additions and 8 deletions.
63 changes: 55 additions & 8 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,66 @@ Thank you for investing your time in contributing to Himalaya CLI!

## Development

The development environment is managed by [Nix](https://nixos.org/download.html). Running `nix-shell` will spawn a shell with everything you need to get started with the lib: `cargo`, `cargo-watch`, `rust-bin`, `rust-analyzer`, `notmuch`
The development environment is managed by [Nix](https://nixos.org/download.html).
Running `nix-shell` will spawn a shell with everything you need to get started with the lib.

```sh
# Start a Nix shell
$ nix-shell
If you do not want to use Nix, you can either use [rustup](https://rust-lang.github.io/rustup/index.html):

# then build the CLI
$ cargo build
```text
rustup update
```

or install manually the following dependencies:

- [cargo](https://doc.rust-lang.org/cargo/) (`v1.82`)
- [rustc](https://doc.rust-lang.org/stable/rustc/platform-support.html) (`v1.82`)

## Build

```text
cargo build
```

You can disable default [features](https://doc.rust-lang.org/cargo/reference/features.html) with `--no-default-features` and enable features with `--features feat1,feat2,feat3`.

Finally, you can build a release with `--release`:

# run the CLI
$ cargo run --feature pgp-gpg -- envelope list
```text
cargo build --no-default-features --features imap,smtp,keyring --release
```

## Override dependencies

If you want to build Himalaya CLI with a dependency installed locally (for example `email-lib`), then you can [override it](https://doc.rust-lang.org/cargo/reference/overriding-dependencies.html) by adding the following lines at the end of `Cargo.toml`:

```toml
[patch.crates-io]
email-lib = { path = "/path/to/email-lib" }
```

If you get the following error:

```text
note: perhaps two different versions of crate email are being used?
```

then you may need to override more Pimalaya's sub-dependencies:

```toml
[patch.crates-io]
email-lib.path = "/path/to/core/email"
imap-client.path = "/path/to/imap-client"
keyring-lib.path = "/path/to/core/keyring"
mml-lib.path = "/path/to/core/mml"
oauth-lib.path = "/path/to/core/oauth"
pgp-lib.path = "/path/to/core/pgp"
pimalaya-tui.path = "/path/to/tui"
process-lib.path = "/path/to/core/process"
secret-lib.path = "/path/to/core/secret"
```

*See [pimalaya/core#32](https://github.com/pimalaya/core/issues/32) for more information.*

## Commit style

Starting from the `v1.0.0`, Himalaya CLI tries to adopt the [conventional commits specification](https://github.com/conventional-commits/conventionalcommits.org).

0 comments on commit 9d773e9

Please sign in to comment.