shadowsocks-rust: shadowsocks (lib): compilation error on OpenBSD

Hello,

First of all, thank you for all the hard work you’ve put into this project; it’s been great exploring what it has to offer.

I wanted to report an issue I encountered while trying to compile the project on OpenBSD. Unfortunately, I couldn’t get it to build successfully. If there are any specific logs or additional details you’d like me to provide, please let me know, and I’d be happy to share them to help troubleshoot the issue.

   Compiling shadowsocks v1.23.0 (/mnt/rust/shadowsocks-rust/crates/shadowsocks)
error: expected one of `,`, `::`, `as`, or `}`, found `net`
 --> crates/shadowsocks/src/net/sys/unix/bsd/../others.rs:3:5
  |
2 |     io,io::ErrorKind
  |                     -
  |                     |
  |                     expected one of `,`, `::`, `as`, or `}`
  |                     help: missing `,`
3 |     net::{IpAddr, Ipv4Addr, Ipv6Addr, SocketAddr},
  |     ^^^ unexpected token

   Compiling dirs-sys v0.5.0
error[E0252]: the name `ErrorKind` is defined multiple times
  --> crates/shadowsocks/src/net/sys/unix/bsd/../others.rs:18:11
   |
2  |     io,io::ErrorKind
   |        ------------- previous import of the type `ErrorKind` here
...
18 |     sys::{ErrorKind, set_common_sockopt_after_connect, set_common_sockopt_for_connect, io::Error},
   |           ^^^^^^^^^--
   |           |
   |           `ErrorKind` reimported here
   |           help: remove unnecessary import
   |
   = note: `ErrorKind` must be defined only once in the type namespace of this module

warning: unused import: `ErrorKind`
  --> crates/shadowsocks/src/net/sys/unix/bsd/../others.rs:18:11
   |
18 |     sys::{ErrorKind, set_common_sockopt_after_connect, set_common_sockopt_for_connect, io::Error},
   |           ^^^^^^^^^
   |
   = note: `#[warn(unused_imports)]` on by default

For more information about this error, try `rustc --explain E0252`.
warning: `shadowsocks` (lib) generated 1 warning
error: could not compile `shadowsocks` (lib) due to 2 previous errors; 1 warning emitted
warning: build failed, waiting for other jobs to finish..

Environment information:

  • commit 5f7556ab510f2104c119f9f4f76ed85f83cc1e4f
  • OpenBSD 7.7 amd64
  • rustc 1.85.0
  • cargo 1.85.0

Additionally, I was wondering if there’s any plan to provide pre-compiled versions for BSD systems in the near future. I believe it could make the project more accessible to BSD users like myself.

Thanks again for your time and effort, and I appreciate any guidance you can offer regarding these points!

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Comments: 23

Commits related to this issue

Most upvoted comments

BTW, you may have to add --release to build with release profile. Build with dev profile will have no performance optimization.

https://github.com/shadowsocks/shadowsocks-rust/blob/master/Cargo.toml#L58

It removes this default feature, which is also full.

Actually you could build with --features "basic", which contains only basic socks5 support of shadowsocks.

local-tunnel is to open a shadowsocks tunnel to bypass all traffics to a specific destination. local-tun is to open a tun device.

What did you see when building without --no-default-features with the latest commit?

Try the lastest commit, you may not need to use --no-default-features

It was fixed in the lastest commit.

Well, tun doesn’t support OpenBSD yet, so you shouldn’t enable local-tun currently.