crate-ci / escargot

Cargo API written in Paris
docs.rs/cargo
Apache License 2.0
39 stars 14 forks source link

Add .current_features() #23

Open alecmocatta opened 5 years ago

alecmocatta commented 5 years ago

For my use case I'd like a build that is of exactly the same config/env as the current build. If escargot can figure out a way to get the features currently activated, that would be really helpful!

escargot::CargoBuild::new()
    .bin("bin_fixture")
    .current_release()
    .current_target()
    .current_features()
    .exec()
    .unwrap();
epage commented 5 years ago

Sadly, I don't think there is a way

epage commented 5 years ago

btw, what is your use case?

alecmocatta commented 5 years ago

I have a test that builds and runs an example. cargo test --no-default-features was failing due to that build then defaulting to using the "nightly" feature.

[features]
default = ["nightly"]
nightly = ["valgrind_request"]
epage commented 5 years ago

If it wasn't for the example part, I'd point you to matklad's way of resolving this https://github.com/assert-rs/assert_cmd/issues/57#issuecomment-444180189