Skip to content

cargo: remove features#62

Closed
lovesegfault wants to merge 1 commit into
parasyte:masterfrom
lovesegfault:no-example-features
Closed

cargo: remove features#62
lovesegfault wants to merge 1 commit into
parasyte:masterfrom
lovesegfault:no-example-features

Conversation

@lovesegfault

Copy link
Copy Markdown
Contributor

The justification for them existing was that cargo adds in binary-only
deps to mixed bin/lib crates, which inflates dependency trees and
overall just sucks.

While this is true, that doesn't apply to dev-dependencies, which don't
get propagated, but which are available to example code. By removing the
myriad of features and moving those dependencies into dev-dependencies
we make developers' lives easier (it's easier to run examples) and don't
actually lose anything.

Moreover, this also allows to test all code with no need for
--all-features.

The justification for them existing was that cargo adds in binary-only
deps to mixed bin/lib crates, which inflates dependency trees and
overall just sucks.

While this is true, that doesn't apply to dev-dependencies, which don't
get propagated, but which are available to example code. By removing the
myriad of features and moving those dependencies into `dev-dependencies`
we make developers' lives easier (it's easier to run examples) and don't
actually lose anything.

Moreover, this also allows to test all code with no need for
`--all-features`.
@bjorn3

bjorn3 commented Apr 12, 2020

Copy link
Copy Markdown

This means that all dependencies required for specific examples will be build when you try to build any of the examples.

@lovesegfault

Copy link
Copy Markdown
Contributor Author

That's correct, the difference is actually small and the gain in convenience of not having to deal with all the feature flags is huge.

@parasyte

Copy link
Copy Markdown
Owner

I want to move the examples to their own crates so we don't have dependency bloat. The features were introduced because I didn't want to build e.g. all of the SDL dependencies on the minimal-winit example. Moving each example to its own crate solves the dilemma without relying on feature gates.

@lovesegfault

Copy link
Copy Markdown
Contributor Author

Understood, I'll do that in a separate PR then :)

@lovesegfault lovesegfault deleted the no-example-features branch April 13, 2020 04:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants