• Stars
    star
    141
  • Rank 259,971 (Top 6 %)
  • Language
    Rust
  • License
    Apache License 2.0
  • Created over 4 years ago
  • Updated about 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

A Cargo subcommand to build and test all feature flag combinations.

cargo-all-features

Cargo subcommands that build and test all feature flag combinations for a crate.

Install

cargo install cargo-all-features

Usage

The following commands can be run within a Cargo package or at the root of a Cargo workspace.

Build crate with all feature flag combinations:

cargo build-all-features <CARGO BUILD FLAGS>

Check crate with all feature flag combinations:

cargo check-all-features <CARGO CHECK FLAGS>

Test crate with all feature flag combinations:

cargo test-all-features <CARGO TEST FLAGS>

Why?

If you have a crate that utilizes Rust feature flags, it’s common to set up a test matrix in your continuous integration tooling to individually test all feature flags. This setup can be difficult to maintain and easy to forget to update as feature flags come and go. It’s also not exhaustive, as it’s possible enabling combinations of feature flags could result in a compilation error that should be fixed. This utility was built to address these concerns.

Options

You can add the following options to your Cargo.toml file to configure the behavior of cargo-all-features under the heading [package.metadata.cargo-all-features]:

[package.metadata.cargo-all-features]

# Features "foo" and "bar" are incompatible, so skip permutations including them
skip_feature_sets = [
    ["foo", "bar"],
]

# If your crate has a large number of optional dependencies, skip them for speed
skip_optional_dependencies = true

# Add back certain optional dependencies that you want to include in the permutations
extra_features = [
    "log",
]

# Exclude certain features from the build matrix
denylist = ["foo", "bar"]

# Always include these features in combinations.
# These features should not be included in `skip_feature_sets` or `denylist`, they get
# added in later
always_include_features = ["baz"]

# The maximum number of features to try at once. Does not count features from `always_include_features`.
# This is useful for reducing the number of combinations run for a crate with a large amount of features,
# since in most cases a bug just needs a small set of 2-3 features to reproduce.
max_combination_size = 4

# Only include certain features in the build matrix
#(incompatible with `denylist`, `skip_optional_dependencies`, and `extra_features`)
allowlist = ["foo", "bar"]

The project also supports chunking: --n-chunks 3 --chunks 1 will split the crates being tested into three sets (alphabetically, currently), and run the requested command for the first set of crates only. This is useful for splitting up CI jobs or performing disk cleanups since for large workspaces check-all-features and friends can take a very long time and produce a ton of artifacts.

License

Licensed under either of

at your option.

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

More Repositories

1

graphosaurus

3D graph viewer powered by WebGL (three.js)
JavaScript
383
star
2

rust-notifica

Small, cross-platform Rust crate for sending system notifications
Rust
281
star
3

alert-after

Get a desktop notification after a command finishes executing.
Rust
269
star
4

rgis

Performant, cross-platform (web, desktop) GIS app written in Rust
Rust
122
star
5

rust-dark-light

Rust crate to detect if dark mode or light mode is enabled
Rust
78
star
6

rust-crates-index

Rust library for retrieving and interacting with the crates.io index
Rust
65
star
7

rust-sysbar

Rust library for interacting with the system's taskbar / tray / statusbar
Rust
62
star
8

rust-chunked-transfer

Encoder and decoder for HTTP chunked transfer coding (RFC 7230 § 4.1)
Rust
24
star
9

crate-deps

A web service that generates images of dependency graphs for crates hosted on crates.io
Rust
20
star
10

who-hosts-hate

Who hosts hate on the internet?
Python
17
star
11

bevy-earcutr

Runs earcutr on geometries and generates a Bevy Mesh.
Rust
16
star
12

bevy-web-resizer

Rust
15
star
13

bitcoin-prices

Firefox extension displaying current Bitcoin prices
JavaScript
13
star
14

rcat

Concatenate and print files in a Rust byte slice compatible format.
Rust
12
star
15

rust-crates-index-graph

Rust
11
star
16

unicode.fyi

Unicode code point and grapheme cluster explorer
TypeScript
10
star
17

organize.fyi

HTML
10
star
18

docker-rust-alpine

Minimal Alpine-based Rust Docker image
9
star
19

riaaradar

Simple web app used to determine whether an album was released by an RIAA affiliated label
JavaScript
8
star
20

