shadowsocks / shadowsocks-rust

A Rust port of shadowsocks
https://shadowsocks.org/
MIT License
8.59k stars 1.17k forks source link

Failed to install. #36

Closed simonsmh closed 7 years ago

simonsmh commented 7 years ago
error: failed to compile `shadowsocks-rust v1.0.1`, intermediate artifacts can be found at `/tmp/cargo-install.9m8HtpLBFnGM`

Caused by:
  failed to run custom build command for `openssl-sys-extras v0.7.14`
process didn't exit successfully: `/tmp/cargo-install.9m8HtpLBFnGM/release/build/openssl-sys-extras-5c7e4d8925825f00/build-script-build` (exit code: 101)
--- stdout
TARGET = Some("x86_64-unknown-linux-gnu")
OPT_LEVEL = Some("3")
PROFILE = Some("release")
TARGET = Some("x86_64-unknown-linux-gnu")
debug=false opt-level=3
HOST = Some("x86_64-unknown-linux-gnu")
TARGET = Some("x86_64-unknown-linux-gnu")
TARGET = Some("x86_64-unknown-linux-gnu")
HOST = Some("x86_64-unknown-linux-gnu")
CC_x86_64-unknown-linux-gnu = None
CC_x86_64_unknown_linux_gnu = None
HOST_CC = None
CC = None
HOST = Some("x86_64-unknown-linux-gnu")
TARGET = Some("x86_64-unknown-linux-gnu")
HOST = Some("x86_64-unknown-linux-gnu")
CFLAGS_x86_64-unknown-linux-gnu = None
CFLAGS_x86_64_unknown_linux_gnu = None
HOST_CFLAGS = None
CFLAGS = None
running: "cc" "-O3" "-ffunction-sections" "-fdata-sections" "-m64" "-fPIC" "-o" "/tmp/cargo-install.9m8HtpLBFnGM/release/build/openssl-sys-extras-5c7e4d8925825f00/out/src/openssl_shim.o" "-c" "src/openssl_shim.c"
cargo:warning=src/openssl_shim.c: In function ‘DH_new_from_params’:
cargo:warning=src/openssl_shim.c:132:7: error: dereferencing pointer to incomplete type ‘DH {aka struct dh_st}’
cargo:warning=     dh->p = p;
cargo:warning=       ^~
cargo:warning=src/openssl_shim.c: In function ‘X509_get_extensions_shim’:
cargo:warning=src/openssl_shim.c:143:13: error: dereferencing pointer to incomplete type ‘X509 {aka struct x509_st}’
cargo:warning=     return x->cert_info ? x->cert_info->extensions : NULL;
cargo:warning=             ^~
ExitStatus(ExitStatus(256))

command did not execute successfully, got: exit code: 1

--- stderr
thread 'main' panicked at 'explicit panic', .cargo/registry/src/github.com-1ecc6299db9ec823/gcc-0.3.41/src/lib.rs:1018
note: Run with `RUST_BACKTRACE=1` for a backtrace.

BTW I set up the rust/cargo environment by apt.

zonyitoo commented 7 years ago

It seems that openssl failed to compile in your environment.

Please try to compile this crate in your environment: https://github.com/sfackler/rust-openssl

tianjiaoding commented 7 years ago

I also encountered this problem. When I tried installing openssl, the response tells me that it has already been installed. However, pkg-config failed to resolve openssl.pc. After installing package libssl-dev, the package compiles successfully. And when I type pkg-config --libs --cflags openssl again, it returns the cflags correctly.

zonyitoo commented 7 years ago

Can you compile the rust-openssl crate?

tianjiaoding commented 7 years ago

Yes I can, by installing first libssl-dev package.

zonyitoo commented 7 years ago

Can you compile shadowsocks-rust now? Can you provide the full version of error logs? How can I reproduce it?

