mikedilger / gossip

Gossip is a nostr client
Other
682 stars 77 forks source link

Build fails: trait `ExpectOrOverflow` is never used, etc #822

Open yurivict opened 1 month ago

yurivict commented 1 month ago
warning: lint `private_in_public` has been removed: replaced with another group of lints, see RFC <https://rust-lang.github.io/rfcs/2145-type-privacy.html> for more information
   --> /usr/ports/net-p2p/gossip/work/gossip-0.11.2/cargo-crates/tracing-subscriber-0.3.18/src/lib.rs:189:5
    |
189 |     private_in_public,
    |     ^^^^^^^^^^^^^^^^^
    |
    = note: `#[warn(renamed_and_removed_lints)]` on by default

error: trait `ExpectOrOverflow` is never used
  --> /usr/ports/net-p2p/gossip/work/qrcode-rust-519b77b3efa3f84961169b47d3de08c5ddd86548/src/cast.rs:25:7
   |
25 | trait ExpectOrOverflow {
   |       ^^^^^^^^^^^^^^^^
   |
note: the lint level is defined here
  --> /usr/ports/net-p2p/gossip/work/qrcode-rust-519b77b3efa3f84961169b47d3de08c5ddd86548/src/lib.rs:30:9
   |
30 | #![deny(warnings, clippy::pedantic)]
   |         ^^^^^^^^
   = note: `#[deny(dead_code)]` implied by `#[deny(warnings)]`

error: could not compile `qrcode` (lib) due to 1 previous error

Caused by:
  process didn't exit successfully: `CARGO=/usr/local/bin/cargo CARGO_CRATE_NAME=qrcode CARGO_MANIFEST_DIR=/usr/ports/net-p2p/gossip/work/qrcode-rust-519b77b3efa3f84961169b47d3de08c5ddd86548 CARGO_PKG_AUTHORS='kennytm <kennytm@gmail.com>' CARGO_PKG_DESCRIPTION='QR code encoder in Rust' CARGO_PKG_HOMEPAGE='' CARGO_PKG_LICENSE='MIT OR Apache-2.0' CARGO_PKG_LICENSE_FILE='' CARGO_PKG_NAME=qrcode CARGO_PKG_README=README.md CARGO_PKG_REPOSITORY='https://github.com/kennytm/qrcode-rust' CARGO_PKG_RUST_VERSION='' CARGO_PKG_VERSION=0.12.0 CARGO_PKG_VERSION_MAJOR=0 CARGO_PKG_VERSION_MINOR=12 CARGO_PKG_VERSION_PATCH=0 CARGO_PKG_VERSION_PRE='' LD_LIBRARY_PATH=/usr/ports/net-p2p/gossip/work/target/release/deps /usr/local/bin/rustc --crate-name qrcode --edition=2018 /usr/ports/net-p2p/gossip/work/qrcode-rust-519b77b3efa3f84961169b47d3de08c5ddd86548/src/lib.rs --error-format=json --json=diagnostic-rendered-ansi,artifacts,future-incompat --diagnostic-width=189 --crate-type lib --emit=dep-info,metadata,link -C opt-level=2 -C panic=abort -C linker-plugin-lto -C codegen-units=1 --cfg 'feature="default"' --cfg 'feature="image"' --cfg 'feature="svg"' -C metadata=1f018f54f264cfdd -C extra-filename=-1f018f54f264cfdd --out-dir /usr/ports/net-p2p/gossip/work/target/x86_64-unknown-freebsd/release/deps --target x86_64-unknown-freebsd -C linker=cc -C strip=debuginfo -L dependency=/usr/ports/net-p2p/gossip/work/target/x86_64-unknown-freebsd/release/deps -L dependency=/usr/ports/net-p2p/gossip/work/target/release/deps --extern checked_int_cast=/usr/ports/net-p2p/gossip/work/target/x86_64-unknown-freebsd/release/deps/libchecked_int_cast-b3e378cd35a5f90e.rmeta --extern image=/usr/ports/net-p2p/gossip/work/target/x86_64-unknown-freebsd/release/deps/libimage-fd76e9b357afa52b.rmeta -C link-arg=-fstack-protector-strong` (exit status: 1)
warning: build failed, waiting for other jobs to finish...
error[E0412]: cannot find type `Id` in module `task`
   --> gossip-lib/src/overlord/mod.rs:58:37
    |
58  |     minions_task_url: HashMap<task::Id, RelayUrl>,
    |                                     ^^ not found in `task`
    |
note: found an item that was configured out
   --> /usr/ports/net-p2p/gossip/work/gossip-0.11.2/cargo-crates/tokio-1.37.0/src/task/mod.rs:361:40
    |
361 |         pub use crate::runtime::task::{Id, id, try_id};
    |                                        ^^
help: consider importing one of these items
    |
3   + use nostr_types::Id;
    |
3   + use tracing::Id;
    |
help: if you import `Id`, refer to it directly
    |
58  -     minions_task_url: HashMap<task::Id, RelayUrl>,
58  +     minions_task_url: HashMap<Id, RelayUrl>,
    |

error[E0412]: cannot find type `Id` in module `task`
   --> gossip-lib/src/overlord/mod.rs:409:47
    |
409 |         task_nextjoined: Option<Result<(task::Id, MinionResult), task::JoinError>>,
    |                                               ^^ not found in `task`
    |
note: found an item that was configured out
   --> /usr/ports/net-p2p/gossip/work/gossip-0.11.2/cargo-crates/tokio-1.37.0/src/task/mod.rs:361:40
    |
361 |         pub use crate::runtime::task::{Id, id, try_id};
    |                                        ^^
help: consider importing one of these items
    |
3   + use nostr_types::Id;
    |
3   + use tracing::Id;
    |
help: if you import `Id`, refer to it directly
    |
409 -         task_nextjoined: Option<Result<(task::Id, MinionResult), task::JoinError>>,
409 +         task_nextjoined: Option<Result<(Id, MinionResult), task::JoinError>>,
    |

error[E0599]: no method named `join_next_with_id` found for struct `JoinSet` in the current scope
   --> gossip-lib/src/overlord/mod.rs:134:48
    |
134 |                 task_nextjoined = self.minions.join_next_with_id() => {
    |                                                ^^^^^^^^^^^^^^^^^
    |
help: there is a method `join_next` with a similar name
    |
134 |                 task_nextjoined = self.minions.join_next() => {
    |                                                ~~~~~~~~~

error[E0599]: no method named `join_next_with_id` found for struct `JoinSet` in the current scope
   --> gossip-lib/src/overlord/mod.rs:219:48
    |
219 |                 task_nextjoined = self.minions.join_next_with_id(), if !self.minions.is_empty() => {
    |                                                ^^^^^^^^^^^^^^^^^
    |
help: there is a method `join_next` with a similar name
    |
219 |                 task_nextjoined = self.minions.join_next(), if !self.minions.is_empty() => {
    |                                                ~~~~~~~~~

error[E0599]: no method named `id` found for struct `tokio::task::AbortHandle` in the current scope
   --> gossip-lib/src/overlord/mod.rs:398:35
    |
398 |             let id = abort_handle.id();
    |                                   ^^ method not found in `AbortHandle`

error[E0282]: type annotations needed
   --> gossip-lib/src/overlord/mod.rs:417:47
    |
417 |             Err(ref join_error) => join_error.id(),
    |                                               ^^ cannot infer type for type parameter `E` declared on the enum `Result`

warning: `tracing-subscriber` (lib) generated 1 warning
Some errors have detailed explanations: E0282, E0412, E0599.
For more information about an error, try `rustc --explain E0282`.
error: could not compile `gossip-lib` (lib) due to 6 previous errors

Version: 0.11.2 rust-1.79.0 FreeBSD 14.1

mikedilger commented 1 month ago

What branch/commit are you building?

mikedilger commented 1 month ago

Your build is not considering the file .cargo/config which enables the tokio_unstable config flag. That is why the task 'id' logic is missing. Search older issues I think I've answered this before.

yurivict commented 1 month ago

What branch/commit are you building?

I build the version v0.11.2 from the master branch.

mikedilger commented 1 month ago

The full-featured build command (from the README) is this: If this isn't working let me know, but it looks like you didn't include "--cfg tokio_unstable"

RUSTFLAGS="-C target-cpu=native --cfg tokio_unstable" cargo build --features=lang-cjk,video-ffmpeg --release
bu5hm4nn commented 1 month ago

@mikedilger we should rename it to .cargo/config.toml (add the .toml ending) per handbook. Some implementations might not be considering it without the ending. https://doc.rust-lang.org/cargo/reference/config.html

mikedilger commented 1 month ago

I think it already is. It is on my system. I must have misspoke up above.