-
-
Notifications
You must be signed in to change notification settings - Fork 79
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 the ability to exclude experimental features from consideration #315
Comments
|
The ideal long term solution for this is rust-lang/cargo#10881 and respecting it. |
Thanks for raising this! It's definitely a use case that should be supported. I have a suggested workaround, and a broader comment about the topic of "this code is public but not stable." The workaround is this: My broader comment: An unfortunate difficulty is that the Rust ecosystem as a whole hasn't settled on the way to signal to downstream consumers that "this bunch of code is public but normal stability guarantees don't apply." It affects more than just not-yet-stable code. For example, another place where this comes up is macros: macro-generated code may use portions of the public API that aren't meant to be used directly, and aren't themselves stable except as used via the macros. Some authors feel that We'd need to do a decent bit of research to find the best design here, since cargo-semver-checks is going to be integrated into cargo and therefore our choices would have a significant ecosystem-wide impact. I'm definitely in favor of doing this work, but unfortunately due to its large scope, it's not something we have the bandwidth for at this point in the project. I hope that we're able to attract more contributors over time and get to it as soon as possible. |
Just wanted to call out that these are two different use cases, generally
|
v0.21 was just released and allows specifying the exact set of features to use, both by feature group (e.g. only default features) as well as at the level of individual features. Thanks for your patience! Would love to hear how it went if you get a chance to try it! |
Thanks! We'll put out our releases at the start of each month, so we'll be trying this code out some more as the day approaches. For your amusement, here is the workaround we have been using up until now: https://gitlab.torproject.org/tpo/core/arti/-/blob/main/maint/semver-checks |
Nice workaround! cargo-semver-checks does effectively the same thing internally now, with the added ability to cache baseline rustdoc JSON files if they correspond to a known crate version. Depending on how you use it, that might also give you a nice speed boost since as the comments show you've already noticed, rustdoc generation is one of the noticeably slow parts of the process now. |
Here's how it went: we managed to drop the entire old script, and replace it with:
Everything worked swimmingly and went much faster, and the outputs were much nicer. I've opened issues for everything we ran into that might be fixed in the future:
Thanks again for working on this! |
Awesome, that's great to hear! I also appreciate you opening issues and offering to help, we definitely could use the help and I'm happy to point you in the right direction. Feel free to ping me anytime with questions. I'll put some pointers in each of the issues you mentioned. |
Describe your use case
In our project, we have a development process where some parts of our API are explicitly labeled as "experimental, and not covered by semver." Our expectation is that eventually, these parts become stable, or are removed.
We put these experimental APIs behind one or more features, each explicitly labelled as experimental in our documentation. To replace most usage of
--all-features
, we provide afull
feature that includes all non-experimental features.As it stands today, this setup doesn't seem compatible with cargo-semver-checks, since cargo-semver-checks always uses --all-features (that is, if I understand correctly).
Describe the solution you'd like
The easiest solution for us would be a command-line option to cause
cargo-semver-checks
to replace the default--all-features
. Possibly something like--not-all-features --features=<explict,list>
would be workable?Alternatives, if applicable
No response
Additional Context
No response
The text was updated successfully, but these errors were encountered: