Closed flavio-fernandes closed 5 years ago
Hi @gconnell . Any chance you can tell what is causing this issue? ^^
This looks like golang/go#7413 and indeed trusty ships with golang 1.2. I could verify this with the official trusty docker image. As mentioned in the golang issue this was fixed for golang 1.3 which is included in trusty-backports.
I did a quick test in the same docker image with golang 1.3 from backports - and there go get worked. But one will run into additional problems with afpacket
, bsdpf
, and pcapgo/capture
, since those need golang.org/x/sys/unix
which in turn needs at least golang 1.6.
@flavio-fernandes does using a newer golang version work for you? @gconnell is there a minimum go version for gopacket?
I'm sure there is a minimum go version for gopacket, but I have no clue what it is. In effect, if it compiles in Travis we tend to allow it to be committed... and Travis updates its Go relatively consistently with major releases. So there's a chance at any time that some depends-on-latest stuff might sneak in.
If we wanted, we could probably enforce a guaranteed minimum supported version by adding different Go version tests to our Travis, but we don't (I think) yet have that.
@notti sorry for delay.
Yes, using 1.5 or newer seems to work ok Using 1.4 or older does not.
Using gimme to jump to different golang versions.
https://gist.github.com/flavio-fernandes/fb1e84c7ba4162438837077f2df1f0ba
vagrant@vagrant-ubuntu-trusty-64:~$ echo $GOPATH
/home/vagrant/go
vagrant@vagrant-ubuntu-trusty-64:~$
vagrant@vagrant-ubuntu-trusty-64:/vagrant/nfvapp$ cd ; rm -rf go ; mkdir -pv ~/go ; eval "$(gimme stable)"
mkdir: created directory ‘/home/vagrant/go’
go version go1.11.2 linux/amd64
vagrant@vagrant-ubuntu-trusty-64:~$ go version ; go get github.com/google/gopacket
go version go1.11.2 linux/amd64
vagrant@vagrant-ubuntu-trusty-64:~$ cd /vagrant/nfvapp && go build nfvapp.go && echo yay
yay
vagrant@vagrant-ubuntu-trusty-64:/vagrant/nfvapp$
vagrant@vagrant-ubuntu-trusty-64:/vagrant/nfvapp$
vagrant@vagrant-ubuntu-trusty-64:/vagrant/nfvapp$
vagrant@vagrant-ubuntu-trusty-64:/vagrant/nfvapp$ cd ; rm -rf go ; mkdir -pv ~/go ; eval "$(gimme 1.6)"
mkdir: created directory ‘/home/vagrant/go’
go version go1.6 linux/amd64
vagrant@vagrant-ubuntu-trusty-64:~$ go version ; go get github.com/google/gopacket
go version go1.6 linux/amd64
vagrant@vagrant-ubuntu-trusty-64:~$ cd /vagrant/nfvapp && go build nfvapp.go && echo yay
yay
vagrant@vagrant-ubuntu-trusty-64:/vagrant/nfvapp$
vagrant@vagrant-ubuntu-trusty-64:/vagrant/nfvapp$
vagrant@vagrant-ubuntu-trusty-64:/vagrant/nfvapp$
vagrant@vagrant-ubuntu-trusty-64:/vagrant/nfvapp$ cd ; rm -rf go ; mkdir -pv ~/go ; eval "$(gimme 1.5)"
mkdir: created directory ‘/home/vagrant/go’
go version go1.5 linux/amd64
vagrant@vagrant-ubuntu-trusty-64:~$ go version ; go get github.com/google/gopacket
go version go1.5 linux/amd64
vagrant@vagrant-ubuntu-trusty-64:~$ cd /vagrant/nfvapp && go build nfvapp.go && echo yay
yay
vagrant@vagrant-ubuntu-trusty-64:/vagrant/nfvapp$
vagrant@vagrant-ubuntu-trusty-64:/vagrant/nfvapp$
vagrant@vagrant-ubuntu-trusty-64:/vagrant/nfvapp$
vagrant@vagrant-ubuntu-trusty-64:/vagrant/nfvapp$
vagrant@vagrant-ubuntu-trusty-64:/vagrant/nfvapp$ cd ; rm -rf go ; mkdir -pv ~/go ; eval "$(gimme 1.4)"
mkdir: created directory ‘/home/vagrant/go’
go version go1.4 linux/amd64
vagrant@vagrant-ubuntu-trusty-64:~$ go version ; go get github.com/google/gopacket
go version go1.4 linux/amd64
vagrant@vagrant-ubuntu-trusty-64:~$ cd /vagrant/nfvapp && go build nfvapp.go && echo yay
go build github.com/google/gopacket/layers: /home/vagrant/.gimme/versions/go1.4.linux.amd64/pkg/tool/linux_amd64/6g: signal: killed
vagrant@vagrant-ubuntu-trusty-64:/vagrant/nfvapp$
vagrant@vagrant-ubuntu-trusty-64:/vagrant/nfvapp$
vagrant@vagrant-ubuntu-trusty-64:/vagrant/nfvapp$
vagrant@vagrant-ubuntu-trusty-64:/vagrant/nfvapp$ cd ; rm -rf go ; mkdir -pv ~/go ; eval "$(gimme 1.2)"
mkdir: created directory ‘/home/vagrant/go’
go version go1.2 linux/amd64
vagrant@vagrant-ubuntu-trusty-64:~$ go version ; go get github.com/google/gopacket
go version go1.2 linux/amd64
vagrant@vagrant-ubuntu-trusty-64:~$ cd /vagrant/nfvapp && go build nfvapp.go && echo yay
# github.com/google/gopacket/pcap
checknil [7f00405747f0]
. NAME-pcap.pp u(1) a(1) g(4) l(700) x(0+0) class(PAUTO) f(1) ld(1) tc(1) used(1) pcap._Ctype_uintptr_t
/home/vagrant/go/src/github.com/google/gopacket/pcap/pcap.go:396: internal compiler error: bad checknil
vagrant@vagrant-ubuntu-trusty-64:/vagrant/nfvapp$
Thanks for the testing. I'll add something to the documentation to document this and maybe also testing with different go versions on travis.
Vagrant box
ubuntu/trusty64 (virtualbox, 20171128.0.0)
Using the following script to compile a simple app that uses pcap, I hit the following issue when using master 79cff32cd2cb4b955635abee1ed8a632133d3420
This is the command I'm using, from a script I use to build the app :
After finding a good starting point (v1.1.14) I was able to determine that the following commit seems to be causing the compilation failure.