tech-organizing-handbook

7
star
21

lop.farm

Cloud-based fuzz testing (not actively hosted at the moment)
Python
7
star
22

rust-graph

RenderScript
6
star
23

mediagoblin-heroku

MediaGoblin running on Heroku
Python
6
star
24

three-buffergeometry-sort

Utility to sort THREE.js BufferGeometry
JavaScript
5
star
25

rust-gcd

Small Rust library for calculating greatest common divisor
Rust
5
star
26

rust-ebd

Rust library for reading the eBird Basic Dataset (EBD)
Rust
4
star
27

formatted-licenses

Software licenses formatted as Markdown (md) and reStructuredText (rst)
4
star
28

bevy_jobs

A lightweight job framework for Bevy.
Rust
3
star
29

tab-control

Cross-browser extension for limiting tabs
JavaScript
3
star
30

rust-two-three

A two-three (2-3) tree implementation in Rust.
Rust
3
star
31

sorbet-result

A result type for Sorbet.
Ruby
3
star
32

geo-bevy

Generate Bevy meshes from `geo` types
Rust
3
star
33

rust-quale

A Rust port of the `which` utility. Locates an executable in the user’s path.
Rust
3
star
34

reddit-calpoly-addflair

A simple web application used to add flair to users' names on http://calpoly.reddit.com
Python
3
star
35

ruby-coverage-guided-fuzzer

PoC fuzzer written in Ruby for Ruby powered by Ruby’s built-in coverage library.
Ruby
3
star
36

rust-inaturalist

Rust iNaturalist API bindings
Rust
2
star
37

mbz2nx

Python library that creates a graph database (NetworkX) from the MusicBrainz database
Python
2
star
38

homograph-attack-finder

Find homograph attack candidates for top 1m sites
Ruby
2
star
39

gis-utils

GIS Utilities
Python
2
star
40

music-industry-relations-graph-visualization

A visualization I made years back visualizing relations between record labels
JavaScript
2
star
41

hellirinn

2D multiplayer mining game/simulator
2
star
42

nonew.js

Allows constructor functions to be called without using 'new'
JavaScript
2
star
43

sorbet-stats

Generate CSV stats about a Sorbet project
Ruby
2
star
44

wotgraph

Converts PGP web of trust .wot files to other graph formats via NetworkX
Python
2
star
45

art

TypeScript
1
star
46

scrobd

My clone of the Python MPD scrobbler
Python
1
star
47

tech-pto-comparison

💸 A comparison of PTO policies in the tech industry
1
star
48

union-docs

1
star
49

docker-rust-source

Dockerfile that builds the latest Rust and Cargo from source
1
star
50

openbrain

Python
1
star
51

reddit-bigspy

Reddit BigSpy, inspired by/similar to Digg BigSpy
JavaScript
1
star
52

riaapath

Python
1
star
53

project-euler

My solutions to Project Euler
Python
1
star
54

wotsap

GitHub mirror of http://www.lysator.liu.se/~jc/wotsap/index.html
Python
1
star
55

Studygasm

Startup Weekend SLO Project
JavaScript
1
star
56

advent-of-code

solutions for advent of code
Rust
1
star
57

rust-dotty

Library for generating DOT graph files
Rust
1
star
58

crs-definitions

Rust crate containing CRS definitions
Rust
1
star
59

codejam2012

JavaScript
1
star
60

heroku-tiny-http-hello-world

"Hello Example" for tiny_http on Heroku
Rust
1
star
61

learnthe.land

Flashcard web app for naturalists, powered by iNaturalist.
TypeScript
1
star
62

TheRiker

An pluggable IRC bot using Twisted
Python
1
star
63

trackmypackage

JavaScript
1
star
64

cpn-hyperlinks

Python
1
star
65

torrc-rs

Rust crate for parsing Tor torrc files.
Rust
1
star
66

python-calpoly

A library to help get Cal Poly data in Python
Python
1
star
67

proj-sys-bug

Dummy project to demonstrate proj-sys issue
Rust
1
star
68

cryptopals-crypto-challenges-rust

Solutions to the matasano crypto challenges written in Rust
Rust
1
star
69

ring-pwhash

A Rust password hashing library based on *ring* cryptographic primitives
Rust
1
star
70

fluxbuntu-website

1
star