Closed leopoldodonnell closed 7 years ago
You don't seem to be cloning into the right directory. If you clone to here: $GOPATH/src/github.com/jetstack
Then it should work.
@leopoldodonnell Thanks for the report. I am not too sure what's going on in your environment. Basically what we are doing is we use the vendor/
folder to version our binary dependencies. (The ones you tried to install manually through go get
).
First of all make sure your full path to the tarmak directory is like @BradErz suggest $GOPATH/src/github.com/jetstack/tarmak
Another thing to check is if the PWD is detected correctly. Your output suggest that your PWD is .../tarmak
or something like that. This is strange maybe using $(CURDIR)
works better:
diff --git a/Makefile b/Makefile
index 8156092..8341fd6 100644
--- a/Makefile
+++ b/Makefile
@@ -1,7 +1,7 @@
# Copyright Jetstack Ltd. See LICENSE for details.
PACKAGE_NAME ?= github.com/jetstack/tarmak
-BINDIR ?= $(PWD)/bin
+BINDIR ?= $(CURDIR)/bin
PATH := $(BINDIR):$(PATH)
CI_COMMIT_TAG ?= unknown
BradErz - I think you're right - I'm so used to docker-based builds that I didn't think to clone into GOPATH. It is work adding a few lines to the developer doc for those of us with wood where we should have brains.
This gets me further:
cd jetstack/tarmak/
/Users/leo_odonnell/go/src/jetstack/tarmak
goldtop:tarmak leo_odonnell$ make build
mkdir -p /Users/leo_odonnell/go/src/jetstack/tarmak/bin
go build -o /Users/leo_odonnell/go/src/jetstack/tarmak/bin/go-bindata ./vendor/github.com/jteeuwen/go-bindata/go-bindata
mkdir -p /Users/leo_odonnell/go/src/jetstack/tarmak/bin
go build -o /Users/leo_odonnell/go/src/jetstack/tarmak/bin/mockgen ./vendor/github.com/golang/mock/mockgen
mkdir -p /Users/leo_odonnell/go/src/jetstack/tarmak/bin
go build -o /Users/leo_odonnell/go/src/jetstack/tarmak/bin/defaulter-gen ./vendor/k8s.io/code-generator/cmd/defaulter-gen
mkdir -p /Users/leo_odonnell/go/src/jetstack/tarmak/bin
go build -o /Users/leo_odonnell/go/src/jetstack/tarmak/bin/deepcopy-gen ./vendor/k8s.io/code-generator/cmd/deepcopy-gen
mkdir -p /Users/leo_odonnell/go/src/jetstack/tarmak/bin
go build -o /Users/leo_odonnell/go/src/jetstack/tarmak/bin/conversion-gen ./vendor/k8s.io/code-generator/cmd/conversion-gen
mkdir -p /Users/leo_odonnell/go/src/jetstack/tarmak/bin
go build -o /Users/leo_odonnell/go/src/jetstack/tarmak/bin/client-gen ./vendor/k8s.io/code-generator/cmd/client-gen
mkdir -p /Users/leo_odonnell/go/src/jetstack/tarmak/bin
go build -o /Users/leo_odonnell/go/src/jetstack/tarmak/bin/lister-gen ./vendor/k8s.io/code-generator/cmd/lister-gen
mkdir -p /Users/leo_odonnell/go/src/jetstack/tarmak/bin
go build -o /Users/leo_odonnell/go/src/jetstack/tarmak/bin/informer-gen ./vendor/k8s.io/code-generator/cmd/informer-gen
go generate $(go list ./pkg/... ./cmd/...)
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -a -tags netgo -ldflags '-w -X main.version=unknown -X main.commit=unknown -X main.date=2017-10-17T12:56:16Z' -o tarmak_linux_amd64 ./cmd/tarmak
cmd/tarmak/main.go:5:2: cannot find package "github.com/jetstack/tarmak/cmd/tarmak/cmd" in any of:
/Users/leo_odonnell/go/src/jetstack/tarmak/vendor/github.com/jetstack/tarmak/cmd/tarmak/cmd (vendor tree)
/usr/local/go/src/github.com/jetstack/tarmak/cmd/tarmak/cmd (from $GOROOT)
/Users/leo_odonnell/go/src/github.com/jetstack/tarmak/cmd/tarmak/cmd (from $GOPATH)
make: *** [go_build] Error 1
I think it's still not the right directory: (there is no github.com
)
go get -d github.com/jetstack/tarmak/...
cd $GOPATH/src/github.com/jetstack/tarmak
make build
I received a number of issues on the get, but they appear to be benign. The build works. I'm closing this now. Its up to you want to update the developer doc for dumb people like me.
Here's the output I saw from the get:
rm -rf $GOPATH/*
goldtop:leo leo_odonnell$ go get -d github.com/jetstack/tarmak/...
package github.com/jetstack/tarmak/vendor/github.com/docker/docker/pkg/term/windows: case-insensitive import collision: "github.com/jetstack/tarmak/vendor/github.com/Sirupsen/logrus" and "github.com/jetstack/tarmak/vendor/github.com/sirupsen/logrus"
package github.com/jetstack/tarmak/vendor/github.com/docker/docker/api/server/router/image
imports github.com/docker/distribution/digest: cannot find package "github.com/docker/distribution/digest" in any of:
/usr/local/go/src/github.com/docker/distribution/digest (from $GOROOT)
/Users/leo_odonnell/go/src/github.com/docker/distribution/digest (from $GOPATH)
package github.com/jetstack/tarmak/vendor/github.com/docker/docker/api/server/router/network
imports github.com/docker/containerd/api/grpc/types: cannot find package "github.com/docker/containerd/api/grpc/types" in any of:
/usr/local/go/src/github.com/docker/containerd/api/grpc/types (from $GOROOT)
/Users/leo_odonnell/go/src/github.com/docker/containerd/api/grpc/types (from $GOPATH)
package github.com/jetstack/tarmak/vendor/github.com/docker/docker/daemon/logger/gcplogs
imports google.golang.org/cloud/compute/metadata: code in directory /Users/leo_odonnell/go/src/google.golang.org/cloud/compute/metadata expects import "cloud.google.com/go/compute/metadata"
package github.com/jetstack/tarmak/vendor/github.com/docker/docker/daemon/logger/gcplogs
imports google.golang.org/cloud/logging: code in directory /Users/leo_odonnell/go/src/google.golang.org/cloud/logging expects import "cloud.google.com/go/logging"
package github.com/jetstack/tarmak/vendor/github.com/googleapis/gnostic/plugins/gnostic-go-generator/examples/v2.0/apis_guru
imports github.com/googleapis/gnostic/plugins/gnostic-go-generator/examples/v2.0/apis_guru/apis_guru: cannot find package "github.com/googleapis/gnostic/plugins/gnostic-go-generator/examples/v2.0/apis_guru/apis_guru" in any of:
/usr/local/go/src/github.com/googleapis/gnostic/plugins/gnostic-go-generator/examples/v2.0/apis_guru/apis_guru (from $GOROOT)
/Users/leo_odonnell/go/src/github.com/googleapis/gnostic/plugins/gnostic-go-generator/examples/v2.0/apis_guru/apis_guru (from $GOPATH)
package github.com/jetstack/tarmak/vendor/github.com/googleapis/gnostic/plugins/gnostic-go-generator/examples/v2.0/bookstore/service
imports github.com/googleapis/gnostic/plugins/gnostic-go-generator/examples/v2.0/bookstore/bookstore: cannot find package "github.com/googleapis/gnostic/plugins/gnostic-go-generator/examples/v2.0/bookstore/bookstore" in any of:
/usr/local/go/src/github.com/googleapis/gnostic/plugins/gnostic-go-generator/examples/v2.0/bookstore/bookstore (from $GOROOT)
/Users/leo_odonnell/go/src/github.com/googleapis/gnostic/plugins/gnostic-go-generator/examples/v2.0/bookstore/bookstore (from $GOPATH)
package github.com/jetstack/tarmak/vendor/github.com/googleapis/gnostic/plugins/gnostic-go-generator/examples/v2.0/xkcd
imports github.com/googleapis/gnostic/plugins/gnostic-go-generator/examples/v2.0/xkcd/xkcd: cannot find package "github.com/googleapis/gnostic/plugins/gnostic-go-generator/examples/v2.0/xkcd/xkcd" in any of:
/usr/local/go/src/github.com/googleapis/gnostic/plugins/gnostic-go-generator/examples/v2.0/xkcd/xkcd (from $GOROOT)
/Users/leo_odonnell/go/src/github.com/googleapis/gnostic/plugins/gnostic-go-generator/examples/v2.0/xkcd/xkcd (from $GOPATH)
@simonswine I think a quick edit to the docs with your commands of how and where to "go get" this repo would be really helpful for users (like me) who are not go developers by trade get past step 1. Thanks!
OSX 10.12.6
Started adding in missing packages with
go get
make build
now returnsI'm not certain if there are k8's version issues here. So while I'd love to dig deeper, I'm afraid it could possibly be a fools errand that might be easily fixed by the maintainers updating the dependencies to be more complete.