simonsmh commented 7 years ago
Compiling shadowsocks-rust v1.3.0 (file:///root/shadowsocks-rust)
     Running `rustc src/lib.rs --crate-name shadowsocks --crate-type lib -g -C metadata=2fc07067b8de6c6d -C extra-filename=-2fc07067b8de6c6d --out-dir /root/shadowsocks-rust/target/debug/deps --emit=dep-info,link -L dependency=/root/shadowsocks-rust/target/debug/deps --extern env_logger=/root/shadowsocks-rust/target/debug/deps/libenv_logger-b5cbb3261a7cf0b9.rlib --extern net2=/root/shadowsocks-rust/target/debug/deps/libnet2-b6b6880cb3760238.rlib --extern time=/root/shadowsocks-rust/target/debug/deps/libtime-7aab5f3d0922a9c7.rlib --extern tokio_core=/root/shadowsocks-rust/target/debug/deps/libtokio_core-0e3b140a238a4fac.rlib --extern rand=/root/shadowsocks-rust/target/debug/deps/librand-35167bebb3b301e7.rlib --extern serde_json=/root/shadowsocks-rust/target/debug/deps/libserde_json-495865e2a32427b9.rlib --extern num_cpus=/root/shadowsocks-rust/target/debug/deps/libnum_cpus-ab660b52aabdf27e.rlib --extern clap=/root/shadowsocks-rust/target/debug/deps/libclap-3dd1816abdd6d05f.rlib --extern log=/root/shadowsocks-rust/target/debug/deps/liblog-3f5cdedd18fc1617.rlib --extern lru_cache=/root/shadowsocks-rust/target/debug/deps/liblru_cache-c88a2240722514d9.rlib --extern tokio_io=/root/shadowsocks-rust/target/debug/deps/libtokio_io-4c864bc373e642f9.rlib --extern futures=/root/shadowsocks-rust/target/debug/deps/libfutures-869f64ff8eedaf94.rlib --extern openssl=/root/shadowsocks-rust/target/debug/deps/libopenssl-6efc5177c7886417.rlib --extern libc=/root/shadowsocks-rust/target/debug/deps/liblibc-b2b114c5e6d5dfb5.rlib --extern bytes=/root/shadowsocks-rust/target/debug/deps/libbytes-e331f03e535ffb30.rlib --extern crypto=/root/shadowsocks-rust/target/debug/deps/libcrypto-0c6fe23f715e724b.rlib --extern lazy_static=/root/shadowsocks-rust/target/debug/deps/liblazy_static-6f95aedc50e46c4f.rlib --extern base64=/root/shadowsocks-rust/target/debug/deps/libbase64-842526b6c0d7016e.rlib --extern qrcode=/root/shadowsocks-rust/target/debug/deps/libqrcode-19223e4abbbc3aaf.rlib --extern domain=/root/shadowsocks-rust/target/debug/deps/libdomain-c5c968620668b77d.rlib --extern byteorder=/root/shadowsocks-rust/target/debug/deps/libbyteorder-77f0324d9153219f.rlib -L native=/root/shadowsocks-rust/target/debug/build/rust-crypto-ed6f35bcd4283630/out`
error[E0252]: a value named `SOCKS5_AUTH_METHOD_NONE` has already been imported in this module
  --> src/relay/socks5.rs:27:5
   |
25 | pub use self::consts::{SOCKS5_AUTH_METHOD_NONE, SOCKS5_AUTH_METHOD_GSSAPI, SOCKS5_AUTH_METHOD_PASSWORD,
   |                        ----------------------- previous import of `SOCKS5_AUTH_METHOD_NONE` here
26 |                        SOCKS5_AUTH_METHOD_NOT_ACCEPTABLE};
27 | use self::consts::*;
   |     ^^^^^^^^^^^^^^^^ already imported

error[E0252]: a value named `SOCKS5_AUTH_METHOD_PASSWORD` has already been imported in this module
  --> src/relay/socks5.rs:27:5
   |
25 | pub use self::consts::{SOCKS5_AUTH_METHOD_NONE, SOCKS5_AUTH_METHOD_GSSAPI, SOCKS5_AUTH_METHOD_PASSWORD,
   |                                                                            --------------------------- previous import of `SOCKS5_AUTH_METHOD_PASSWORD` here
26 |                        SOCKS5_AUTH_METHOD_NOT_ACCEPTABLE};
27 | use self::consts::*;
   |     ^^^^^^^^^^^^^^^^ already imported

error[E0252]: a value named `SOCKS5_AUTH_METHOD_GSSAPI` has already been imported in this module
  --> src/relay/socks5.rs:27:5
   |
25 | pub use self::consts::{SOCKS5_AUTH_METHOD_NONE, SOCKS5_AUTH_METHOD_GSSAPI, SOCKS5_AUTH_METHOD_PASSWORD,
   |                                                 ------------------------- previous import of `SOCKS5_AUTH_METHOD_GSSAPI` here
26 |                        SOCKS5_AUTH_METHOD_NOT_ACCEPTABLE};
27 | use self::consts::*;
   |     ^^^^^^^^^^^^^^^^ already imported

error[E0252]: a value named `SOCKS5_AUTH_METHOD_NOT_ACCEPTABLE` has already been imported in this module
  --> src/relay/socks5.rs:27:5
   |
26 |                        SOCKS5_AUTH_METHOD_NOT_ACCEPTABLE};
   |                        --------------------------------- previous import of `SOCKS5_AUTH_METHOD_NOT_ACCEPTABLE` here
27 | use self::consts::*;
   |     ^^^^^^^^^^^^^^^^ already imported

error: aborting due to 4 previous errors

error: Could not compile `shadowsocks-rust`.

