Skip to content
This repository has been archived by the owner on Apr 5, 2024. It is now read-only.

Feature flag support #91

Closed
gnzlbg opened this issue Feb 13, 2019 · 4 comments
Closed

Feature flag support #91

gnzlbg opened this issue Feb 13, 2019 · 4 comments

Comments

@gnzlbg
Copy link
Contributor

gnzlbg commented Feb 13, 2019

To test libc we need to also support building a crate with --features and with --no-default-features.

@gnzlbg
Copy link
Contributor Author

gnzlbg commented Feb 13, 2019

Or are --features and --no-default-features already read by cargo ? The cargo::utils::Config takes an env variable, which might result in the args being read.

@ibabushkin
Copy link
Contributor

ibabushkin commented Jun 9, 2019

Well, the issue is that we currently cannot really pass anything to cargo's CLI frontend from our code, as the implementation is private and doesn't directly generate a Config afaict. I'm also not sure how passing environment to the config would help with forcing cargo to honour flags we have no way of passing atm. Am I missing something?

However, we have functionality to make cargo not build default features (which you implemented :). It is subtly broken in some cases though, for instance if one has dependencies between targets and features (and we try building all targets unconditionally)

@ibabushkin ibabushkin changed the title Support building crates w/o features Feature flag support Jun 9, 2019
@gnzlbg
Copy link
Contributor Author

gnzlbg commented Jun 11, 2019

cc @ehuss

@ibabushkin
Copy link
Contributor

To summarize the implementation: we basically can pass --features and --all-features over the same channel as --no-default-features to cargo's CompileOptions, which I seem to have missed previously.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants