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

Add rust-bitcoin CI #37

Merged
merged 17 commits into from
Sep 30, 2024
Merged

Add rust-bitcoin CI #37

merged 17 commits into from
Sep 30, 2024

Conversation

raphjaph
Copy link
Collaborator

@raphjaph raphjaph commented Sep 9, 2024

When I run cargo +nightly build -Zminimal-versions I run into the below problems. Here I'm not sure if I'm using the crates wrong or if one of my dependencies is using it wrong. Any help or pointers appreciated.

error: expected identifier, found doc comment `//! Bitcoin transactions.`
 --> /Users/raphael/.cargo/registry/src/index.crates.io-6f17d22bba15001f/bitcoin-0.31.2/src/blockdata/transaction.rs:3:1
  |
3 | //! Bitcoin transactions.
  | ^^^^^^^^^^^^^^^^^^^^^^^^^ expected identifier, found doc comment

error[E0432]: unresolved import `crate::blockdata::transaction::OutPoint`
  --> /Users/raphael/.cargo/registry/src/index.crates.io-6f17d22bba15001f/bitcoin-0.31.2/src/bip158.rs:50:5
   |
50 | use crate::blockdata::transaction::OutPoint;
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ no `OutPoint` in `blockdata::transaction`

error[E0432]: unresolved import `crate::blockdata::transaction::Transaction`
  --> /Users/raphael/.cargo/registry/src/index.crates.io-6f17d22bba15001f/bitcoin-0.31.2/src/blockdata/block.rs:17:5
   |
17 | use crate::blockdata::transaction::Transaction;
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ no `Transaction` in `blockdata::transaction`
   |
help: consider importing this variant instead
   |
17 | use crate::p2p::message_blockdata::Inventory::Transaction;
   |     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

error[E0432]: unresolved imports `crate::blockdata::transaction::OutPoint`, `crate::blockdata::transaction::Sequence`, `crate::blockdata::transaction::Transaction`, `crate::blockdata::transaction::TxIn`, `crate::blockdata::transaction::TxOut`
  --> /Users/raphael/.cargo/registry/src/index.crates.io-6f17d22bba15001f/bitcoin-0.31.2/src/blockdata/constants.rs:20:43
   |
20 | use crate::blockdata::transaction::{self, OutPoint, Sequence, Transaction, TxIn, TxOut};
   |                                           ^^^^^^^^  ^^^^^^^^  ^^^^^^^^^^^  ^^^^  ^^^^^ no `TxOut` in `blockdata::transaction`
   |                                           |         |         |            |
   |                                           |         |         |            no `TxIn` in `blockdata::transaction`
   |                                           |         |         no `Transaction` in `blockdata::transaction`
   |                                           |         no `Sequence` in `blockdata::transaction`
   |                                           no `OutPoint` in `blockdata::transaction`
   |
   = help: consider importing this variant instead:
           crate::p2p::message_blockdata::Inventory::Transaction

error[E0432]: unresolved import `crate::blockdata::transaction::Sequence`
  --> /Users/raphael/.cargo/registry/src/index.crates.io-6f17d22bba15001f/bitcoin-0.31.2/src/blockdata/script/builder.rs:12:5
   |
12 | use crate::blockdata::transaction::Sequence;
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ no `Sequence` in `blockdata::transaction`

error[E0432]: unresolved imports `crate::blockdata::transaction::Transaction`, `crate::blockdata::transaction::TxIn`, `crate::blockdata::transaction::TxOut`
  --> /Users/raphael/.cargo/registry/src/index.crates.io-6f17d22bba15001f/bitcoin-0.31.2/src/consensus/encode.rs:26:37
   |
26 | use crate::blockdata::transaction::{Transaction, TxIn, TxOut};
   |                                     ^^^^^^^^^^^  ^^^^  ^^^^^ no `TxOut` in `blockdata::transaction`
   |                                     |            |
   |                                     |            no `TxIn` in `blockdata::transaction`
   |                                     no `Transaction` in `blockdata::transaction`
   |
   = help: consider importing this variant instead:
           crate::consensus::encode::Inventory::Transaction

error[E0432]: unresolved import `crate::blockdata::transaction::Transaction`
  --> /Users/raphael/.cargo/registry/src/index.crates.io-6f17d22bba15001f/bitcoin-0.31.2/src/merkle_tree/block.rs:47:5
   |
