eric9n / Kun-peng

Kun-peng: an ultra-fast, low-memory footprint and accurate taxonomy classifier for all
MIT License
12 stars 3 forks source link

macOS compiling error #27

Closed jianshu93 closed 2 months ago

jianshu93 commented 2 months ago

hi @eric9n,

I have no problems on Linux but I always have this compiling error on MacOS (Rust stable channel, 1.80.1) for the most recent commit:

error[E0284]: type annotations needed --> /Users/jianshuzhao/.cargo/registry/src/index.crates.io-6f17d22bba15001f/reqwest-middleware-0.3.3/src/client.rs:284:24 284 self.inner.poll_ready(cx).map_err(crate::Error::Reqwest) ^^^^^^^^^^
= note: cannot satisfy `<Client as Service<_>>::Error == reqwest::Error`

help: try using a fully qualified path to specify the expected types | 284 | <Client as Service>::poll_ready(&mut self.inner, cx).map_err(crate::Error::Reqwest) | +++++++++++++++++++++++++++++++++++++++++++++ ~

error[E0283]: type annotations needed --> /Users/jianshuzhao/.cargo/registry/src/index.crates.io-6f17d22bba15001f/reqwest-middleware-0.3.3/src/client.rs:284:24 284 self.inner.poll_ready(cx).map_err(crate::Error::Reqwest) ^^^^^^^^^^
= note: multiple `impl`s satisfying `Client: Service<_>` found in the `reqwest` crate:
        - impl Service<http::Request<Body>> for Client;
        - impl Service<reqwest::Request> for Client;

help: try using a fully qualified path to specify the expected types | 284 | <Client as Service>::poll_ready(&mut self.inner, cx).map_err(crate::Error::Reqwest) | +++++++++++++++++++++++++++++++++++++++++++++ ~

error[E0284]: type annotations needed --> /Users/jianshuzhao/.cargo/registry/src/index.crates.io-6f17d22bba15001f/reqwest-middleware-0.3.3/src/client.rs:306:27 306 (&self.inner).poll_ready(cx).map_err(crate::Error::Reqwest) ^^^^^^^^^^
= note: cannot satisfy `<&Client as Service<_>>::Error == reqwest::Error`

help: try using a fully qualified path to specify the expected types | 306 | <&Client as Service>::poll_ready(&mut (&self.inner), cx).map_err(crate::Error::Reqwest) | ++++++++++++++++++++++++++++++++++++++++++++++ ~

error[E0283]: type annotations needed --> /Users/jianshuzhao/.cargo/registry/src/index.crates.io-6f17d22bba15001f/reqwest-middleware-0.3.3/src/client.rs:306:27 306 (&self.inner).poll_ready(cx).map_err(crate::Error::Reqwest) ^^^^^^^^^^
= note: multiple `impl`s satisfying `&Client: Service<_>` found in the `reqwest` crate:
        - impl Service<http::Request<Body>> for &Client;
        - impl Service<reqwest::Request> for &Client;

help: try using a fully qualified path to specify the expected types | 306 | <&Client as Service>::poll_ready(&mut (&self.inner), cx).map_err(crate::Error::Reqwest) | ++++++++++++++++++++++++++++++++++++++++++++++ ~

Some errors have detailed explanations: E0283, E0284. For more information about an error, try rustc --explain E0283. error: could not compile reqwest-middleware (lib) due to 4 previous errors warning: build failed, waiting for other jobs to finish...

Is that because the reqwest-middleware does not support MacOS? You can try to use cross compiling for aarch64-apple-darwin target

Thanks,

Jianshu

eric9n commented 2 months ago

Can you directly download the binary package I placed in the release and run it?

eric9n commented 2 months ago

I'll update Rust to version 1.80.1 and give it a try

eric9n commented 2 months ago
cargo build --target aarch64-apple-darwin
ls -alh target/aarch64-apple-darwin/debug/ncbi_dl
-rwxr-xr-x  1 eric  staff    21M  8 21 09:43 target/aarch64-apple-darwin/debug/ncbi_dl

rustc --version
rustc 1.80.1 (3f5fd8dd4 2024-08-06)
jianshu93 commented 2 months ago

emm.strange. I will try again.

eric9n commented 2 months ago

cargo clean

jianshu93 commented 2 months ago

There must be something wrong with my Rust environment. Succeeded after completely install everything.

Thanks,

Jianshu

jianshu93 commented 2 months ago

It turns out it does happen:

https://github.com/TrueLayer/reqwest-middleware/issues/185

Check this link.

Updating to the newest version works for me. Please let me know if you can do it or I can do it.

Thanks,

Jiasnhu

eric9n commented 2 months ago

This library mentions potential issues with version 0.12.6. How is this related to version 0.12.4?