rust-bitcoin / bitcoin_hashes

Simple library which implements a few hashes and does nothing else
Creative Commons Zero v1.0 Universal
66 stars 52 forks source link

Use of private module `serde_macros` makes builds fail since 0.9.1 #101

Closed afilini closed 4 years ago

afilini commented 4 years ago

I'm still investigating this, so I'm not entirely sure whether this is our fault in bdk or if this is due to bitcoin_hashes.

Anyways, it looks like the newly-released 0.9.1 makes bdk builds fail with an error regarding the use of private modules somewhere in bitcoin_hashes (see attached log).

This was not happening with 0.9.0 and build trees that still have a cached 0.9.0 copy of bitcoin_hashes will still happily compile. Running cargo update and forcing the update of bitcoin_hashes in those trees to the new release will then make the build fail.

It should be noted that we don't directly import bitcoin_hashes as a dependency, but we depend on it indirectly through bitcoin 0.25.

Issue in our repo: bitcoindevkit/bdk#136

error[E0603]: module `serde_macros` is private
  --> /home/user/.cargo/registry/src/github.com-1ecc6299db9ec823/bitcoin_hashes-0.9.1/src/serde_macros.rs:98:22
   |
98 |         impl $crate::serde_macros::serde_details::SerdeHash for $t {
   |                      ^^^^^^^^^^^^ private module
   |
note: the module `serde_macros` is defined here
  --> /home/user/.cargo/registry/src/github.com-1ecc6299db9ec823/bitcoin_hashes-0.9.1/src/lib.rs:47:14
   |
47 | #[macro_use] mod serde_macros;
   |              ^^^^^^^^^^^^^^^^^

error[E0603]: module `serde_macros` is private
   --> /home/user/.cargo/registry/src/github.com-1ecc6299db9ec823/bitcoin_hashes-0.9.1/src/serde_macros.rs:107:25
    |
107 |                 $crate::serde_macros::serde_details::SerdeHash::serialize(self, s)
    |                         ^^^^^^^^^^^^ private module
    |
note: the module `serde_macros` is defined here
   --> /home/user/.cargo/registry/src/github.com-1ecc6299db9ec823/bitcoin_hashes-0.9.1/src/lib.rs:47:14
    |
47  | #[macro_use] mod serde_macros;
    |              ^^^^^^^^^^^^^^^^^

error[E0603]: module `serde_macros` is private
   --> /home/user/.cargo/registry/src/github.com-1ecc6299db9ec823/bitcoin_hashes-0.9.1/src/serde_macros.rs:113:25
    |
113 |                 $crate::serde_macros::serde_details::SerdeHash::deserialize(d)
    |                         ^^^^^^^^^^^^ private module
    |
note: the module `serde_macros` is defined here
   --> /home/user/.cargo/registry/src/github.com-1ecc6299db9ec823/bitcoin_hashes-0.9.1/src/lib.rs:47:14
    |
47  | #[macro_use] mod serde_macros;
    |              ^^^^^^^^^^^^^^^^^

error: aborting due to 3 previous errors
jrawsthorne commented 4 years ago

https://github.com/rust-bitcoin/rust-bitcoin/pull/502#issuecomment-711060414

elichai commented 4 years ago

@afilini Can you please test that this is fixed by https://github.com/rust-bitcoin/bitcoin_hashes/pull/100 ?

afilini commented 4 years ago

Yes, adding that branch as a patch to our Cargo.toml fixes the issue.

Sorry for the trouble, I forgot to check in the pull requests section and only checked if there was already another issue open for the same problem.

apoelstra commented 4 years ago

Sorry for letting this sit all weekend. Published 0.9.2 and yanked 0.9.1. Should be good now.