-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
windows 7 build failed #102
Comments
安装openssl并指定了OPENSSL_DIR=C:\OpenSSL-Win64后openssl的问题解决,但是libsodium-ffi编译不过。 --- stderr You must have Powershell v4.0 or greater installed. ', C:\Users\xxx.cargo\registry\src\github.com-1ecc6299db9ec823\libsodium-ffi-0.1.11\build.rs:70:9 貌似是卡在Powershell版本不对,我用的是msys2,切换到win7的ps上依然提示这个错误。 |
手动下载libsodium-1.06-msvc libsodium-ffi可以编译通过,但是最后link出现错误: 用 |
是这个问题,文件名没有按Windows的来。 |
看了你的appveyor,没感觉有什么不同。 |
在win7上安装ps5.1就可以了,看来指定SODIUM_LIB_DIR不work。 |
在mingw64下也可以编译通过 |
确实比较复杂了……我手边没有Windows机器无法Debug... |
如果有能总结出来的经验能整理一下吗?我更新到Readme里 |
我稍微总结一下吧,因为我用的是win7,可能在win10系统中不会出现类似的问题。 msvc abi编译环境:vs 2015+powershell 5.1+openssl 1.1.0h
gnu abi编译环境:msys2+mingw-w64-x86_64-gcc+mingw-w64-x86_64-pkg-config
冏,最后发现其实是我的msys2没有升级到最新的版本,msys2的gcc和pkg-config版本都太低了。 |
* Add #102 link in README * Migrating to tokio, #100 * Migrated to tokio-signal v0.2, reformatted * Should not call tokio::spawn before tokio::run * Build nightly and stable with different image tag * Removed unnecessary rustup install * Renamed version to v1.7.0-alpha * Removed deprecated calls of Buf * Updated dependencies * [#106] Fixed bug, should not hold UDP connections forever * Lower info log to debug * Bump version to v1.7.0-alpha.2 * Implement a simple DNS relay server, bump version to v1.7.0-alpha.3 * Better logging * Fixed build on travis * Add elapsed time in log * Should not exit if handler return error * reformatted * Add test for DNS * Updated ssdns param * Use `trust-dns` and impl Trait 1. Replaced `ToSocketAddrs` with `trust-dns` 2. Uses impl Trait for functions 3. Updated dependencies 4. Fixed bugs * Bug fixed, logging crate in ssdns
It seems that OpenSSL cannot be statically linked even if |
@DeepAQ You should download openssl and install in a location such as C:\\OpenSSL-Win64 and compile with openssl statically like this: OPENSSL_LIB_DIR=C:\\OpenSSL-Win64\lib\\VC\\static OPENSSL_LIBS=libcrypto64MT:libssl64MT OPENSSL_INCLUDE_DIR=C:\\OpenSSL-Win64\\include OPENSSL_STATIC=yes SODIUM_BUILD_STATIC=yes cargo build --release |
It works. Thanks! |
改天写个帖子,windows上面用vcpkg辅助编译非常的方便。 |
@bigtan 能大致说一下Windows下的编译过程吗? |
用MSVC编译不了,找不到llvm-config和clang lib。 error: failed to run custom build command for cargo:warning=couldn't execute --- stderr |
这个找不到
要装一个
考虑直接用Docker编一个:https://github.com/shadowsocks/shadowsocks-rust/blob/master/build/Dockerfile.x86_64-pc-windows-gnu ,我用笔记本编译的时候应该是爆内存了没编出来,今晚有空我编一个出来放在Release里 |
用cargo build --no-default-features --features "trust-dns aes-cfb"编过去了。 昨天折腾这个sodium搞了几个小时,连clang/llvm都从源码编译了一遍也没搞定。 |
不同的Windows方法都不太一样,还可以用 |
"官方"可以给出一个标准windows环境下的编译步骤,比如win10 x64 + MSVC 2019 + vcpkg这种具体的环境。 至于其它环境下,让编译者自己搞定。 |
我试了一下,gnu和msvc都是可以编译的。 gnu的话用mingw: msvc用cmd:
保存到shadowsocks-rust文件夹,双击就开始编译了。 |
libsodium-ffi改成了libsodium-sys,那"SODIUM_BUILD_STATIC=yes"应该没什么用了吧? |
是的,默认会自己去尝试Build |
#163 |
因为没有办法用 Docker 编出来 msvc ABI 的 Binary。 应该差别不大,差别比较大的是 cygwin 。 |
Powershell script for compiling on Windows with MSVC ABI (tested on circle-ci). # Check compile target, 32bits or 64bits
# This requires `rustc` in `$PATH`
$TargetTriple = (rustc -Vv | Select-String -Pattern "host: (.*)" | foreach {$_.Matches.Value}).split()[-1]
if ($TargetTriple.StartsWith("x86_64-")) {
$OpenSSLBits = "64"
} else {
$OpenSSLBits = "32"
}
$OpenSSLVersion = "1_1_1d"
$OpenSSLFileName = "Win${OpenSSLBits}OpenSSL-${OpenSSLVersion}.exe"
# Download OpenSSL release package to the current directory
$ProgressPreference = "SilentlyContinue"
Invoke-WebRequest -Uri "http://slproweb.com/download/${OpenSSLFileName}" -OutFile "${OpenSSLFileName}"
# Install it to C:\OpenSSL
Start-Process "${OpenSSLFileName}" -ArgumentList "/SILENT /VERYSILENT /SP- /SUPPRESSMSGBOXES /DIR=C:\OpenSSL" -Wait
# Build shadowsocks-rust's release
cargo build --release Prebuilt binaries could be found in: https://circleci.com/gh/shadowsocks/shadowsocks-rust/tree/master |
我的可以正常编译了,通过cargo可以编译,但是在Shadowsocks-android目录下,通过 gradle就编译不了。 |
我也是 |
I think it is because shadowsocks-android uses stable Rust by default. |
Any ideas? |
toolchain: nightly-x86_64-pc-windows-msvc (default)
rustc 1.27.0-nightly (7360d6dd6 2018-04-15)
cargo build --release
.....
error: failed to run custom build command for
openssl-sys v0.9.28
process didn't exit successfully:
C:\Users\xxx\Documents\vscode\shadowsocks-rust\target\release\build\openssl-sys-58fb47c380c62ab0\build-script-build
(exit code: 101)--- stdout
cargo:rerun-if-env-changed=X86_64_PC_WINDOWS_MSVC_OPENSSL_LIB_DIR
cargo:rerun-if-env-changed=OPENSSL_LIB_DIR
cargo:rerun-if-env-changed=X86_64_PC_WINDOWS_MSVC_OPENSSL_INCLUDE_DIR
cargo:rerun-if-env-changed=OPENSSL_INCLUDE_DIR
cargo:rerun-if-env-changed=X86_64_PC_WINDOWS_MSVC_OPENSSL_DIR
cargo:rerun-if-env-changed=OPENSSL_DIR
note: vcpkg did not find openssl as libcrypto and libssl : VcpkgNotFound("No vcpkg.user.targets found. Set the VCPKG_ROOT environment variable or run 'vcpkg integrate install'")
note: vcpkg did not find openssl as ssleay32 and libeay32: VcpkgNotFound("No vcpkg.user.targets found. Set the VCPKG_ROOT environment variable or run 'vcpkg integrate install'")
--- stderr
thread 'main' panicked at '
Could not find directory of OpenSSL installation, and this
-sys
crate cannotproceed without this knowledge. If OpenSSL is installed and this crate had
trouble finding it, you can set the
OPENSSL_DIR
environment variable for thecompilation process.
If you're in a situation where you think the directory should be found
automatically, please open a bug at https://github.com/sfackler/rust-openssl
and include information about your system as well as this message.
It looks like you're compiling for MSVC but we couldn't detect an OpenSSL
installation. If there isn't one installed then you can try the rust-openssl
README for more information about how to download precompiled binaries of
OpenSSL:
', C:\Users\xxx.cargo\registry\src\github.com-1ecc6299db9ec823\openssl-sys-0.9.28\build.rs:213:5
note: Run with
RUST_BACKTRACE=1
for a backtrace.warning: build failed, waiting for other jobs to finish...
error: build failed
The text was updated successfully, but these errors were encountered: