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

Re-export Parity struct #360

Merged
merged 1 commit into from
Jan 6, 2022
Merged

Conversation

sanket1729
Copy link
Member

@sanket1729 sanket1729 commented Jan 6, 2022

pub struct Parity is under a private module key and not re-exported in lib.rs . It is therefore not
possible to use it downstream.

@sanket1729
Copy link
Member Author

Might need another point release. I wish rust compiler would warn about these things.

cc @apoelstra , @elichai.

@sanket1729 sanket1729 mentioned this pull request Jan 6, 2022
pub struct Parity is under a private module key. It is therefore not
possible to use it downstream.
@sanket1729 sanket1729 changed the title Make key mod public Re-export Parity struct Jan 6, 2022
@sanket1729
Copy link
Member Author

We can also make key mod public. I don't know which one is better or the preferred way to do things.

@tcharding
Copy link
Member

oooo, my mistake. Thanks for catching this. Another option would be to use a wildcard statement like we do for context (pub use key::*).

@tcharding
Copy link
Member

tcharding commented Jan 6, 2022

Might need another point release.

I think 0.21.0 is totally broken because of this and will need to be yanked from crates.io Hopefully no one is using the taproot stuff yet so we won't have too much egg on our face.

I wish rust compiler would warn about these things.

I think regression/integration tests is what should have caught this. Adding to my TODO list.

@thomaseizinger
Copy link
Contributor

thomaseizinger commented Jan 6, 2022

I think regression/integration tests is what should have caught this. Adding to my TODO list.

Moving the tests to tests/ is also a good way of checking that the public API of the crate is actually usable.

@elichai
Copy link
Member

elichai commented Jan 6, 2022

ACK e595b39

@apoelstra
Copy link
Member

I think 0.21.0 is totally broken because of this and will need to be yanked from crates.io Hopefully no one is using the taproot stuff yet so we won't have too much egg on our face.

Sure, though I'll publish 0.21.1 before yanking it. I think the keypair related stuff is "totally broken" but not the rest of the library, so best not to make non-schnorr people undo any integration work they might've started in the last 24 hours.

Copy link
Member

@apoelstra apoelstra left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ACK e595b39

@apoelstra apoelstra merged commit 74e8fc7 into rust-bitcoin:master Jan 6, 2022
@apoelstra
Copy link
Member

Published and tagged.

Yanked 0.21.0.

@sanket1729
Copy link
Member Author

Another error. Sorry about that. I think we also need basic derives for Parity :( . I think this highlights the need for the release process. Maybe perhaps have a RC for a couple days.

@apoelstra
Copy link
Member

Personally, I think it's fine to treat point releases as RCs, and to have a few iterations of this whenever we do a major release.

@tcharding what do you think?

@tcharding
Copy link
Member

Personally, I think it's fine to treat point releases as RCs

This is an interesting idea, I'd never thought of it before. Is anyone else in the Rust community doing this (or other users of semvar in general)? I think before 1.0 we might be able to get away with it but it seems a little bit cheeky. Before we release 1.0 we should have a proper release process with a release candidates, feature freeze window, etc. so that we don't treat users as beta testers.

Another error. Sorry about that. I think we also need basic derives for Parity

Wow, I really did botch this one. Missing derives is something Clippy can definitely help us with, at least for Copy and Debug. I'll raise a PR to add attributes to configure Clippy to prevent this happening in the future.

@tcharding
Copy link
Member

@apoelstra please see #362 adding derives. Please do another point release at some stage and add to my tab 'Tobin owes Andrew one pint of the finest'.

@apoelstra
Copy link
Member

Adding attributes to Clippy would be awesome.

After a bit of thought, I think there's a lot of value in releasing rcs for rust-secp, bitcoin_hashes, etc., until we at least know that we can even compile rust-bitcoin with the new features that we've added. I agree that it's cheeky, at the very least, to use point releases for this purpose.

And I'll never say no to free beer ;) but I really should've caught this as well.

@tcharding
Copy link
Member

Adding attributes to Clippy would be awesome.

We can use

#![warn(missing_debug_implementations)]
#![warn(missing_copy_implementations)]

(I made a mistake above, these are inbuilt Rustc lints not Clippy.)

Although they only catch missing Copy and Debug this can still highlight for devs the line of code with a derive issue.

On this topic, does rust-secp256k1 want to move towards enforcing the addition of opportunistically adding derives to all types as is suggested doing in rust-bitcoin in the proposed CONTIRUBTING.md document? I.e.

#[derive(Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash, Debug)]
pub struct Foo {}

@apoelstra
Copy link
Member

I think that's reasonable for rust-secp, yeah. I'm sure there are exceptions but we should default to having them.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Development

Successfully merging this pull request may close these issues.

None yet

5 participants