BlockstreamResearch / rust-secp256k1-zkp

Creative Commons Zero v1.0 Universal
31 stars 37 forks source link

Cannot build latest tag `0.5.0` #52

Closed RCasatta closed 2 years ago

RCasatta commented 2 years ago

This fixes if we want to release 0.5.1

(FYI the error is also on the other tagged version but the 0.1.0)

diff --git a/Cargo.toml b/Cargo.toml
index 47b2b6f..d9b0d66 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -31,6 +31,7 @@ use-rand = ["rand", "secp256k1/rand"]

 [dependencies]
 secp256k1 = "0.20.0"
+secp256k1-sys = "=0.4.1"
 secp256k1-zkp-sys = { version = "0.5.0", default-features = false, path = "./secp256k1-zkp-sys" }
 rand = { version = "0.6", default-features = false, optional = true }
 serde = { version = "1.0", default-features = false, optional = true }
apoelstra commented 2 years ago

Hmm, is the issue that we have broken secp-zkp with minor releases of secp-sys?

RCasatta commented 2 years ago

I think yes, this happens

$~/git/rust-secp256k1-zkp((HEAD detached at 0.5.0))$ cargo check
    Checking secp256k1-zkp-sys v0.5.0 (/home/casatta/git/rust-secp256k1-zkp/secp256k1-zkp-sys)
error[E0119]: conflicting implementations of trait `std::hash::Hash` for type `zkp::Tag`
   --> secp256k1-zkp-sys/src/zkp.rs:478:1
    |
478 | impl_array_newtype!(Tag, c_uchar, 32);
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `zkp::Tag`
...
493 | impl hash::Hash for Tag {
    | ----------------------- first implementation here
    |
    = note: this error originates in the macro `impl_array_newtype` (in Nightly builds, run with -Z macro-backtrace for more info)

error[E0119]: conflicting implementations of trait `std::hash::Hash` for type `zkp::PedersenCommitment`
   --> secp256k1-zkp-sys/src/zkp.rs:514:1
    |
514 | impl_array_newtype!(PedersenCommitment, c_uchar, 64);
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `zkp::PedersenCommitment`
...
529 | impl hash::Hash for PedersenCommitment {
    | -------------------------------------- first implementation here
    |
    = note: this error originates in the macro `impl_array_newtype` (in Nightly builds, run with -Z macro-backtrace for more info)

For more information about this error, try `rustc --explain E0119`.
error: could not compile `secp256k1-zkp-sys` due to 2 previous errors
apoelstra commented 2 years ago

I think we should just drop our explicit Hash impl rather than pinning secp-sys.

RCasatta commented 2 years ago

yeah right, sorry, what maybe what is needed is a point release (0.5.1) which is tag 0.5.0 + https://github.com/ElementsProject/rust-secp256k1-zkp/commit/3db533c38ff8fc393719daf329ae9ebb44f019d0

Or a 0.6.0 release with current master

The pinning secp-sys is an hack I am using in a downstream lib

apoelstra commented 2 years ago

I'm a bit confused what you mean by "a 0.6.0 release with current master" ... AFAICT such a release has been out for a month.

I can backport a fix though for 0.5.1.

apoelstra commented 2 years ago

Ah, I understand, rust-secp-zkp-sys is not at 0.6.0. Oops.

apoelstra commented 2 years ago

No, it is. @RCasatta are you able to bump to 0.6.0 or would you like me to create a 0.5.1?

RCasatta commented 2 years ago

Sorry, I wrongly assumed 0.6.0 wasn't released because I didn't see a tag.

If you can please tag 0.6.0 I can close this

apoelstra commented 2 years ago

Sorry, it looks like I forgot to push the tag (it was there locally, which is why I couldn't figure out the problem).

I've pushed it, things should be good now.

RCasatta commented 2 years ago

All good! Thanks