-
Notifications
You must be signed in to change notification settings - Fork 681
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add cargo features #1197
Add cargo features #1197
Conversation
Thanks for your hard work. Something like this has been dimly on the radar for a long time (see
|
I think the entire Rust ecosystem is currently trying to figure out how to My idea was to divide nix in a few big subsystems. I do not have usage The current PR basically puts every syscall category in its own feature but I
That is a very valid question; One I have been thinking about. I think it is very clear that the combinatorics are not on our side here. I do not think we have to make that guarantee though. We can probably test a Additionally, I think deactivating features in nix should be only advertised to
I just checked that. Cargo seems to be doing the reasonable thing here. Only one In your example, nix is build with features aio, eventfd and signal.
I feel like features are better than subcrates but that is a personal opinion In any way, I do not think it is any worse than subcrates in the case of nix. |
For reference, here is a dependency graph of the current features I introduced. After some regrouping, I think we could do something like that: sources for the graphs
|
Cool graph. How did you make it? Was that done with cargo-modules? |
No, manually with just a little bit of scripting. |
I just wanted to add that tokio 0.2 has successfully adopted the same scheme with features, and it works quite well. |
@vdagonneau the reason I sort of dropped this PR was because I found it too daunting. But I want to get back to it now, especially because I just discovered cargo-hack, which makes it possible to actually ensure that the feature flags work. Superseded by #1498 |
Hello !
I have been using nix for a while now across my projects and I consistently use only small subsets of it. I therefore modified nix in order to use features so I can only "pay" for what I use.
The main advantage is shorter compilation times, it also allows for reducing transitive dependencies (
void
for example is only used by reboot and unistd).