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

How can I build it with static exe file in windows system #10

Closed
phoenixxie0 opened this issue Feb 13, 2017 · 15 comments
Closed

How can I build it with static exe file in windows system #10

phoenixxie0 opened this issue Feb 13, 2017 · 15 comments

Comments

@phoenixxie0
Copy link

In the shadowsocks/shadowsocks-libev#1248 @madeye suggest me to use go-shadowsocks2 in windows instead of ss-libev, And I use go get -u -v github.com/shadowsocks/go-shadowsocks2 to install it in my mingw64. So now.. How can I build It into a static exe file? Because I found that It going wrrong if I move the "go-shadowsocks2.exe" to another path. so I think it is using some other link files?

@fiercebead
Copy link

在VPS上cross compile吧
shadowsocks/shadowsocks-windows#1020 (comment)

@phoenixxie0
Copy link
Author

@fiercebead 无论是在win下编译还是在VPS上,依然是这样的错误
2017/02/13 23:02:12 SOCKS proxy 0.0.0.0:10099 <-> 172.106.33.21:512
2017/02/13 23:02:17 proxy 127.0.0.1:62111 <-> 172.106.33.21:512 <-> twitter.com:443
2017/02/13 23:02:17 relay error: read tcp 192.168.1.7:62112->[server ip]:512: wsarecv: An existing connection was forcibly closed by the remote host.

@phoenixxie0
Copy link
Author

@fiercebead @riobard The same exe file. when I run it in the msys2 , It's running well but when I run in the windows cmd, It's going wrrong. And the server side log is
2017-02-13 23:14:49 ERROR: failed to handshake with [my ip address]: authentication error
2017-02-13 23:14:49 INFO: current server connection: 0
It is just like that use the 3.0.1 client to conncet 3.0.2 server..

@riobard
Copy link

riobard commented Feb 13, 2017

There's indeed a plan to release pre-built statically linked binaries for popular platforms (currently including Windows x64/x86, Linux/MacOS x64), but I haven't got the time to set up the release process.

Now that you're asking, I'm giving it a try. Could you please help me beta-test the binary releases from here? https://github.com/riobard/go-shadowsocks2/releases/tag/v0.0.1

@phoenixxie0
Copy link
Author

phoenixxie0 commented Feb 13, 2017

@riobard THX, And I knew what wrrong with my commond.. It is that in the bash we must use ' ' to include the symbol like !#?~ while use -password. But in windows cmd, we should not the ' '.
I only tested the shadowsocks2-win64.And the file from https://github.com/riobard/go-shadowsocks2/releases/tag/v0.0.1 is running well.
And I think that wether we should the log more friendly?

@fiercebead
Copy link

It's better to make windows binary's filename end with .exe, also use 7z or xz to compress windows binary, use xz or gz to compress linux binary, I'm not sure if macos can unpack xz natively.

@riobard
Copy link

riobard commented Feb 14, 2017

@fiercebead Makes sense.

Can Windows natively uncompressed 7z? I think you'll need to install 7z app first? Otherwise I think it's easier to use zip for Win/MacOS and gz for Linux.

@fiercebead
Copy link

@riobard 这样也不错,不过windows用户应该总会安装7z或者winrar或者其他一些国产的压缩软件,因为作为windows用户什么都不装的话仅仅靠zip是不够的吧,基本上现在win下的压缩软件都支持7z

@riobard
Copy link

riobard commented Feb 14, 2017

It's better to reduce reliance on 3rd party app.

Just checked that MacOS natively supports gz, so the choice is simple: zip for Windows, and gz for Linux/MacOS.

@fiercebead
Copy link

I agree, it seems downloading .exe from github release is not allowed.
I tried to download https://github.com/riobard/go-shadowsocks2/releases/download/v0.0.2/shadowsocks2-win64.exe and got this

This XML file does not appear to have any style information associated with it. The document tree is shown below.
<Error>
<Code>NoSuchKey</Code>
<Message>The specified key does not exist.</Message>
<Key>
releases/80928060/54149528-f24f-11e6-8866-c378d3111a08.exe
</Key>
<RequestId>163782CCDCC2FC60</RequestId>
<HostId>
Q88WleSJAamCYLjHXWwjHd0lZAVMH8sgfXZdetpFe5o7a+meMqGHvWJyLQpCJLQ8
</HostId>
</Error>

@fiercebead
Copy link

Oh but I can download .exe from other project, maybe it's github's fault 😓

@riobard
Copy link

riobard commented Feb 14, 2017

That link seems to be broken. I'll upload a zip-compressed version later.

@yydcool
Copy link

yydcool commented Feb 14, 2017

I tested with Windows 10 64bit. It works.
No need to use mingw.
Just install golang for windows, set GOPATH, and "go get ..."
You will get a exe file under GOPATH/bin, it can run anywhere. I even test the exe on another Windows machine without golang installed.

@riobard
Copy link

riobard commented Feb 14, 2017

Uploaded zip-compressed binary for Windows.

@riobard riobard closed this as completed Feb 18, 2017
@ipcjs
Copy link

ipcjs commented Mar 23, 2017

居然可以直接在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

No branches or pull requests

5 participants