-
Notifications
You must be signed in to change notification settings - Fork 202
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
Makefile: simplify for modern Go #993
Conversation
close/reopen to restart ci |
69ad0a8
to
1e2b319
Compare
I have no idea why fedora-35 ci times out 😕 |
The tests timed out, can you increase the timeout in cirrus and re-push again please? |
Currently, Fedora CI job often times out after 30m. Signed-off-by: Kir Kolyshkin <[email protected]>
LGTM |
/lgtm |
@jwhonce: changing LGTM is restricted to collaborators In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
Interesting; when I increased the timeout from 30m to 60m, it succeeded in 25m 😕 and previously it was always timing out. |
In any case, 25m is dangerously close to 30m so let's bump it to 60m just in case (no one likes flaky CI). |
Quite a few changes, mostly removing old stuff though. 1. "GO111MODULE=off" is no longer required to be set by default (and it used to be overridden below anyway). 2. "go build" no longer requires explicit "-mod=vendor", as this is the default since go 1.14. 3. GOPROXY is set to proxy.golang.org by default since go 1.13. 4. Always use default GOPATH (which is $HOME/go since Go 1.8; earlier releases needed to set it explicitly). 5. Drop the code that handles multiple comma-separated GOPATH elements (when using modules, GOPATH is no longer used for resolving imports, which basically means using multiple paths is useless). 6. Drop go-get macro (which is used to install md2man), use go install directly (supported since Go 1.16). While at it, do not check if go-md2man is available, install it unconditionally. This removes the need to have GOBIN make variable. 7. Remove GOPKGBASEDIR and GOPKGBASEDIR, defined by Makefile, were never used. 8. Rm PROJECT, use relative paths in test-unit target. Signed-off-by: Kir Kolyshkin <[email protected]>
Just added one more simplification. Since github does not show diffs between revisions, here is it: diff --git a/Makefile b/Makefile
index 1d049685..11100ba9 100644
--- a/Makefile
+++ b/Makefile
@@ -4,7 +4,6 @@ BUILDTAGS := containers_image_openpgp,systemd,exclude_graphdriver_devicemapper
DESTDIR ?=
PREFIX := /usr/local
CONFIGDIR := ${PREFIX}/share/containers
-PROJECT := github.com/containers/common
define go-build
CGO_ENABLED=0 \
@@ -93,8 +92,8 @@ test: test-unit
test-unit:
go test --tags $(BUILDTAGS) -v ./libimage
go test --tags $(BUILDTAGS) -v ./libnetwork/...
- go test --tags $(BUILDTAGS) -v $(PROJECT)/pkg/...
- go test --tags remote,seccomp,$(BUILDTAGS) -v $(PROJECT)/pkg/...
+ go test --tags $(BUILDTAGS) -v ./pkg/...
+ go test --tags remote,seccomp,$(BUILDTAGS) -v ./pkg/...
.PHONY: codespell
codespell: |
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, thank you!
/approve |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: kolyshkin, rhatdan The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Quite a few changes, mostly removing old stuff though.
"GO111MODULE=off" is no longer required to be set by default (and
it used to be overridden below anyway).
"go build" no longer requires explicit "-mod=vendor", as this is the
default since go 1.14.
GOPROXY is set to proxy.golang.org by default since go 1.13.
Always use default GOPATH (which is $HOME/go since Go 1.8; earlier
releases needed to set it explicitly).
Drop the code that handles multiple comma-separated GOPATH elements
(when using modules, GOPATH is no longer used for resolving imports,
which basically means using multiple paths is useless).
Drop go-get macro (which is used to install md2man), use go install
directly (supported since Go 1.16). While at it, do not check if
go-md2man is available, install it unconditionally. This removes
the need to have GOBIN make variable.
Remove GOPKGBASEDIR and GOPKGBASEDIR, defined by Makefile, were never
used.
Signed-off-by: Kir Kolyshkin [email protected]