Skip to content

Commit

Permalink
go: gimme to installs go v1.12.x
Browse files Browse the repository at this point in the history
  • Loading branch information
hunchback committed Sep 5, 2019
1 parent cbafa95 commit 0e78a73
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 17 deletions.
23 changes: 13 additions & 10 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,12 @@ $(call VENDOR_RUN,${PROTOC_GEN_GOFAST_GITHUB})
$(call VENDOR_RUN,${PROTOC_GEN_GO_GITHUB}) protoc -Ivendor -I. --plugin=${BUILD_TOOLS}/protoc-gen-gogofaster --gogofaster_out $$GOPATH/src $1
endef

export GO111MODULE=off

VERSION?=$(shell $(VERSION_CMD))
GO_GET:=CC= GOARCH= go get
GOVENDOR:=${GOPATH}/bin/govendor
GOFMT:=gofmt -s -w
GOVENDOR:=GOFLAGS= ${GOPATH}/bin/govendor
BUILD_CMD?=${GOVENDOR}
BUILD_ID:=$(shell echo 0x$$(head -c20 /dev/urandom|od -An -tx1|tr -d ' \n'))
SKYDIVE_GITHUB:=github.com/skydive-project/skydive
Expand Down Expand Up @@ -281,13 +284,13 @@ flow/flow.pb.go: flow/flow.proto filters/filters.proto
sed -e 's/type ICMPLayer struct {/\/\/ gendecoder\ntype ICMPLayer struct {/' -i $@
sed -e 's/type IPMetric struct {/\/\/ gendecoder\ntype IPMetric struct {/' -i $@
sed -e 's/type TCPMetric struct {/\/\/ gendecoder\ntype TCPMetric struct {/' -i $@
gofmt -s -w $@
$(GOFMT) $@

websocket/structmessage.pb.go: websocket/structmessage.proto
$(call PROTOC_GEN,$<)

sed -e 's/type StructMessage struct {/type StructMessage struct { XXX_state structMessageState `json:"-"`/' -i websocket/structmessage.pb.go
gofmt -s -w $@
$(GOFMT) $@

.proto: govendor flow/layers/dns.pb.go flow/layers/vrrpv2.pb.go flow/layers/dhcpv4.pb.go flow/flow.pb.go filters/filters.pb.go websocket/structmessage.pb.go

Expand Down Expand Up @@ -366,7 +369,7 @@ npm.install:

statics/bindata.go: .typescript ebpf.build $(shell find statics -type f \( ! -iname "bindata.go" \))
$(call VENDOR_RUN,${GO_BINDATA_GITHUB}) go-bindata ${GO_BINDATA_FLAGS} -nometadata -o statics/bindata.go -pkg=statics -ignore=bindata.go $(BINDATA_DIRS)
gofmt -w -s statics/bindata.go
$(GOFMT) statics/bindata.go

.PHONY: .vppbinapi
.vppbinapi: binapigenerator
Expand Down Expand Up @@ -576,18 +579,18 @@ govendor:
.PHONY: fmt
fmt: govendor genlocalfiles
@echo "+ $@"
@test -z "$$($(GOVENDOR) fmt +local)" || \
(echo "+ please format Go code with 'gofmt -s'" && /bin/false)
$(GOVENDOR) fmt +local || \
(echo "+ please format Go code with '$(GOFMT)'" && /bin/false)

.PHONY: vet
vet: govendor
@echo "+ $@"
test -z "$$($(GOVENDOR) tool vet $$( \
test -z "$$($(GOVENDOR) vet $$( \
$(GOVENDOR) list -no-status +local \
| perl -pe 's|$(SKYDIVE_GITHUB)/?||g' \
| grep -v '^tests') 2>&1 \
| grep -v '^$(SKYDIVE_GITHUB)/tests' \
| grep -v '^$(SKYDIVE_GITHUB)/contrib/collectd' \
) 2>&1 \
| tee /dev/stderr \
| grep -v '^flow/probes/afpacket/' \
| grep -v 'exit status 1' \
)"

Expand Down
2 changes: 1 addition & 1 deletion contrib/ansible/roles/skydive_dev/tasks/gimme.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
- name: run gimme in bash profile
lineinfile:
path: /home/vagrant/.bash_profile
line: 'eval "$(gimme 1.10.8)"'
line: 'eval "$(gimme 1.12.7)"'

- name: set GOPATH
lineinfile:
Expand Down
2 changes: 1 addition & 1 deletion packetinjector/pcap.go
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,6 @@ func (p *PcapPacketGenerator) PacketSource() chan *Packet {
func NewPcapPacketGenerator(pp *PacketInjectionRequest) (*PcapPacketGenerator, error) {
return &PcapPacketGenerator{
PacketInjectionRequest: pp,
close: make(chan bool, 1),
close: make(chan bool, 1),
}, nil
}
4 changes: 2 additions & 2 deletions packetinjector/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,8 @@ func (o *onDemandPacketInjectServer) CreateTask(srcNode *graph.Node, resource ty

metadata := &InjectionMetadata{
PacketInjectionRequest: *pp,
ID: pp.UUID,
State: "active",
ID: pp.UUID,
State: "active",
}

if o.graph.UpdateMetadata(srcNode, "PacketInjections", func(obj interface{}) bool {
Expand Down
2 changes: 1 addition & 1 deletion scripts/ci/install-go.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ curl -sL -o ~/bin/gimme https://raw.githubusercontent.com/travis-ci/gimme/master
chmod +x ~/bin/gimme

# before changing this be sure that it will not break the RHEL packaging
eval "$(gimme 1.10.3)"
eval "$(gimme 1.12.7)"

export GOPATH=$WORKSPACE
export PATH=$PATH:$GOPATH/bin
Expand Down
4 changes: 2 additions & 2 deletions websocket/message.go
Original file line number Diff line number Diff line change
Expand Up @@ -391,7 +391,7 @@ func (s *StructSpeaker) OnMessage(c Speaker, m Message) {

func newStructSpeaker(c Speaker, logger logging.Logger) *StructSpeaker {
s := &StructSpeaker{
Speaker: c,
Speaker: c,
structSpeakerEventDispatcher: newStructSpeakerEventDispatcher(),
nsSubscribed: make(map[string]bool),
replyChan: make(map[string]chan *StructMessage),
Expand Down Expand Up @@ -497,7 +497,7 @@ func (s *StructServer) OnDisconnected(c Speaker) {
// NewStructServer returns a new StructServer
func NewStructServer(server *Server) *StructServer {
s := &StructServer{
Server: server,
Server: server,
structSpeakerPoolEventDispatcher: newStructSpeakerPoolEventDispatcher(server),
}

Expand Down

0 comments on commit 0e78a73

Please sign in to comment.