Skip to content
This repository was archived by the owner on Feb 6, 2025. It is now read-only.

Makefile: Add go version check #518

Merged
merged 1 commit into from
Jul 25, 2019
Merged

Conversation

nirmoy
Copy link
Contributor

@nirmoy nirmoy commented Jul 25, 2019

skuba requires >= go1.12 for building.
This PR make sure make check that requirement.
Before:

make
GO111MODULE=on go install -mod=vendor -ldflags "-X=github.com/SUSE/skuba/pkg/skuba.Version=0.8.1 -X=github.com/SUSE/skuba/pkg/skuba.Commit=8fd48ab -X=github.com/SUSE/skuba/pkg/skuba.BuildDate=20190725" -tags development ./cmd/...
build k8s.io/component-base/config: cannot find module for path k8s.io/component-base/config
make: *** [Makefile:54: install] Error 1

After:

make
FATAL: Go version should be >= 1.12.x
make: *** [Makefile:77: go-version-check] Error 1

@jenting
Copy link

jenting commented Jul 25, 2019

Go >= 1.11 supports go modules

skuba requires >= go1.12 for building.
This PR make sure `make` check that requirement.

Signed-off-by: Nirmoy Das <ndas@suse.de>
@nirmoy nirmoy force-pushed the go_version_check1 branch from 208846c to 63a0be4 Compare July 25, 2019 12:32
@fgerling
Copy link

Go >= 1.11 supports go modules

Can you elaborate on that? in 1.11 modules are experimental. Did that change in 1.12?

@nirmoy
Copy link
Contributor Author

nirmoy commented Jul 25, 2019

@jhsiaosuse Thanks. Updated.

@jenting
Copy link

jenting commented Jul 25, 2019

Go >= 1.11 supports go modules

Can you elaborate on that? in 1.11 modules are experimental. Did that change in 1.12?

AFAIK, golang 1.12 does not change go module related but enhance tools related. I have used go module from 1.11, everything gonna well.

@nirmoy nirmoy requested a review from saschagrunert July 25, 2019 12:47
@fgerling
Copy link

With go 1.11

root@a902dcfaa641:/go/src/github.com/nirmoy/skuba# git rev-parse HEAD
63a0be4e721301401eed3e6aa446f63b9d50014e

root@a902dcfaa641:/go/src/github.com/nirmoy/skuba# go version
go version go1.11.12 linux/amd64

root@a902dcfaa641:/go/src/github.com/nirmoy/skuba# make
FATAL: Go version should be >= 1.12.x
make: *** [Makefile:77: go-version-check] Error 1

With go 1.12

root@0ab3b5df474e:/go/src/github.com/nirmoy/skuba# git rev-parse HEAD
63a0be4e721301401eed3e6aa446f63b9d50014e

root@0ab3b5df474e:/go/src/github.com/nirmoy/skuba# go version
go version go1.12.7 linux/amd64

root@0ab3b5df474e:/go/src/github.com/nirmoy/skuba# make
GO111MODULE=on go install -mod=vendor -ldflags "-X=github.com/SUSE/skuba/pkg/skuba.Version=0.8.1 -X=github.com/SUSE/skuba/pkg/skuba.Commit=63a0be4 -X=github.com/SUSE/skuba/pkg/skuba.BuildDate
=20190725" -tags development ./cmd/...
rm -f /go/bin/kubectl-caasp
ln -s /go/bin/skuba /go/bin/kubectl-caasp

LGTM. Thank you @nirmoy.
Anything else I should have a look at?

Copy link

@fgerling fgerling left a comment

Choose a reason for hiding this comment

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

Looks good to me. 👍
See my "report"

@saschagrunert
Copy link
Contributor

saschagrunert commented Jul 25, 2019

There is a hash sum calculation bug in go 1.11 which will cause a mismatch in go.sum between 1.11 and 1.12: golang/go#29278 To avoid issues I would stick to 1.12 :)

@jenting
Copy link

jenting commented Jul 25, 2019

There is a hash sum calculation bug in go 1.11 which will cause a mismatch in go.sum between 1.11 and 1.12: golang/go#29278 To avoid issues I would stick to 1.12 :)

Thanks, @saschagrunert, I met this issue before.

@caaspjenkins caaspjenkins merged commit 345d689 into SUSE:master Jul 25, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants