testcontainers / testcontainers-rs

A library for integration-testing against docker containers from within Rust.
https://rust.testcontainers.org
Apache License 2.0
705 stars 138 forks source link

Not working on Windows 10 #279

Closed Weasy666 closed 2 years ago

Weasy666 commented 3 years ago

When running the dev-branch on Windows, i get a few errors regarding tokio::net::UnixListener, like this

error[E0432]: unresolved imports `tokio::net::UnixListener`, `tokio::net::UnixStream`
  --> C:\Users\weasy\.cargo\registry\src\github.com-1ecc6299db9ec823\hyperlocal-0.8.0\src\server.rs:17:22
   |
17 |     use tokio::net::{UnixListener, UnixStream};
   |                      ^^^^^^^^^^^^  ^^^^^^^^^^ no `UnixStream` in `net`
   |                      |
   |                      no `UnixListener` in `net`
   |                      help: a similar name exists in the module: `TcpListener`

error[E0433]: failed to resolve: could not find `UnixStream` in `net`

Which makes perfect sense, because the Unix stuff does not work on Windows. As far as u could tell, hyperlocal is a dependency of shiplift and not necessary for the Cli implementation. Could you possibly put shiplift behind a feature flag? That would enable us to compile and use testcontainers with its Cli feature.

thomaseizinger commented 3 years ago

Could you possibly put shiplift behind a feature flag?

The proper fix for this would be upstream: https://github.com/softprops/shiplift/issues/241

As a work-around, we can conditionally set the necessary features on shiplift based on the target platform. I currently don't have time to do this but happy to merge a PR for this if it is important to you that dev works on Windows. Alternatively, I'd recommend to use the latest release.

dzmitry-lahoda commented 3 years ago

On windows docker talks named pipes.