Skip to content

Commit

Permalink
Fixup readme
Browse files Browse the repository at this point in the history
  • Loading branch information
daniel-noland committed Oct 23, 2024
1 parent 818f5ab commit 3a4608e
Showing 1 changed file with 30 additions and 15 deletions.
45 changes: 30 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,20 +6,26 @@

- Recent linux machine of some kind required for development

> [!NOTE]
> I might be able to make this work on Mac if folks are interested and can help test.
> [!NOTE]
> I might be able to make this work on Mac if folks are interested and can help test.
- Bash (you very likely have this)
- [Docker](https://www.docker.com/) (install through your package manager
- Cargo / Rust (install via [`rustup`](https://rustup.rs/))
- [just](https://github.com/casey/just) (install through your package manager or cargo)

> [!WARNING]
> System privileges required for testing!
> This project requires root privileges to run the tests.
> This is because the tests require access to raw network interfaces.
> You can either run in docker or with `sudo`.
> `sudo` happens by default when you run `cargo test`.
* :warning: You need a recent version of rust (1.82.0 or better) to build the project.

```bash
rustup update
```
* :warning: You need to install both the glibc and musl targets to use the default builds.

```bash
rustup target add x86_64-unknown-linux-gnu
rustup target add x86_64-unknown-linux-musl
```

- [just](https://github.com/casey/just) (install through your package manager or cargo)

## Step 0. Clone the repository

Expand Down Expand Up @@ -64,27 +70,36 @@ just fake-nix
At this point you should be able to run

```bash
cargo build
just cargo build
```

You should now have statically linked ELF executables in `target/x86_64-unknown-linux-gnu/debug/scratch` and `target/x86_64-unknown-linux-musl/debug/scratch`.

Additionally, you can run

## Step 4. Run the tests (debug mode)

To run the test suite under glibc

```bash
just cargo test --target x86_64-unknown-linux-gnu
```

To run the test suite under musl

```bash
just build
just cargo test --target x86_64-unknown-linux-musl
```

## Step 4. Run the tests
## Step 5. Run the tests (release mode)

To run the test suite under glibc

```bash
cargo test --target x86_64-unknown-linux-gnu
just cargo test --target x86_64-unknown-linux-gnu --profile=release
```

To run the test suite under musl

```bash
cargo test --target x86_64-unknown-linux-musl
just cargo test --target x86_64-unknown-linux-musl --profile=release
```

0 comments on commit 3a4608e

Please sign in to comment.