Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

go: gimme to installs go v1.12.x #1966

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 11 additions & 10 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@ endef

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 +282,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 @@ -354,7 +355,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 @@ -558,18 +559,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)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

gofmt -s only we would like the output

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is just the message to the user; and user should overwrite source (rather than output to stdout):

[vagrant@dev skydive]$ gofmt --help
usage: gofmt [flags] [path ...]
  -cpuprofile string
        write cpu profile to this file
  -d    display diffs instead of rewriting files
  -e    report all errors (not just the first 10 on different lines)
  -l    list files whose formatting differs from gofmt's
  -r string
        rewrite rule (e.g., 'a[b:len(a)] -> a[b:]')
  -s    simplify code
  -w    write result to (source) file instead of stdout
``


.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 \
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what about '^tests' ?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

'^$(SKYDIVE_GITHUB)/tests' as I don't remove the prefix anymore

| 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.13.0)"'

- 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,
hunchback marked this conversation as resolved.
Show resolved Hide resolved
State: "active",
}

if o.graph.UpdateMetadata(srcNode, "PacketInjections", func(obj interface{}) bool {
Expand Down
2 changes: 1 addition & 1 deletion scripts/ci/create-binaries.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ echo "--- BINARIES ---"
make static WITH_EBPF=true

# We need at least Go 1.11.0 to generate swagger spec
eval "$(gimme 1.12.7)"
eval "$(gimme 1.13.0)"
make swagger

git reset --hard
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.13.0)"

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