47 | use crate::blockdata::transaction::Transaction;
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ no `Transaction` in `blockdata::transaction`
   |
help: consider importing this variant instead
   |
47 | use crate::p2p::message_blockdata::Inventory::Transaction;
   |     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

error[E0432]: unresolved imports `crate::blockdata::transaction::Transaction`, `crate::blockdata::transaction::TxOut`
  --> /Users/raphael/.cargo/registry/src/index.crates.io-6f17d22bba15001f/bitcoin-0.31.2/src/psbt/mod.rs:19:37
   |
19 | use crate::blockdata::transaction::{Transaction, TxOut};
   |                                     ^^^^^^^^^^^  ^^^^^ no `TxOut` in `blockdata::transaction`
   |                                     |
   |                                     no `Transaction` in `blockdata::transaction`
   |
   = help: consider importing this variant instead:
           crate::p2p::message_blockdata::Inventory::Transaction

error[E0432]: unresolved imports `crate::blockdata::transaction::Transaction`, `crate::blockdata::transaction::TxOut`
  --> /Users/raphael/.cargo/registry/src/index.crates.io-6f17d22bba15001f/bitcoin-0.31.2/src/psbt/serialize.rs:17:37
   |
17 | use crate::blockdata::transaction::{Transaction, TxOut};
   |                                     ^^^^^^^^^^^  ^^^^^ no `TxOut` in `blockdata::transaction`
   |                                     |
   |                                     no `Transaction` in `blockdata::transaction`
   |
   = help: consider importing one of these items instead:
           crate::p2p::message_blockdata::Inventory::Transaction
           crate::psbt::Transaction
   = help: consider importing this unresolved item through its public re-export instead:
           crate::psbt::TxOut

error[E0432]: unresolved import `crate::blockdata::transaction::Transaction`
 --> /Users/raphael/.cargo/registry/src/index.crates.io-6f17d22bba15001f/bitcoin-0.31.2/src/psbt/error.rs:8:5
  |
8 | use crate::blockdata::transaction::Transaction;
  |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ no `Transaction` in `blockdata::transaction`
  |
help: consider importing one of these items instead
  |
8 | use crate::p2p::message_blockdata::Inventory::Transaction;
  |     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
8 | use crate::psbt::Transaction;
  |     ~~~~~~~~~~~~~~~~~~~~~~~~

error[E0432]: unresolved import `crate::blockdata::transaction::Transaction`
 --> /Users/raphael/.cargo/registry/src/index.crates.io-6f17d22bba15001f/bitcoin-0.31.2/src/psbt/map/global.rs:6:5
  |
6 | use crate::blockdata::transaction::Transaction;
  |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ no `Transaction` in `blockdata::transaction`
  |
help: consider importing one of these items instead
  |
6 | use crate::p2p::message_blockdata::Inventory::Transaction;
  |     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
6 | use crate::psbt::Transaction;
  |     ~~~~~~~~~~~~~~~~~~~~~~~~

error[E0432]: unresolved imports `crate::blockdata::transaction::Transaction`, `crate::blockdata::transaction::TxOut`
  --> /Users/raphael/.cargo/registry/src/index.crates.io-6f17d22bba15001f/bitcoin-0.31.2/src/psbt/map/input.rs:12:37
   |
12 | use crate::blockdata::transaction::{Transaction, TxOut};
   |                                     ^^^^^^^^^^^  ^^^^^ no `TxOut` in `blockdata::transaction`
   |                                     |
   |                                     no `Transaction` in `blockdata::transaction`
   |
   = help: consider importing one of these items instead:
           crate::p2p::message_blockdata::Inventory::Transaction
           crate::psbt::Transaction
   = help: consider importing this unresolved item through its public re-export instead:
           crate::psbt::TxOut

error[E0432]: unresolved imports `crate::blockdata::transaction::OutPoint`, `crate::blockdata::transaction::Sequence`, `crate::blockdata::transaction::Transaction`, `crate::blockdata::transaction::TxIn`, `crate::blockdata::transaction::TxOut`
   --> /Users/raphael/.cargo/registry/src/index.crates.io-6f17d22bba15001f/bitcoin-0.31.2/src/lib.rs:143:47
    |
