feat: add features parameter to cache_crate for mutually exclusive features#57
Open
bpodwinski wants to merge 9 commits into
Open
feat: add features parameter to cache_crate for mutually exclusive features#57bpodwinski wants to merge 9 commits into
bpodwinski wants to merge 9 commits into
Conversation
snowmead
requested changes
Apr 18, 2026
snowmead
left a comment
Owner
There was a problem hiding this comment.
Thanks for the change!
I noticed there are a few places not covered in some of the crate caching paths for accepting a feature set. Please make sure all of them can accept features. That way some tools don't download all the features by default.
…y impl Avoids unnecessary String allocations on static variants per @snowmead review on PR snowmead#57. Display writes directly into the formatter, so static variants do zero alloc and Specific streams its features without a join + format! intermediate String.
Remove build_feature_strategies per @snowmead review on PR snowmead#57. The helper was called once and duplicated fallback variants.
Cover: - test_cache_with_specific_features — local fixture with axum/actix features, verifies that features=["axum"] produces docs with axum symbols and excludes actix symbols. - test_cache_workspace_member_with_features — same assertion on a workspace member, validates the features propagation fix. - test_cache_leptos_use_with_axum_feature — end-to-end reproduction of the motivating scenario against crates.io (~80s). - test_cache_respects_feature_change — #[ignore]'d, expected to fail. Documents a pre-existing cache-key bug (features not part of cache identity): re-caching with a different feature set returns stale docs. Will pass once the cache key is feature-aware (separate follow-up).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
featuresparameter tocache_crateallowing users tospecify exact Cargo features instead of
--all-featuresFeatureStrategy::Specific(Vec<String>)variant inrustdoc.rswith fallback order:
Specific → DefaultFeatures → NoDefaultFeaturesleptos-usewithaxumvsactix)README.mdandinstall.shwith current tool list (cache_crateunified tool,
cache_operations)Test plan
FeatureStrategy::Specific— args and descriptioncargo fmtandcargo clippypasscache_crate({crate_name: "leptos-use", source_type: "cratesio",
version: "0.15.8", features: ["axum"]})
featuresis omitted