Thank you for your interest in contributing to iai-callgrind!
Feature requests and bug reports should be reported in the Issue Tracker. Please have a look at existing issues with the enhancement or bug labels.
All patches have to be sent on Github as pull requests. Before starting a pull request, it is best to open an issue first so no efforts are wasted.
If you are looking for a place to start contributing to iai-callgrind, take a look at the help wanted or good first issue issues.
The minimum supported version (MSRV) of iai-callgrind is Rust 1.66.0
and all
patches are expected to work with the minimum supported version.
All notable changes need to be added to the CHANGELOG.
Clone this repo
git clone https://github.com/iai-callgrind/iai-callgrind.git
cd iai-callgrind
Working on this project is a piece of cake with
just and if you have the just
shell
completions installed. Before running any install commands with just
, it is
recommended to first inspect it with --dry-run
. Install the basics needed to
start working on this project with:
just install-workspace
This command will install git hooks, the necessary components for the stable
,
nightly
toolchain and the current MSRV toolchain, run some checks for tools
which need to be installed, ...
To get an overview over all possible just
rules run just -l
or directly
inspect the Justfile
in the root of this project.
If your IDE can handle it, it's usually best to work with the MSRV locally
rustup override set 1.66.0
What is left is to setup your favorite editor to use nightly rustfmt and clippy
from the rust stable
toolchain in order to pass the formatting and linting
checks in the ci
.
iai-callgrind lacks tests and contributions expanding the test suite are also very welcome. Patches have to include tests to verify (at a minimum) that the whole pipeline runs through without errors.
The benches in the benchmark-tests
package run the whole pipeline which is
good for verifying that there are no panics or errors. If you've made changes in
the iai-callgrind-runner
package then you can point the IAI_CALLGRIND_RUNNER
environment variable to your modified version of the iai-callgrind-runner
binary:
cargo build -p iai-callgrind-runner --release
IAI_CALLGRIND_RUNNER=$(readlink -e target/release/iai-callgrind-runner) cargo bench -p benchmark-tests
or with just
in a single command:
just bench-test-all
or a specific bench of the benchmark-test package
just bench-test test_lib_bench_tools
The concrete results of the benchmarks are not checked when running the benchmark tests that way. You can use
just full-bench-test test_lib_bench_tools
which also checks that any output files that are expected to be created by the
benchmark run are actually there. Depending on the test configuration benchmarks
are sometimes run multiple times. Currently, we don't have any tests in place
which verify the benchmark terminal outputs. So, for concrete results it's
better to use unit tests or integration tests in the iai-callgrind-runner
package.
If there are any outstanding questions about contributing to iai-callgrind, they can be asked on the iai-callgrind issue tracker.