Caused by:
  process didn't exit successfully: `rustc src/lib.rs --crate-name shadowsocks --crate-type lib -g -C metadata=2fc07067b8de6c6d -C extra-filename=-2fc07067b8de6c6d --out-dir /root/shadowsocks-rust/target/debug/deps --emit=dep-info,link -L dependency=/root/shadowsocks-rust/target/debug/deps --extern env_logger=/root/shadowsocks-rust/target/debug/deps/libenv_logger-b5cbb3261a7cf0b9.rlib --extern net2=/root/shadowsocks-rust/target/debug/deps/libnet2-b6b6880cb3760238.rlib --extern time=/root/shadowsocks-rust/target/debug/deps/libtime-7aab5f3d0922a9c7.rlib --extern tokio_core=/root/shadowsocks-rust/target/debug/deps/libtokio_core-0e3b140a238a4fac.rlib --extern rand=/root/shadowsocks-rust/target/debug/deps/librand-35167bebb3b301e7.rlib --extern serde_json=/root/shadowsocks-rust/target/debug/deps/libserde_json-495865e2a32427b9.rlib --extern num_cpus=/root/shadowsocks-rust/target/debug/deps/libnum_cpus-ab660b52aabdf27e.rlib --extern clap=/root/shadowsocks-rust/target/debug/deps/libclap-3dd1816abdd6d05f.rlib --extern log=/root/shadowsocks-rust/target/debug/deps/liblog-3f5cdedd18fc1617.rlib --extern lru_cache=/root/shadowsocks-rust/target/debug/deps/liblru_cache-c88a2240722514d9.rlib --extern tokio_io=/root/shadowsocks-rust/target/debug/deps/libtokio_io-4c864bc373e642f9.rlib --extern futures=/root/shadowsocks-rust/target/debug/deps/libfutures-869f64ff8eedaf94.rlib --extern openssl=/root/shadowsocks-rust/target/debug/deps/libopenssl-6efc5177c7886417.rlib --extern libc=/root/shadowsocks-rust/target/debug/deps/liblibc-b2b114c5e6d5dfb5.rlib --extern bytes=/root/shadowsocks-rust/target/debug/deps/libbytes-e331f03e535ffb30.rlib --extern crypto=/root/shadowsocks-rust/target/debug/deps/libcrypto-0c6fe23f715e724b.rlib --extern lazy_static=/root/shadowsocks-rust/target/debug/deps/liblazy_static-6f95aedc50e46c4f.rlib --extern base64=/root/shadowsocks-rust/target/debug/deps/libbase64-842526b6c0d7016e.rlib --extern qrcode=/root/shadowsocks-rust/target/debug/deps/libqrcode-19223e4abbbc3aaf.rlib --extern domain=/root/shadowsocks-rust/target/debug/deps/libdomain-c5c968620668b77d.rlib --extern byteorder=/root/shadowsocks-rust/target/debug/deps/libbyteorder-77f0324d9153219f.rlib -L native=/root/shadowsocks-rust/target/debug/build/rust-crypto-ed6f35bcd4283630/out` (exit code: 101)
# root @ simonsmh in ~/shadowsocks-rust on git:master o [9:45:13] C:101
$ 
simonsmh commented 7 years ago

Both openssl and openssl-sys package build properly on my device now.

zonyitoo commented 7 years ago

What is your rustc version? Have you modified anything in this project? Is that from master branch? That should not happen, I can't reproduce it both on my laptop and my VPS.

simonsmh commented 7 years ago

I clone this port without any modification... And I don't think I have anything like rustc cargo version is 0.15

simonsmh commented 7 years ago

rustc 1.14 🤣

zonyitoo commented 7 years ago

Please try to upgrade it to v1.16

zonyitoo commented 7 years ago

Is it fixed already? @simonsmh

simonsmh commented 7 years ago

Uh I haven't test it. It's not in the Debian testing repo.

Y. T. CHUNG notifications@github.com于2017年3月25日周六 22:58写道:

Is it fixed already? @simonsmh https://github.com/simonsmh

— You are receiving this because you were mentioned.

Reply to this email directly, view it on GitHub https://github.com/zonyitoo/shadowsocks-rust/issues/36#issuecomment-289216919, or mute the thread https://github.com/notifications/unsubscribe-auth/AJEkgz7Hp4WAwrODsNmGLoMgmwFwpvguks5rpSuYgaJpZM4LY3K2 .

zonyitoo commented 7 years ago

According to travis' build, it should works fine for the latest version of stable and nightly rust.

Closing now. Reopen if you still have problems after upgraded.

simonsmh commented 7 years ago

😂I cant reopen it haha Anyway thanks for your wonderful work!

Y. T. CHUNG notifications@github.com于2017年3月25日周六 23:04写道:

According to travis' build https://travis-ci.org/zonyitoo/shadowsocks-rust, it should works fine for the latest version of stable and nightly rust.

Closing now. Reopen if you still have problems after upgraded.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/zonyitoo/shadowsocks-rust/issues/36#issuecomment-289217274, or mute the thread https://github.com/notifications/unsubscribe-auth/AJEkgzX_u70ygJnzLfGlN0XrrkpaekL9ks5rpSzwgaJpZM4LY3K2 .

zonyitoo commented 7 years ago

BTW, I have pushed some modifications, which should make it work for old version of rustc. Please try again.

simonsmh commented 7 years ago

Confirmed that it works now. Thx.