When I attempt to build cdd-pusher (following instructions found on the git page), I get a variety of errors. I've tried with various versions of go, most of my testing with
1.3.3 (default on Debian 8)
1.4.2 (some docs refer to this)
1.5.1 (recommended in a forum post)
1.7.4 (some docs refer to this)
1.9.1 (current version)
The errors usually relate to import content, installation of plug ins.
I started up a clean Debian Jessie instance in Vagrant to test with. Each time I tried the install with a different go version, grabbed the error and then wiped and started a new fresh Debian VM.
Linux jessie 3.16.0-4-amd64 #1 SMP Debian 3.16.43-2+deb8u2 (2017-06-26) x86_64 GNU/Linux
Also, the first instruction is to install these pacakages, mercurial git bzr bison
, but there you will also need curl binutils gcc make
.
Error using go version 1.3.3
root@jessie:/home/vagrant# go version
go version go1.3.3 linux/amd64
root@jessie:/opt/app/cdr-pusher# make build
found packages fetch (fetch_orm.go) and main (insert_gorm.go) in archive
found packages fetch (fetch_orm.go) and main (insert_gorm.go) in archive
cp -i cdr-pusher.yaml /etc/cdr-pusher.yaml
# golang.org/x/sys/unix
src/golang.org/x/sys/unix/asm_linux_amd64.s:8 6a: No such file or directory: textflag.h
# github.com/go-sql-driver/mysql
src/github.com/go-sql-driver/mysql/utils.go:806: undefined: atomic.Value
# github.com/lib/pq
src/github.com/lib/pq/notify.go:642: syntax error: unexpected range, expecting {
src/github.com/lib/pq/notify.go:647: syntax error: argument to go/defer must be function call
src/github.com/lib/pq/notify.go:649: syntax error: unexpected (, expecting semicolon or newline
src/github.com/lib/pq/notify.go:666: non-declaration statement outside function body
src/github.com/lib/pq/notify.go:667: syntax error: unexpected }
Makefile:29: recipe for target 'build' failed
make: *** [build] Error 2
Error using go version 1.4.2
root@jessie:/opt/app/cdr-pusher# go version
go version go1.4.2 linux/amd64
root@jessie:/opt/app/cdr-pusher# export GOPATH=`pwd`
root@jessie:/opt/app/cdr-pusher# make build
found packages fetch_orm.go (fetch) and insert_gorm.go (main) in archive
found packages fetch_orm.go (fetch) and insert_gorm.go (main) in archive
cp -i cdr-pusher.yaml /etc/cdr-pusher.yaml
# github.com/go-sql-driver/mysql
src/github.com/go-sql-driver/mysql/packets.go:1085: v.In(mc.cfg.Loc).AppendFormat undefined (type time.Time has no field or method AppendFormat)
Makefile:29: recipe for target 'build' failed
make: *** [build] Error 2
root@jessie:/opt/app/cdr-pusher#
Error using go version 1.5.1
root@jessie:/opt/app/cdr-pusher# go version
go version go1.5.1 linux/amd64
root@jessie:/opt/app/cdr-pusher# make build
found packages fetch (fetch_orm.go) and main (insert_gorm.go) in archive
found packages fetch (fetch_orm.go) and main (insert_gorm.go) in archive
src/github.com/Sirupsen/logrus/hooks/syslog/syslog.go:10:2: cannot find package "github.com/sirupsen/logrus" in any of:
/root/.gvm/gos/go1.5.1/src/github.com/sirupsen/logrus (from $GOROOT)
/opt/app/cdr-pusher/src/github.com/sirupsen/logrus (from $GOPATH)
src/github.com/astaxie/beego/cache/memcache/memcache.go:39:2: cannot find package "github.com/bradfitz/gomemcache/memcache" in any of:
/root/.gvm/gos/go1.5.1/src/github.com/bradfitz/gomemcache/memcache (from $GOROOT)
/opt/app/cdr-pusher/src/github.com/bradfitz/gomemcache/memcache (from $GOPATH)
src/github.com/astaxie/beego/cache/redis/redis.go:38:2: cannot find package "github.com/garyburd/redigo/redis" in any of:
/root/.gvm/gos/go1.5.1/src/github.com/garyburd/redigo/redis (from $GOROOT)
/opt/app/cdr-pusher/src/github.com/garyburd/redigo/redis (from $GOPATH)
...[shortened]
Makefile:26: recipe for target 'get' failed
make: *** [get] Error 1
root@jessie:/opt/app/cdr-pusher#
I noticed that if I rerun make build
on go 1.5.1, I get a different error.
root@jessie:/opt/app/cdr-pusher# make build
found packages fetch (fetch_orm.go) and main (insert_gorm.go) in archive
package context: unrecognized import path "context"
Makefile:26: recipe for target 'get' failed
make: *** [get] Error 1
Error using go 1.7.4
Same as go 1.5.1, except the error upon rerunning make build
.
root@jessie:/opt/app/cdr-pusher# echo $GOROOT
/root/.gvm/gos/go1.7.4
root@jessie:/opt/app/cdr-pusher# echo $GOPATH
/opt/app/cdr-pusher
It sets the correct $GOROOT
and $GOPATH
.
Error using go 1.9.1
root@jessie:/opt/app/cdr-pusher# go version
go version go1.9.1 linux/amd64
root@jessie:/opt/app/cdr-pusher# make build
can't load package: package ./archive: found packages fetch (fetch_orm.go) and main (insert_gorm.go) in /opt/app/cdr-pusher/archive
Makefile:26: recipe for target 'get' failed
make: *** [get] Error 1
I'm pretty annoyed because I'm don't know go, nor do I understand why this isn't working for me, but it appears others are using it just fine. I hope this listing of errors is helpful to someone who can troubleshoot the code and provide some fixes. I have run this on CentOS 7.4 and recevied similar results.