-
Notifications
You must be signed in to change notification settings - Fork 1.3k
windows快速编译[静态链接] #163
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Comments
补充一点,如果你的vcpkg安装在别的目录,那么 |
cargo编译时,有这个错误信息: error: couldn't read D:\shadowsocks-rust\target\release\build\libsodium-ffi-ee34e272ed6bc8e7\out/bindings.rs: 系统找不到指定的文件。 (os error 2) error: aborting due to previous error error: could not compile |
上面还有更多的错误信息么?这里看起来像是 |
就这个信息。我把Rust的rustup、cargo等都全部卸载了重装,把shadowsocks-rust整个目录删了重新clone下来,也是这个错误。 另外,多服务器的负载均衡的处理流程应该是有点问题的,我这里有21个服务器,其中一部分可能连不上,然后通过shadowsocks-rust访问需要翻墙的网站时,就会有较大概率出现好多秒的卡顿。不过这个和编译无关,可以另搞issue。 |
这个就有点申请,Travis上我也有做一个MSVC版本的CI,日常编译并没有问题。看来我要自己弄一台Windows机来试一下。 |
@zonyitoo 真实的报错原因应该是vcpkg的libsodium出来的: |
@zonyitoo |
这一句是因为没有装CLANG,bindgen需要 |
弄了两天时间终于成功用Docker交叉编译出GNU ABI https://github.com/shadowsocks/shadowsocks-rust/releases/tag/v1.8.0-alpha.2 |
谢谢大佬 试用了一下sslocal.exe,一般没啥问题,chrome偶尔会有走代理访问失败网页的情况(我先打开facebook、twitter、文学城的页面预热了一会儿,然后打开了文学城的3个网页,chrome的窗口正中间都报代理有问题,无法访问,chrome左下的状态栏会一直显示正在等待代理隧道的响应。我把这个叫做卡顿。隔了一会再刷新3个页面就又好了。现象跟我用自己编译的只开了aes-cfb这个feature的sslocal.exe是一样的),此时我看了一下sslocal.exe的日志,只有trust dns的那条“failed to associate send_message response to the sender”。 |
可能需要开一下详细的日志,加 |
详细日志我贴在issue #151的最下面了 |
刚升级了rust toolchain,pull下来最新的代码,用楼主的方法编译通过了。不过vcpkg不需要在PATH中。 info: checking for self-updates stable-x86_64-pc-windows-gnu updated - rustc 1.40.0 (73528e339 2019-12-16) D:\shadowsocks-rust>rustup default stable-x86_64-pc-windows-msvc stable-x86_64-pc-windows-msvc unchanged - rustc 1.40.0 (73528e339 2019-12-16) D:\shadowsocks-rust>set RUSTFLAGS=-Ctarget-feature=+crt-static D:\shadowsocks-rust>cargo build --release |
不用 |
是在另外一个DOS窗口中执行的如下命令,跟执行cargo的不是同一个DOS窗口。执行cargo的这个DOS窗口的PATH中没有vcpkg.exe,也不需要在Shadowsocks-Rust的目录下执行下面的命令。我看楼主后来补充的帖子强调了这一点。 vcpkg install openssl:x64-windows-static |
2020.3.23 使用 stable-x86_64-pc-windows-msvc (default) rustc 1.42.0 (b8cedc004 2020-03-09) 工具链 仍然提示找不到openssl库,于是手动设置openssl库的地址,下面是我的步骤。 首先,安装vcpkg,然后进行集成
然后,安装libsodium和openssl的windows静态库
设置rust静态链接
按照shadowsocks-rust的正常安装流程安装
这样编译出来就是静态链接的单文件版。 |
请问下载之后怎么用 |
@zonyitoo 现在这个应该可以解决了? |
Yup. |
首先,安装vcpkg,然后进行集成
然后,安装libsodium和openssl的windows静态库
设置rust静态链接
按照shadowsocks-rust的正常安装流程安装
这样编译出来就是静态链接的单文件版。
The text was updated successfully, but these errors were encountered: