Keywhiz-fs make and Dockerfile return errors

41 views
Skip to first unread message

Matthew Halder

unread,
Jul 25, 2016, 5:49:17 PM7/25/16
to keywhiz-users
It looks like the Makefile is not working for the keywhiz-fs build.  I've tried by installing Go, and getting the doing the "go get" command to install the entire keywhiz-fs directory structure.  It always ends with this error:
-----------Begin Error MSG ---------------
go build -ldflags "-s -w \
      -X \"main.buildTime=1469481626\" \
      -X \"main.buildRevision=d7dfb9b5ba3968270bb66260dd376ea2fd7ffe47\" \
      -X \"main.buildMachine=Linux ip-172-20-1-222 3.13.0-91-generic x86_64\""
fs.go:28:2: cannot find package "github.com/hanwen/go-fuse/fuse" in any of:
    /usr/src/pkg/github.com/hanwen/go-fuse/fuse (from $GOROOT)
    ($GOPATH not set)
fs.go:29:2: cannot find package "github.com/hanwen/go-fuse/fuse/nodefs" in any of:
    /usr/src/pkg/github.com/hanwen/go-fuse/fuse/nodefs (from $GOROOT)
    ($GOPATH not set)
fs.go:30:2: cannot find package "github.com/hanwen/go-fuse/fuse/pathfs" in any of:
    /usr/src/pkg/github.com/hanwen/go-fuse/fuse/pathfs (from $GOROOT)
    ($GOPATH not set)
main.go:29:2: cannot find package "github.com/rcrowley/go-metrics" in any of:
    /usr/src/pkg/github.com/rcrowley/go-metrics (from $GOROOT)
    ($GOPATH not set)
fs.go:31:2: cannot find package "github.com/square/go-sq-metrics" in any of:
    /usr/src/pkg/github.com/square/go-sq-metrics (from $GOROOT)
    ($GOPATH not set)
cache.go:20:2: cannot find package "github.com/square/keywhiz-fs/log" in any of:
    /usr/src/pkg/github.com/square/keywhiz-fs/log (from $GOROOT)
    ($GOPATH not set)
fs.go:33:2: cannot find package "golang.org/x/sys/unix" in any of:
    /usr/src/pkg/golang.org/x/sys/unix (from $GOROOT)
    ($GOPATH not set)
main.go:25:2: cannot find package "gopkg.in/alecthomas/kingpin.v2" in any of:
    /usr/src/pkg/gopkg.in/alecthomas/kingpin.v2 (from $GOROOT)
    ($GOPATH not set)
make: *** [keywhiz-fs] Error 1
-----------End Error MSG ---------------

Then moved on to trying to do this via Dockerfile since that would fit into the env.  But this failed with the this error message
-----------Begin Error MSG ---------------
Removing intermediate container b20d636ea5a9
Step 5 : COPY . /go/src/github.com/square/keywhiz-fs
 ---> 1927f0673f98
Removing intermediate container b548b7ee5371
Step 6 : RUN cd /go/src/github.com/square/keywhiz-fs &&     make keywhiz-fs &&     cp keywhiz-fs /go/bin/keywhiz-fs
 ---> Running in bd3d5168d0da
make: *** No rule to make target 'keywhiz-fs'.  Stop.
The command '/bin/sh -c cd /go/src/github.com/square/keywhiz-fs &&     make keywhiz-fs &&     cp keywhiz-fs /go/bin/keywhiz-fs' returned a non-zero code: 2
-----------End Error MSG ---------------

The "make:" lines pops in read during the build sequence.  From these two tests I wonder if something is needed in the Makefile to ensure that it builds properly.  I've checked the files listed in the 1st error message and all the files that are being called are present here.

Matthew McPherrin

unread,
Jul 25, 2016, 6:03:00 PM7/25/16
to Matthew Halder, keywhiz-users
The first error is that $GOPATH isn't set.  See https://golang.org/doc/install for setting up go, but the TLDR is:
~ export GOPATH=/some/place/to/build
~ mkdir "$GOPATH"
~ ls "$GOPATH"
bin pkg src
~ ls "$GOPATH"/bin
keywhiz-fs

It looks like WRT the dockerfile, we updated the makefile but not the Dockerfile -- we should add tests to Travis CI so that doesn't happen again.

--
You received this message because you are subscribed to the Google Groups "keywhiz-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to keywhiz-user...@googlegroups.com.
To post to this group, send email to keywhi...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/keywhiz-users/cb97dda4-abd3-4b28-8b56-fcc399fd0a80%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Matthew Halder

unread,
Jul 26, 2016, 10:58:18 AM7/26/16
to keywhiz-users, mha...@pingidentity.com
Thank you, this is now working.  One would note, (on ubuntu 1404) using the "apt-get install gccgo-go" never seemed to produce a keywhiz-fs binary file but installing go from source [https://golang.org/doc/install] worked just as outlined below.

Matthew McPherrin

unread,
Jul 26, 2016, 1:46:06 PM7/26/16
to Matthew Halder, keywhiz-users
Interesting!  I don't think we've ever tried to use GCC, but it ought to work.  I'll take a look at some point.

Reply all
Reply to author
Forward
0 new messages