-
Notifications
You must be signed in to change notification settings - Fork 270
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
Check for changes to the public API #656
Check for changes to the public API #656
Conversation
I did this so I could check that #655 was needed, the feature sets are blindly copied from other PRs without any thought, will re-visit if this gets a concept ack. |
concept ACK, but yes, the feature set does not make sense for this library. I think here we can go ahead and ACK/merge this. I'll maybe leave a week for open comments. But unlike rust-bitcoin, this library is pretty-much "single owner" (me) so we can push forward without buy-in from others. |
Sweet, I'll fix it up the feature sets then. Thanks |
9cb3ee4
to
7ae8809
Compare
I went with:
Is (2) right? Perhaps no "rand"? Would it be good to have another that is just "std"? |
a193606
to
48b49a5
Compare
I think we should do In my view there are two reasons to treat a particular feature specially:
So with this in mind, In principle, we could have API breaks that affect any set of features. Especially if we are changing the feature-gates themselves. But it's not practical to do a full matrix. When we fix up the context rerandomization logic we'll probably have to be careful and manually look for API breaks because we might add complicated |
Nice explanation, thanks man. I had not thought about the "(not(feature))" thing but I guess my intuition behind (2) was correct. Grepping for 'not(feature' we get secp256k1-sys/src/lib.rs:10: #![cfg_attr(all(not(test), not(feature = "std")), no_std)]
secp256k1-sys/src/lib.rs:1102: #[cfg(not(feature = "lowmemory"))]
src/context.rs:52: not(feature = "global-context-less-secure")
src/context.rs:198: #[cfg_attr(not(feature = "rand-std"), allow(clippy::let_and_return, unused_mut))]
src/context.rs:218: not(feature = "global-context-less-secure")
src/key.rs:1027: #[cfg(all(not(feature = "global-context"), feature = "alloc"))]
src/key.rs:1071: #[cfg(all(not(feature = "global-context"), feature = "alloc"))]
src/lib.rs:142:#![cfg_attr(all(not(test), not(feature = "std")), no_std)]
src/macros.rs:84: #[cfg(not(feature = "std"))]
src/secret.rs:35: #[cfg(all(not(feature = "std"), feature = "hashes"))]
src/secret.rs:53: #[cfg(all(not(feature = "std"), not(feature = "hashes")))] Do we want to do one with "alloc" on and "global-context" off (because of |
Yeah, I like that idea. So I would suggest:
I wouldn't worry about |
You mean plain old "global-context", right? ("global-context" turns on "std") So we'd then have "std" with and with "global-context". |
We would like to get to a stage where we can commit to the public API. To help us achieve this add a script that generates the public API and checks it against three committed files, one for each feature set: no features, alloc, std. The idea is that with this applied any PR that changes the public API should include a final patch that is just the changes to the api/*.txt files, that way reviewers can discuss the changes without even needing to look at the code, quickly giving concept ACK/NACKs. We also run the script in CI to make sure we have not accidentally changed the public API so that we can be confident that don't break semver during releases. The script can also be used to diff between two release versions to get a complete list of API changes, useful for writing release notes and for users upgrading. There is a development burden involved if we apply this patch.
48b49a5
to
e9e17a0
Compare
Force push makes it so we have:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ACK e9e17a0
Let's do this! |
We would like to get to a stage where we can commit to the public API. To help us achieve this add a script that generates the public API and checks it against three committed files, one for each feature set: no features, alloc, std.
The idea is that with this applied any PR that changes the public API should include a final patch that is just the changes to the api/*.txt files, that way reviewers can discuss the changes without even needing to look at the code, quickly giving concept ACK/NACKs. We also run the script in CI to make sure we have not accidentally changed the public API so that we can be confident that don't break semver during releases. The script can also be used to diff between two release versions to get a complete list of API changes, useful for writing release notes and for users upgrading.
There is a development burden involved if we apply this patch.