Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Let unix_socket example compile but not run on Windows #849

Merged
merged 4 commits into from
May 12, 2021
Merged

Let unix_socket example compile but not run on Windows #849

merged 4 commits into from
May 12, 2021

Conversation

Aankhen
Copy link
Contributor

@Aankhen Aankhen commented May 10, 2021

It wasn’t possible to run the tests on Windows without this change, as the examples have to be compiled too:

> cargo test -- form_fields
   Compiling warp v0.3.1 (D:\Media\src\warp)
error[E0432]: unresolved import `tokio::net::UnixListener`
 --> examples\unix_socket.rs:3:5
  |
3 | use tokio::net::UnixListener;
  |     ^^^^^^^^^^^^------------
  |     |           |
  |     |           help: a similar name exists in the module: `TcpListener`
  |     no `UnixListener` in `net`

error[E0432]: unresolved import `tokio_stream::wrappers::UnixListenerStream`
 --> examples\unix_socket.rs:4:5
  |
4 | use tokio_stream::wrappers::UnixListenerStream;
  |     ^^^^^^^^^^^^^^^^^^^^^^^^------------------
  |     |                       |
  |     |                       help: a similar name exists in the module: `TcpListenerStream`
  |     no `UnixListenerStream` in `wrappers`

error: aborting due to 2 previous errors

For more information about this error, try `rustc --explain E0432`.
error: could not compile `warp`

To learn more, run the command again with --verbose.
warning: build failed, waiting for other jobs to finish...
error: build failed

With this change:

> cargo test -- form_fields
   Compiling warp v0.3.1 (D:\Media\src\warp)
    Finished test [unoptimized + debuginfo] target(s) in 42.24s
     Running unittests (target\debug\deps\warp-9e6997018269ce07.exe)
(test output elided)

I made it so the example panics on Windows, and I used Docker to verify I’m still able to make requests over the socket on Linux as well.

examples/unix_socket.rs Outdated Show resolved Hide resolved
examples/unix_socket.rs Outdated Show resolved Hide resolved
@jxs jxs merged commit 6711e65 into seanmonstar:master May 12, 2021
@jxs
Copy link
Collaborator

jxs commented May 12, 2021

thanks! 💯

@Aankhen Aankhen deleted the let-unix-socket-example-compile-on-windows branch May 12, 2021 11:44
@Aankhen
Copy link
Contributor Author

Aankhen commented May 12, 2021

Thanks for the merge (and the tweaks)!

jxs pushed a commit to jxs/warp that referenced this pull request Jun 27, 2021
…#849)

* Let `unix_socket` example compile but not run on Windows
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants