Development guide
Setup
-
Rust Toolchain: You need the
rusttoolchain corresponding torust-toochain.mdinstalled. Install Rust withrust-upand anycargoinvocations will then automatically respect the toolchain. -
Command runner
just. -
The Cargo plugin
cargo-watchfor continuous building. -
Container manager such as
podman,dockerfor some tooling (formatting etc.).
Development Shell with nix
If you have the package manager
nix installed you can
enter a development setup easily with
nix ./tools/nix#default
or just nix-develop or automatically when direnv is
installed and setup for your shell and
direnv allow was executed inside the repository.
Note: Make sure to enable flakes and nix-command in
your nix config
Formatting
To format the whole project run
just format
Note: If you use docker, use just container_mgr=docker format
Building
To build the tool with cargo run
just build
and for continuous building (needs):
just watch
Testing
To run the tests do
just test
Build the Package & Image
To build the package with Nix run:b
just nix-package
To build the image with Nix run:
just nix-image
Upload CI Images
CI is run with some container images which can be updated with:
just upload-ci-images [<version>] [<registry>]
where the <version> should be a semantic version. Note: By default it will
upload and overwrite the current version.
Prepare a Release
To prepare a release you can execute:
just release <sem-version>
It will:
-
Check that the version is semantic version and the version does not exists (local and remote) and it is newer then all remote version.
-
Update the
Cargo.tomland make a commit onmain. -
Push a prepare tag
prepare-v<version>which triggers therelease.yamlpipeline.
Note: If the release pipeline fails, you can just run this same command again.
Also rerun it when you made a mistake, it will cancel the current release (works
also when --amending on the current commit)
Benchmarking performances
A benchmarking script is provided in tools/bench/benchmark.sh, along with a
nix devshell. To run the benchmark in the isolated environment, run:
just nix-develop-bench bash ./tools/bench/benchmark.sh