-
Notifications
You must be signed in to change notification settings - Fork 181
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
fix: Have make file fail with wrong go version #785
Conversation
Since we have set the go module to have min go version of Line 3 in 40d9a15
running
which is expected. |
The problem is |
@@ -31,8 +32,8 @@ LDFLAGS += -X $(PROJECT_PKG)/internal/version.GitCommit=${GIT_COMMIT} | |||
LDFLAGS += -X $(PROJECT_PKG)/internal/version.GitTreeState=${GIT_DIRTY} | |||
|
|||
.PHONY: test | |||
test: vendor check-encoding | |||
go test -race -v -coverprofile=coverage.txt -covermode=atomic ./... | |||
test: tidy vendor check-encoding |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is a problem. If someone opens a PR and messes the go.mod
and go.sum
files, calling go mod tidy
in make test
may not detect this kind of issue in the PR check.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not entirely sure what you mean by messes. Changes?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, but it seems no harm for now.
Makefile
Outdated
@@ -17,6 +17,7 @@ CLI_PKG = $(PROJECT_PKG)/cmd/oras | |||
GIT_COMMIT = $(shell git rev-parse HEAD) | |||
GIT_TAG = $(shell git describe --tags --abbrev=0 --exact-match 2>/dev/null) | |||
GIT_DIRTY = $(shell test -n "`git status --porcelain`" && echo "dirty" || echo "clean") | |||
GO=go |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am assuming that you are managing Go installations according to https://go.dev/doc/manage-install.
I think it would be better to make the variable consistent:
GO=go | |
GO_EXE = go |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure thing.
I'm running my old go builds for various reasons.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
Signed-off-by: Terry Howe <tlhowe@amazon.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
@@ -31,8 +32,8 @@ LDFLAGS += -X $(PROJECT_PKG)/internal/version.GitCommit=${GIT_COMMIT} | |||
LDFLAGS += -X $(PROJECT_PKG)/internal/version.GitTreeState=${GIT_DIRTY} | |||
|
|||
.PHONY: test | |||
test: vendor check-encoding | |||
go test -race -v -coverprofile=coverage.txt -covermode=atomic ./... | |||
test: tidy vendor check-encoding |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, but it seems no harm for now.
Latest command
oras repository ls
requires go 1.20