143 | pub use crate::blockdata::transaction::{self, OutPoint, Sequence, Transaction, TxIn, TxOut};
    |                                               ^^^^^^^^  ^^^^^^^^  ^^^^^^^^^^^  ^^^^  ^^^^^ no `TxOut` in `blockdata::transaction`
    |                                               |         |         |            |
    |                                               |         |         |            no `TxIn` in `blockdata::transaction`
    |                                               |         |         no `Transaction` in `blockdata::transaction`
    |                                               |         no `Sequence` in `blockdata::transaction`
    |                                               no `OutPoint` in `blockdata::transaction`
    |
    = help: consider importing this variant instead:
            crate::p2p::message_blockdata::Inventory::Transaction

error[E0412]: cannot find type `Transaction` in module `transaction`
   --> /Users/raphael/.cargo/registry/src/index.crates.io-6f17d22bba15001f/bitcoin-0.31.2/src/p2p/message.rs:185:21
    |
185 |     Tx(transaction::Transaction),
    |                     ^^^^^^^^^^^ not found in `transaction`
    |
help: there is an enum variant `crate::p2p::message_blockdata::Inventory::Transaction`; try using the variant's enum
    |
185 |     Tx(crate::p2p::message_blockdata::Inventory),
    |        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

error[E0433]: failed to resolve: could not find `Version` in `transaction`
  --> /Users/raphael/.cargo/registry/src/index.crates.io-6f17d22bba15001f/bitcoin-0.31.2/src/blockdata/constants.rs:67:31
   |
67 |         version: transaction::Version::ONE,
   |                               ^^^^^^^ could not find `Version` in `transaction`
   |
help: consider importing this struct
   |
10 + use crate::block::Version;
   |
help: if you import `Version`, refer to it directly
   |
67 -         version: transaction::Version::ONE,
67 +         version: Version::ONE,
   |

   Compiling snafu v0.8.4
error[E0369]: binary operation `==` cannot be applied to type `std::vec::Vec<PrefilledTransaction>`
   --> /Users/raphael/.cargo/registry/src/index.crates.io-6f17d22bba15001f/bitcoin-0.31.2/src/bip152.rs:158:5
    |
147 | #[derive(PartialEq, Eq, Clone, Debug, PartialOrd, Ord, Hash)]
    |          --------- in this derive macro expansion
...
158 |     pub prefilled_txs: Vec<PrefilledTransaction>,
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
    = note: this error originates in the derive macro `PartialEq` (in Nightly builds, run with -Z macro-backtrace for more info)

error[E0277]: can't compare `std::vec::Vec<PrefilledTransaction>` with `std::vec::Vec<PrefilledTransaction, _>`
    --> /Users/raphael/.cargo/registry/src/index.crates.io-6f17d22bba15001f/bitcoin-0.31.2/src/bip152.rs:158:5
     |
147  | #[derive(PartialEq, Eq, Clone, Debug, PartialOrd, Ord, Hash)]
     |                                       ---------- in this derive macro expansion
...
158  |     pub prefilled_txs: Vec<PrefilledTransaction>,
     |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ no implementation for `std::vec::Vec<PrefilledTransaction> == std::vec::Vec<PrefilledTransaction, _>`
     |
     = help: the trait `PartialEq<std::vec::Vec<PrefilledTransaction, _>>` is not implemented for `std::vec::Vec<PrefilledTransaction>`
     = help: the following other types implement trait `PartialEq<Rhs>`:
               `std::vec::Vec<T, A1>` implements `PartialEq<std::vec::Vec<U, A2>>`
               `std::vec::Vec<T, A>` implements `PartialEq<&[U; N]>`
               `std::vec::Vec<T, A>` implements `PartialEq<&[U]>`
               `std::vec::Vec<T, A>` implements `PartialEq<&mut [U]>`
               `std::vec::Vec<T, A>` implements `PartialEq<[U; N]>`
               `std::vec::Vec<T, A>` implements `PartialEq<[U]>`
note: required by a bound in `std::cmp::PartialOrd::partial_cmp`
    --> /Users/raphael/.rustup/toolchains/nightly-aarch64-apple-darwin/lib/rustlib/src/rust/library/core/src/cmp.rs:1136:43
     |
