hwchen / secret-service-rs

Rust library for interfacing with Secret Service API
Apache License 2.0
73 stars 28 forks source link

secret-service boilerplate failed to compile #83

Closed sumit-modak closed 1 week ago

sumit-modak commented 2 months ago

The compilation failed in zbus OS: Fedora 38

error: Either "async-io" (default) or "tokio" must be enabled.
  --> /home/sumit/.cargo/registry/src/index.crates.io-6f17d22bba15001f/zbus-4.4.0/src/lib.rs:37:5
   |
37 |     compile_error!("Either \"async-io\" (default) or \"tokio\" must be enabled.");
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

error[E0432]: unresolved import `async_lock`
 --> /home/sumit/.cargo/registry/src/index.crates.io-6f17d22bba15001f/zbus-4.4.0/src/abstractions/async_lock.rs:2:16
  |
2 | pub(crate) use async_lock::{Mutex, RwLock, RwLockReadGuard, RwLockWriteGuard};
  |                ^^^^^^^^^^ help: a similar path exists: `crate::async_lock`
  |
  = note: `use` statements changed in Rust 2018; read more at <https://doc.rust-lang.org/edition-guide/rust-2018/module-system/path-clarity.html>

error[E0432]: unresolved import `async_io`
 --> /home/sumit/.cargo/registry/src/index.crates.io-6f17d22bba15001f/zbus-4.4.0/src/address/transport/mod.rs:9:5
  |
9 | use async_io::Async;
  |     ^^^^^^^^ use of undeclared crate or module `async_io`

error[E0432]: unresolved import `async_io`
 --> /home/sumit/.cargo/registry/src/index.crates.io-6f17d22bba15001f/zbus-4.4.0/src/address/transport/tcp.rs:4:5
  |
4 | use async_io::Async;
  |     ^^^^^^^^ use of undeclared crate or module `async_io`

error[E0432]: unresolved import `async_io`
 --> /home/sumit/.cargo/registry/src/index.crates.io-6f17d22bba15001f/zbus-4.4.0/src/connection/builder.rs:2:5
  |
2 | use async_io::Async;
  |     ^^^^^^^^ use of undeclared crate or module `async_io`

error[E0432]: unresolved import `async_io`
 --> /home/sumit/.cargo/registry/src/index.crates.io-6f17d22bba15001f/zbus-4.4.0/src/connection/socket/tcp.rs:2:5
  |
2 | use async_io::Async;
  |     ^^^^^^^^ use of undeclared crate or module `async_io`

error[E0432]: unresolved import `async_io`
 --> /home/sumit/.cargo/registry/src/index.crates.io-6f17d22bba15001f/zbus-4.4.0/src/connection/socket/unix.rs:2:5
  |
2 | use async_io::Async;
  |     ^^^^^^^^ use of undeclared crate or module `async_io`

error[E0432]: unresolved import `async_io`
  --> /home/sumit/.cargo/registry/src/index.crates.io-6f17d22bba15001f/zbus-4.4.0/src/connection/socket/mod.rs:14:5
   |
14 | use async_io::Async;
   |     ^^^^^^^^ use of undeclared crate or module `async_io`

error[E0432]: unresolved import `async_executor`
 --> /home/sumit/.cargo/registry/src/index.crates.io-6f17d22bba15001f/zbus-4.4.0/src/abstractions/executor.rs:2:5
  |
2 | use async_executor::Executor as AsyncExecutor;
  |     ^^^^^^^^^^^^^^ use of undeclared crate or module `async_executor`

error[E0432]: unresolved import `async_task`
 --> /home/sumit/.cargo/registry/src/index.crates.io-6f17d22bba15001f/zbus-4.4.0/src/abstractions/executor.rs:4:5
  |
4 | use async_task::Task as AsyncTask;
  |     ^^^^^^^^^^ use of undeclared crate or module `async_task`
  |
help: there is a crate or module with a similar name
  |
4 | use async_trait::Task as AsyncTask;
  |     ~~~~~~~~~~~

error[E0433]: failed to resolve: could not find `AsyncReadExt` in `futures_util`
   --> /home/sumit/.cargo/registry/src/index.crates.io-6f17d22bba15001f/zbus-4.4.0/src/connection/socket/tcp.rs:17:29
    |
