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

Check minimum required go version when build #1760

Merged
merged 5 commits into from
Jun 4, 2021

Conversation

gmgigi96
Copy link
Member

@gmgigi96 gmgigi96 commented Jun 3, 2021

When build reva, if go version is below the minimum required, it will warn the user with a message.

Closes #1758

@gmgigi96 gmgigi96 requested a review from labkode as a code owner June 3, 2021 14:05
@update-docs
Copy link

update-docs bot commented Jun 3, 2021

Thanks for opening this pull request! The maintainers of this repository would appreciate it if you would create a changelog item based on your changes.

labkode
labkode previously approved these changes Jun 3, 2021
@labkode
Copy link
Member

labkode commented Jun 4, 2021

@gmgigi96 please provide a changelog as per CI

@ishank011
Copy link
Contributor

@gmgigi96 I don't see the echo output, just the command invocation even though my version is lower than the recommended one

$ make build                                                                              [12:22:29]
GOPROXY=off
echo BUILD_DATE=`date +%FT%T%z`
BUILD_DATE=2021-06-04T12:22:33+0200
echo GIT_COMMIT=`git rev-parse --short HEAD`
GIT_COMMIT=288eafd9
echo GIT_DIRTY=`git diff-index --quiet HEAD -- || echo "dirty-"`
GIT_DIRTY=dirty-
echo VERSION=`git describe --always`
VERSION=v1.7.0-65-g288eafd9
echo GO_VERSION=1.15.0
GO_VERSION=1.15.0
`go env GOPATH`/bin/goimports -w tools pkg internal cmd
echo -e "1.16.2\n15.0" | sort -Vc &> /dev/null || echo -e "\n\033[33;5m[WARNING]\033[0m You are using a not supported go version. Please use 1.16.2 or above.\n"
go build -ldflags "-X main.gitCommit=`git rev-parse --short HEAD` -X main.version=`git describe --always` -X main.goVersion=1.15.0 -X main.buildDate=`date +%FT%T%z`" -o ./cmd/revad/revad ./cmd/revad
go build -ldflags "-X main.gitCommit=`git rev-parse --short HEAD` -X main.version=`git describe --always` -X main.goVersion=1.15.0 -X main.buildDate=`date +%FT%T%z`" -o ./cmd/reva/reva ./cmd/reva

@gmgigi96
Copy link
Member Author

gmgigi96 commented Jun 4, 2021

@ishank011 could you paste me your go version output?

@ishank011
Copy link
Contributor

I set GO_VERSION manually to 1.15.0 to test it

@ishank011
Copy link
Contributor

ishank011 commented Jun 4, 2021

Ah my bad. It's supposed to be go1.15.0. Works now. Can you add @ before echo to suppress the command invocation?

@gmgigi96
Copy link
Member Author

gmgigi96 commented Jun 4, 2021

I set GO_VERSION manually to 1.15.0 to test it

I was asking because in my machine and other different machines the third argument of go version is go<version>, so to work the variable should be set to go1.15.0...
Maybe try to change the MINIMUM_GO_VERSION variable to test it

@gmgigi96
Copy link
Member Author

gmgigi96 commented Jun 4, 2021

Ah my bad. It's supposed to be go1.15.0. Works now. Can you add @ before echo to suppress the command invocation?

Of course, thanks

@gmgigi96
Copy link
Member Author

gmgigi96 commented Jun 4, 2021

Ah my bad. It's supposed to be go1.15.0. Works now. Can you add @ before echo to suppress the command invocation?

Now should work also if you don't put go before the version

Makefile Outdated Show resolved Hide resolved
grammar correction

Co-authored-by: Ishank Arora <ishank011@gmail.com>
@ishank011 ishank011 merged commit 6ace58c into cs3org:master Jun 4, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Warn user in Makefile when they are not on recommended go version
3 participants