Skip to content

Commit

Permalink
docs: add local dev environment docs to contributing guide
Browse files Browse the repository at this point in the history
  • Loading branch information
Kodylow committed Nov 23, 2023
1 parent bfb5965 commit f12a256
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 6 deletions.
30 changes: 25 additions & 5 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,26 @@ the steps:
GitHub website and copying the URL. Then open a terminal on your local machine and type
`git clone [the URL you copied]`.

#### Step 5. Setting up your development environment

Burn is written in Rust, so you'll need to have the Rust toolchain installed on your local machine. We also have a nix flake that can deterministically build the development environment. To build and enter the development environment with Nix, run the following command:

```bash
curl --proto '=https' --tlsv1.2 -sSf -L https://install.determinate.systems/nix | sh -s -- install
```

Which will install Nix and add it to your shell's PATH. Then, simply run the following command to install the correct rust toolchain and other software Burn needs and enter the development environment:

```bash
nix develop
```

If you don't want to use Nix, you can install the Rust toolchain using [rustup](https://rustup.rs/), however rust can be a bit finicky depending on the operating system, so we recommend using Nix if you can. To install rustup, run the following command:

```bash
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
```

### Step 4: Create a New Branch

It's a good practice to create a new branch for each contribution you make. This keeps your changes
Expand Down Expand Up @@ -63,10 +83,10 @@ the issue or issues that your changes address.

1. Install the following extensions:

* [rust-lang.rust-analyzer](https://marketplace.visualstudio.com/items?itemName=rust-lang.rust-analyzer)
* [tamasfe.even-better-toml](https://marketplace.visualstudio.com/items?itemName=tamasfe.even-better-toml)
* [serayuzgur.crates](https://marketplace.visualstudio.com/items?itemName=serayuzgur.crates)
* [vadimcn.vscode-lldb](https://marketplace.visualstudio.com/items?itemName=vadimcn.vscode-lldb)
- [rust-lang.rust-analyzer](https://marketplace.visualstudio.com/items?itemName=rust-lang.rust-analyzer)
- [tamasfe.even-better-toml](https://marketplace.visualstudio.com/items?itemName=tamasfe.even-better-toml)
- [serayuzgur.crates](https://marketplace.visualstudio.com/items?itemName=serayuzgur.crates)
- [vadimcn.vscode-lldb](https://marketplace.visualstudio.com/items?itemName=vadimcn.vscode-lldb)

2. Open `Command Palette` with Ctrl+Shift+P or F1 and type `LLDB: Generate Launch Configurations from Cargo.toml` then select it, this will generate a file that should be saved as `.vscode/launch.json`.

Expand Down Expand Up @@ -121,7 +141,7 @@ where `crate_name` is the name of the crate to publish

## Others

To bump for the next version, use this command:
To bump for the next version, use this command:

```
cargo set-version --bump minor
Expand Down
10 changes: 9 additions & 1 deletion justfile
Original file line number Diff line number Diff line change
Expand Up @@ -116,4 +116,12 @@ typos *PARAMS:
typos-fix-all:
just typos -w

# THIS FILE IS AUTOGENERATED FROM FLAKEBOX CONFIGURATION
# ABOVE IS AUTOGENERATED FROM FLAKEBOX CONFIGURATION

run-checks ENVIRONMENT:
#!/usr/bin/env bash
set -euo pipefail
if [ ! -f Cargo.toml ]; then
cd {{invocation_directory()}}
fi
cargo xtask run-checks {{ENVIRONMENT}}

0 comments on commit f12a256

Please sign in to comment.