nix-community / crate2nix

rebuild only changed crates in CI with crate2nix and nix
https://nix-community.github.io/crate2nix/
Apache License 2.0
354 stars 83 forks source link

expose required-features to buildRustCrate #254

Closed marius851000 closed 2 years ago

marius851000 commented 2 years ago

The required features field allow to skip the compilation of a binary (or test, bench and example) if all the features aren’t enabled. This is documented here : https://doc.rust-lang.org/cargo/reference/cargo-targets.html#the-required-features-field

This PR against nixpkgs make use of it: https://github.com/NixOS/nixpkgs/pull/187975

It should still work independantly of whether this nixpkgs PR is merged or not.

marius851000 commented 2 years ago

That's done. The newly added test passes locally (while some other fail due to the lack of unsafeDiscardStringContext, fixed in my other PR). As a bonus, it remove the dependency on rand.

Ericson2314 commented 2 years ago

Thanks!