evilsocket / xray

XRay is a tool for recon, mapping and OSINT gathering from public networks.
GNU General Public License v3.0
2.19k stars 297 forks source link

install error #27

Closed bkr32 closed 7 years ago

bkr32 commented 7 years ago

after running make get_glide make install_dependencies i run into the following error on make build

gofmt -s -w .
vendor/golang.org/x/net/ipv4/batch.go:59:14: expected type, found '='
vendor/golang.org/x/net/ipv4/batch.go:78:2: expected declaration, found 'if'
vendor/golang.org/x/net/ipv6/batch.go:56:14: expected type, found '='
vendor/golang.org/x/net/ipv6/batch.go:69:2: expected declaration, found 'if'
Makefile:8: recipe for target 'format' failed
make: *** [format] Error 2
evilsocket commented 7 years ago

Did you read the readme? What version of Go are you using?

bkr32 commented 7 years ago

yes i read the readme my go version is go version go1.7.5 linux/amd64

wladiolo commented 7 years ago

Same error for me...

user@mypc:~/script/go-script/src/github.com/evilsocket/xray$ go version
go version go1.8.3 linux/amd64
user@mypc:~/script/go-script/src/github.com/evilsocket/xray$ go env | grep GOPATH
GOPATH="/home/user/script/go-script"
user@mypc:~/script/go-script/src/github.com/evilsocket/xray$ env | grep PATH
PATH=[...]:/usr/local/go/bin:/bin:/home/user/script/go-script/bin
user@mypc:~/script/go-script/src/github.com/evilsocket/xray$ uname -a
Linux mypc 4.4.0-83-generic #106~14.04.1-Ubuntu SMP Mon Jun 26 18:10:19 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux

I also tested the GO installation as suggested here https://golang.org/doc/install and it works.

user@mypc:~/script/go-script/src/hello$ ./hello 
hello, world

If you need some more info, let me know. Thank you very much

Minitram commented 7 years ago

I had the same error during build (tried go 1.8.3 and 1.7.6). After some time I figured that there is a syntax error in the source (and the parser message states exactly what is wrong). Just open the file $GOPATH/src/github.com/evilsocket/xray/vendor/golang.org/x/net/ipv4/batch.go, go to line 60 and remove the equal sign in statement type Message = socket.Message (i.e. it should be type Message socket.Message) than do the same in $GOPATH/src/github.com/evilsocket/xray/vendor/golang.org/x/net/ipv6/batch.go on line 56. After correcting this everything went just fine. Hope this helps.

bkr32 commented 7 years ago

thanks @Minitram that worked glad i didnt screw up following instructions

evilsocket commented 7 years ago

i wonder why this didn't happen to other people as well 🤔

fyoorer commented 7 years ago

I am getting this error while building docker image as well 🤔

arbazkiraak commented 7 years ago

make build

gofmt -s -w . vendor/golang.org/x/net/ipv4/batch.go:59:14: expected type, found '=' vendor/golang.org/x/net/ipv4/batch.go:78:2: expected declaration, found 'if' vendor/golang.org/x/net/ipv6/batch.go:56:14: expected type, found '=' vendor/golang.org/x/net/ipv6/batch.go:69:2: expected declaration, found 'if' Makefile:8: recipe for target 'format' failed make: *** [format] Error 2

Followed the instruction Given By @Minitram

make build

gofmt -s -w . go-bindata -o cmd/xray/ui.go -pkg main ui make: go-bindata: Command not found Makefile:34: recipe for target 'static' failed make: *** [static] Error 127

go get -u github.com/jteeuwen/go-bindata/...

make build

gofmt -s -w . go-bindata -o cmd/xray/ui.go -pkg main ui make: go-bindata: Command not found Makefile:34: recipe for target 'static' failed make: *** [static] Error 127

arbazkiraak commented 7 years ago

Solved by : :+1: Manually :

go get github.com/jteeuwen/go-bindata cd $GOPATH/src/github.com/jteeuwen/go-bindata/go-bindata go build

                                (OR)

automatic : :100: apt-get install go-bindata -y

yojado commented 7 years ago

I got same error while try to build docker

docker build -t xraydocker . .... .... .... gofmt -s -w . vendor/golang.org/x/net/ipv4/batch.go:59:14: expected type, found '=' vendor/golang.org/x/net/ipv4/batch.go:78:2: expected declaration, found 'if' vendor/golang.org/x/net/ipv6/batch.go:56:14: expected type, found '=' vendor/golang.org/x/net/ipv6/batch.go:69:2: expected declaration, found 'if' make: *** [Makefile:8: format] Error 2

so why this issue is marked as closed?

bkr32 commented 7 years ago

@yojado the given solution by @Minitram worked

phobosgroup commented 7 years ago

Also getting this error.

mugundhan commented 7 years ago

the issue is with Golang

type alias introduced in Go 1.9. but vendor/golang.org/x/net/ipv4/batch.go:59: type Message = socket.Message https://github.com/golang/go/issues/20543

for solution: As minitram said

In following file vendor/golang.org/x/net/ipv4/batch.go:59 vendor/golang.org/x/net/ipv6/batch.go:56

type Message socket.Message "remove ="

ehsandeep commented 7 years ago

Hey @evilsocket, this error for installation introduced in this latest version of XRAY, it was not before, as @Minitram told the fix for this new installation issue is removing = sign in both respective file will solve the issue and worked for me as well.

vendor/golang.org/x/net/ipv4/batch.go:59
vendor/golang.org/x/net/ipv6/batch.go:56

Line to find in both file:

type Message = socket.Message

Replacing the = sign:

type Message socket.Message 

now make build should work!