Hi all,
I remember having seen something similar (listing different ways to build a crate) but I don't remember where and if it was "official" (or at least largely adopted by the community).
Essentially I'm looking for something where I can describe the different ways a crate could be used. I would use this from my CI to test all those configurations. I would also use it to generate the initializationOptions of rust-analyzer. It could look something like this (hypothetical TOML file):
[[check]]
# Use default features and host target.
[[check]]
default-features = false
[[check]]
default-features = false
features = ["alloc"]
[[check]]
features = ["log"]
[[check]]
target = "riscv32imc-unknown-none-elf"
default-features = false
features = ["defmt"]
[[test]]
# Use default features.
From this, my CI could run something like this:
cargo check
cargo check --no-default-features
cargo check --no-default-features --features=alloc
cargo check --features=log
cargo check --target=riscv32imc-unknown-none-elf --no-default-features --features=defmt
cargo test
cargo fmt -- --check
cargo clippy -- --deny=warnings
cargo clippy --no-default-features -- --deny=warnings
cargo clippy --no-default-features --features=alloc -- --deny=warnings
cargo clippy --features=log -- --deny=warnings
cargo clippy --target=riscv32imc-unknown-none-elf --no-default-features --features=defmt -- --deny=warnings
Notice how cargo fmt -- --check
is always added and cargo clippy
is always matching the cargo check
.