1136 | pub trait PartialOrd<Rhs: ?Sized = Self>: PartialEq<Rhs> {
     |                                           ^^^^^^^^^^^^^^ required by this bound in `PartialOrd::partial_cmp`
...
1163 |     fn partial_cmp(&self, other: &Rhs) -> Option<Ordering>;
     |        ----------- required by a bound in this associated function
     = note: this error originates in the derive macro `PartialOrd` (in Nightly builds, run with -Z macro-backtrace for more info)

error[E0599]: the method `len` exists for reference `&Vec<PrefilledTransaction>`, but its trait bounds were not satisfied
   --> /Users/raphael/.cargo/registry/src/index.crates.io-6f17d22bba15001f/bitcoin-0.31.2/src/consensus/encode.rs:599:36
    |
599 |                 len += VarInt(self.len() as u64).consensus_encode(w)?;
    |                                    ^^^ private field, not a method
...
642 | impl_vec!(PrefilledTransaction);
    | ------------------------------- in this macro invocation
    |
   ::: /Users/raphael/.cargo/registry/src/index.crates.io-6f17d22bba15001f/bitcoin-0.31.2/src/bip152.rs:54:1
    |
54  | pub struct PrefilledTransaction {
    | ------------------------------- doesn't satisfy `PrefilledTransaction: Sized`
    |
    = note: the following trait bounds were not satisfied:
            `{type error}: Sized`
            which is required by `PrefilledTransaction: Sized`
    = note: this error originates in the macro `impl_vec` (in Nightly builds, run with -Z macro-backtrace for more info)

error[E0599]: no method named `iter` found for reference `&std::vec::Vec<PrefilledTransaction>` in the current scope
   --> /Users/raphael/.cargo/registry/src/index.crates.io-6f17d22bba15001f/bitcoin-0.31.2/src/consensus/encode.rs:600:31
    |
600 |                 for c in self.iter() {
    |                               ^^^^ method not found in `&Vec<PrefilledTransaction>`
...
642 | impl_vec!(PrefilledTransaction);
    | ------------------------------- in this macro invocation
    |
    = note: this error originates in the macro `impl_vec` (in Nightly builds, run with -Z macro-backtrace for more info)

Some errors have detailed explanations: E0277, E0369, E0412, E0432, E0433, E0599.
For more information about an error, try `rustc --explain E0277`.
error: could not compile `bitcoin` (lib) due to 19 previous errors

@yancyribbens
Copy link

I cloned your crate and ran the build command above without issue locally..

cargo +nightly build -Zminimal-versions
    Updating crates.io index
  Downloaded base64 v0.22.1
  Downloaded snafu v0.8.4
  Downloaded cc v1.1.6
  Downloaded syn v2.0.72
  Downloaded bitcoin-internals v0.2.0
  Downloaded bech32 v0.10.0-beta
  Downloaded hex-conservative v0.1.2
  Downloaded snafu-derive v0.8.4
  Downloaded bitcoin_hashes v0.13.0
  Downloaded secp256k1 v0.28.2
  Downloaded bitcoin v0.31.2
  Downloaded miniscript v11.1.0
  Downloaded secp256k1-sys v0.9.2
  Downloaded 13 crates (4.3 MB) in 1.19s (largest was `secp256k1-sys` at 2.6 MB)
   Compiling bitcoin-internals v0.2.0
   Compiling proc-macro2 v1.0.86
   Compiling cc v1.1.6
   Compiling unicode-ident v1.0.12
   Compiling hex_lit v0.1.1
   Compiling hex-conservative v0.1.2
   Compiling bitcoin v0.31.2
   Compiling arrayvec v0.7.4
   Compiling bech32 v0.10.0-beta
   Compiling heck v0.5.0
   Compiling hex-conservative v0.2.1
   Compiling bitcoin-io v0.1.2
   Compiling base64 v0.22.1
   Compiling bitcoin_hashes v0.13.0
   Compiling bitcoin_hashes v0.14.0
   Compiling hex v0.4.3
   Compiling quote v1.0.36
   Compiling syn v2.0.72
   Compiling secp256k1-sys v0.9.2
   Compiling snafu-derive v0.8.4
   Compiling secp256k1 v0.28.2
   Compiling snafu v0.8.4
   Compiling miniscript v11.1.0
   Compiling bip322 v0.0.7 (/home/yancy/Git/bip322)
    Finished `dev` profile [unoptimized + debuginfo] target(s) in 17.67s

@raphjaph
Copy link
Collaborator Author

Thanks, my Rust installation was borked somehow. It builds correctly now.

@raphjaph raphjaph merged commit d8cfb65 into master Sep 30, 2024
14 checks passed
@raphjaph raphjaph deleted the add-rust-bitcoin-ci branch September 30, 2024 14:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants