veeso / suppaftp

a super FTP/FTPS client library for Rust with support for both passive and active mode
Apache License 2.0
121 stars 31 forks source link

[BUG] - break change of version 6.0.2 #92

Closed lichuang closed 1 month ago

lichuang commented 1 month ago

Description

version 6.0.2 make opendal 0.50.0 compile error in x86 Linux

Steps to reproduce

build opendal 0.50.0

Expected behaviour

A clear and concise description of what you expected to happen.

Environment

Additional information

   Compiling opendal v0.50.0
error: future cannot be sent between threads safely
  --> /home/runner/.cargo/registry/src/index.crates.io-6f17d22bba15001f/opendal-0.50.0/src/services/ftp/reader.rs:70:5
   |
70 |     async fn read(&mut self) -> Result<Buffer> {
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ future returned by `read` is not `Send`
   |
   = note: the full name for the type has been written to '/home/runner/work/replited/replited/target/debug/deps/opendal-bcf057312377afcb.long-type-15670337144888252149.txt'
   = note: consider using `--verbose` to print the full type name to the console
   = help: the trait `std::marker::Send` is not implemented for `dyn Fn(SocketAddr) -> Pin<Box<dyn Future<Output = Result<TcpStream, FtpError>> + Send>>`, which is required by `impl futures::Future<Output = std::result::Result<buffer::Buffer, types::error::Error>>: futures_util::MaybeSend`
note: future is not `Send` as this value is used across an await

see: https://github.com/lichuang/replited/actions/runs/11338008054/job/31530524221

veeso commented 1 month ago

Thanks for reporting. The issue should have been fixed here e12fa005 I'm going to release a 6.0.3 and yank 6.0.2.

I've added unit tests to guarantee the FtpStream satisfy Send