17  |         match futures_util::AsyncReadExt::read(&mut self.as_ref(), buf).await {
    |                             ^^^^^^^^^^^^ could not find `AsyncReadExt` in `futures_util`
    |
note: found an item that was configured out
   --> /home/sumit/.cargo/registry/src/index.crates.io-6f17d22bba15001f/futures-util-0.3.30/src/lib.rs:325:47
    |
325 |     AsyncBufRead, AsyncBufReadExt, AsyncRead, AsyncReadExt, AsyncSeek, AsyncSeekExt, AsyncWrite,
    |                                               ^^^^^^^^^^^^
    = note: the item is gated behind the `io` feature

error[E0433]: failed to resolve: could not find `AsyncWriteExt` in `futures_util`
   --> /home/sumit/.cargo/registry/src/index.crates.io-6f17d22bba15001f/zbus-4.4.0/src/connection/socket/tcp.rs:67:23
    |
67  |         futures_util::AsyncWriteExt::write(&mut self.as_ref(), buf).await
    |                       ^^^^^^^^^^^^^ could not find `AsyncWriteExt` in `futures_util`
    |
note: found an item that was configured out
   --> /home/sumit/.cargo/registry/src/index.crates.io-6f17d22bba15001f/futures-util-0.3.30/src/lib.rs:326:5
    |
326 |     AsyncWriteExt,
    |     ^^^^^^^^^^^^^
    = note: the item is gated behind the `io` feature

error[E0433]: failed to resolve: use of undeclared crate or module `async_lock`
  --> /home/sumit/.cargo/registry/src/index.crates.io-6f17d22bba15001f/zbus-4.4.0/src/abstractions/async_lock.rs:15:25
   |
15 |         let semaphore = async_lock::Semaphore::new(permits);
   |                         ^^^^^^^^^^ use of undeclared crate or module `async_lock`

error[E0433]: failed to resolve: could not find `AsyncBufReadExt` in `futures_util`
   --> /home/sumit/.cargo/registry/src/index.crates.io-6f17d22bba15001f/zbus-4.4.0/src/abstractions/file.rs:30:36
    |
30  |                 .map(futures_util::AsyncBufReadExt::lines)
    |                                    ^^^^^^^^^^^^^^^ could not find `AsyncBufReadExt` in `futures_util`
    |
note: found an item that was configured out
   --> /home/sumit/.cargo/registry/src/index.crates.io-6f17d22bba15001f/futures-util-0.3.30/src/lib.rs:325:19
    |
325 |     AsyncBufRead, AsyncBufReadExt, AsyncRead, AsyncReadExt, AsyncSeek, AsyncSeekExt, AsyncWrite,
    |                   ^^^^^^^^^^^^^^^
    = note: the item is gated behind the `io` feature

error[E0433]: failed to resolve: could not find `io` in `futures_util`
   --> /home/sumit/.cargo/registry/src/index.crates.io-6f17d22bba15001f/zbus-4.4.0/src/abstractions/file.rs:18:36
    |
18  | pub struct FileLines(futures_util::io::Lines<futures_util::io::BufReader<async_fs::File>>);
    |                                    ^^ could not find `io` in `futures_util`
    |
note: found an item that was configured out
   --> /home/sumit/.cargo/registry/src/index.crates.io-6f17d22bba15001f/futures-util-0.3.30/src/lib.rs:320:9
    |
320 | pub mod io;
    |         ^^
    = note: the item is gated behind the `io` feature
help: consider importing this module
    |
5   + use std::io;
    |
help: if you import `io`, refer to it directly
    |
18  - pub struct FileLines(futures_util::io::Lines<futures_util::io::BufReader<async_fs::File>>);
18  + pub struct FileLines(io::Lines<futures_util::io::BufReader<async_fs::File>>);
    |

error[E0433]: failed to resolve: could not find `io` in `futures_util`
   --> /home/sumit/.cargo/registry/src/index.crates.io-6f17d22bba15001f/zbus-4.4.0/src/abstractions/file.rs:18:60
    |
18  | pub struct FileLines(futures_util::io::Lines<futures_util::io::BufReader<async_fs::File>>);
    |                                                            ^^ could not find `io` in `futures_util`
    |
note: found an item that was configured out
   --> /home/sumit/.cargo/registry/src/index.crates.io-6f17d22bba15001f/futures-util-0.3.30/src/lib.rs:320:9
    |
320 | pub mod io;
    |         ^^
    = note: the item is gated behind the `io` feature
help: consider importing this module
    |
5   + use std::io;
    |
help: if you import `io`, refer to it directly
    |
18  - pub struct FileLines(futures_util::io::Lines<futures_util::io::BufReader<async_fs::File>>);
18  + pub struct FileLines(futures_util::io::Lines<io::BufReader<async_fs::File>>);
    |

error[E0433]: failed to resolve: use of undeclared crate or module `async_fs`
  --> /home/sumit/.cargo/registry/src/index.crates.io-6f17d22bba15001f/zbus-4.4.0/src/abstractions/file.rs:27:13
   |
27 |             async_fs::File::open(path)
   |             ^^^^^^^^ use of undeclared crate or module `async_fs`
   |
help: consider importing this struct
   |
5  + use std::fs::File;
   |
help: if you import `File`, refer to it directly
   |
27 -             async_fs::File::open(path)
27 +             File::open(path)
   |

error[E0433]: failed to resolve: could not find `io` in `futures_util`
   --> /home/sumit/.cargo/registry/src/index.crates.io-6f17d22bba15001f/zbus-4.4.0/src/abstractions/file.rs:29:36
    |
29  |                 .map(futures_util::io::BufReader::new)
    |                                    ^^ could not find `io` in `futures_util`
    |
note: found an item that was configured out
   --> /home/sumit/.cargo/registry/src/index.crates.io-6f17d22bba15001f/futures-util-0.3.30/src/lib.rs:320:9
    |
320 | pub mod io;
    |         ^^
    = note: the item is gated behind the `io` feature
help: consider importing this struct
    |
5   + use std::io::BufReader;
    |
help: if you import `BufReader`, refer to it directly
    |
29  -                 .map(futures_util::io::BufReader::new)
29  +                 .map(BufReader::new)
    |

error[E0282]: type annotations needed
    --> /home/sumit/.cargo/registry/src/index.crates.io-6f17d22bba15001f/zbus-4.4.0/src/connection/mod.rs:1047:49
     |
1047 |                         .add_match_rule(e.key().inner().clone())
     |                                                 ^^^^^ cannot infer type for type parameter `K` declared on the enum `Entry`

error[E0282]: type annotations needed for `&mut (_, _)`
    --> /home/sumit/.cargo/registry/src/index.crates.io-6f17d22bba15001f/zbus-4.4.0/src/connection/mod.rs:1060:21
     |
1060 |                 let (num_subscriptions, receiver) = e.get_mut();
     |                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
...
1063 |                     if max_queued > receiver.capacity() {
     |                                              -------- type must be known at this point
     |
help: consider giving this pattern a type, where the placeholders `_` are specified
     |
1060 |                 let (num_subscriptions, receiver): &mut (_, _) = e.get_mut();
     |                                                  +++++++++++++

error[E0282]: type annotations needed
    --> /home/sumit/.cargo/registry/src/index.crates.io-6f17d22bba15001f/zbus-4.4.0/src/connection/mod.rs:1082:36
     |
1082 |                 let rule = e.key().inner().clone();
     |                                    ^^^^^ cannot infer type for type parameter `K` declared on the enum `Entry`

error[E0599]: the method `next` exists for struct `Enumerate<FileLines>`, but its trait bounds were not satisfied
  --> /home/sumit/.cargo/registry/src/index.crates.io-6f17d22bba15001f/zbus-4.4.0/src/connection/handshake/cookies.rs:54:43
   |
54 |           while let Some((n, line)) = lines.next().await {
   |                                             ^^^^ method cannot be called on `Enumerate<FileLines>` due to unsatisfied trait bounds
   |
  ::: /home/sumit/.cargo/registry/src/index.crates.io-6f17d22bba15001f/futures-util-0.3.30/src/stream/stream/enumerate.rs:9:1
   |
9  | / pin_project! {
10 | |     /// Stream for the [`enumerate`](super::StreamExt::enumerate) method.
11 | |     #[derive(Debug)]
12 | |     #[must_use = "streams do nothing unless polled"]
...  |
17 | |     }
18 | | }
   | |_- doesn't satisfy `_: StreamExt` or `_: Stream`
   |
   = note: the following trait bounds were not satisfied:
           `futures_util::stream::Enumerate<FileLines>: futures_core::Stream`
           which is required by `futures_util::stream::Enumerate<FileLines>: StreamExt`

error[E0433]: failed to resolve: use of undeclared crate or module `async_fs`
  --> /home/sumit/.cargo/registry/src/index.crates.io-6f17d22bba15001f/zbus-4.4.0/src/abstractions/file.rs:73:9
   |
73 |         async_fs::metadata(path).await
   |         ^^^^^^^^ use of undeclared crate or module `async_fs`

error[E0599]: the method `get_or_init` exists for struct `OnceLock<ObjectServer>`, but its trait bounds were not satisfied
   --> /home/sumit/.cargo/registry/src/index.crates.io-6f17d22bba15001f/zbus-4.4.0/src/connection/mod.rs:917:14
    |
915 | /         self.inner
916 | |             .object_server
917 | |             .get_or_init(move || self.setup_object_server(start, started_event))
    | |             -^^^^^^^^^^^ method cannot be called on `OnceLock<ObjectServer>` due to unsatisfied trait bounds
    | |_____________|
    |
    |
   ::: /home/sumit/.cargo/registry/src/index.crates.io-6f17d22bba15001f/zbus-4.4.0/src/blocking/object_server.rs:126:1
    |
126 |   pub struct ObjectServer {
    |   ----------------------- doesn't satisfy `blocking::object_server::ObjectServer: Sized`
    |
    = note: the following trait bounds were not satisfied:
            `{type error}: Sized`
            which is required by `blocking::object_server::ObjectServer: Sized`

error[E0433]: failed to resolve: use of undeclared crate or module `blocking`
   --> /home/sumit/.cargo/registry/src/index.crates.io-6f17d22bba15001f/zbus-4.4.0/src/abstractions/executor.rs:172:23
    |
172 |             Self(Some(blocking::unblock(f)))
    |                       ^^^^^^^^ use of undeclared crate or module `blocking`

error[E0433]: failed to resolve: use of undeclared crate or module `async_io`
  --> /home/sumit/.cargo/registry/src/index.crates.io-6f17d22bba15001f/zbus-4.4.0/src/utils.rs:34:5
   |
34 |     async_io::block_on(future)
   |     ^^^^^^^^ use of undeclared crate or module `async_io`

error[E0433]: failed to resolve: use of undeclared crate or module `async_fs`
  --> /home/sumit/.cargo/registry/src/index.crates.io-6f17d22bba15001f/zbus-4.4.0/src/abstractions/file.rs:18:74
   |
18 | pub struct FileLines(futures_util::io::Lines<futures_util::io::BufReader<async_fs::File>>);
   |                                                                          ^^^^^^^^ use of undeclared crate or module `async_fs`

error[E0433]: failed to resolve: use of undeclared crate or module `async_lock`
 --> /home/sumit/.cargo/registry/src/index.crates.io-6f17d22bba15001f/zbus-4.4.0/src/abstractions/async_lock.rs:8:29
  |
8 | pub(crate) struct Semaphore(async_lock::Semaphore);
  |                             ^^^^^^^^^^ use of undeclared crate or module `async_lock`

error[E0433]: failed to resolve: use of undeclared crate or module `async_lock`
  --> /home/sumit/.cargo/registry/src/index.crates.io-6f17d22bba15001f/zbus-4.4.0/src/abstractions/async_lock.rs:36:39
   |
36 | pub(crate) type SemaphorePermit<'a> = async_lock::SemaphoreGuard<'a>;
   |                                       ^^^^^^^^^^ use of undeclared crate or module `async_lock`

Some errors have detailed explanations: E0282, E0432, E0433, E0599.
For more information about an error, try `rustc --explain E0282`.
error: could not compile `zbus` (lib) due to 29 previous errors
liff commented 1 week ago

You must explicitly choose a feature corresponding to the runtime and crypto backend. See README.

complexspaces commented 1 week ago

I missed the notification for this one when it was opened, sorry. @liff if correct, you need to select a feature flag. This is called out just slightly above the example code so I'm going to close this because there's no action to take. If someone has an idea on how to make it clearer in the README and documentation I'd review a PR.