Skip to content
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

Rework cargo features #581

Merged
merged 1 commit into from
Mar 14, 2024
Merged

Rework cargo features #581

merged 1 commit into from
Mar 14, 2024

Conversation

madsmtm
Copy link
Owner

@madsmtm madsmtm commented Feb 10, 2024

Rework icrate Cargo features to be per file instead of per class. This means that all items are now properly feature-gated, which should improve compile time!

Amazingly, Cargo allows features to depend on each other, which actually works out perfectly for our use-case, and allows us to do things in a way that should be fairly easy to understand; whenever a file A uses some type from file B, the Cargo feature for file A then requires the Cargo feature for file B. This means that everything defined in the file is now guaranteed to be available, and you only have to worry about the feature flags for things that you import.

EDIT: I've decided to go with another option for now; no features depend on each other. This is a lot more verbose in the user's Cargo.toml, but the compile-time benefits are immense!

Part of #537.

@madsmtm madsmtm added enhancement New feature or request A-framework Affects the framework crates and the translator for them labels Feb 10, 2024
@madsmtm madsmtm force-pushed the rework-cargo-features branch from e4ba27c to bc56b93 Compare February 10, 2024 02:20
@madsmtm madsmtm force-pushed the rework-cargo-features branch 7 times, most recently from c3461d4 to c431b8e Compare March 5, 2024 20:06
@madsmtm madsmtm force-pushed the rework-cargo-features branch 4 times, most recently from 3840faa to 3d26587 Compare March 14, 2024 13:07
@madsmtm madsmtm marked this pull request as ready for review March 14, 2024 13:25
@madsmtm madsmtm force-pushed the rework-cargo-features branch from 3d26587 to 0ee1323 Compare March 14, 2024 13:25
@madsmtm madsmtm merged commit 6d8eabb into master Mar 14, 2024
19 checks passed
@madsmtm madsmtm deleted the rework-cargo-features branch March 14, 2024 13:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-framework Affects the framework crates and the translator for them enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant