From c74707cbe4e18b1d309d9fd76dc8b702d640e350 Mon Sep 17 00:00:00 2001 From: Kir Kolyshkin Date: Tue, 5 Apr 2022 12:22:07 -0700 Subject: [PATCH 1/2] .cirrus.yml: increase the timeout to 60m Currently, Fedora CI job often times out after 30m. Signed-off-by: Kir Kolyshkin --- .cirrus.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.cirrus.yml b/.cirrus.yml index be8818661..520a8b007 100644 --- a/.cirrus.yml +++ b/.cirrus.yml @@ -27,7 +27,7 @@ env: # Default, hard-coded max timeout is 2-hours. -timeout_in: 30m # no need to wait 2-hours before timing out +timeout_in: 60m # no need to wait 2-hours before timing out gcp_credentials: ENCRYPTED[dd6a042d1805167e38d8b79494f691b86637e68f072eba24220901435afd8d71c63f9006803142447326319102f68b7f] From 1a23fcca17d9899797e5cd1ab3751787110e8ce0 Mon Sep 17 00:00:00 2001 From: Kir Kolyshkin Date: Wed, 30 Mar 2022 13:27:51 -0700 Subject: [PATCH 2/2] Makefile: simplify for modern Go 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 --- Makefile | 44 ++++++-------------------------------------- 1 file changed, 6 insertions(+), 38 deletions(-) diff --git a/Makefile b/Makefile index c914ecc16..11100ba99 100644 --- a/Makefile +++ b/Makefile @@ -1,39 +1,9 @@ -export GO111MODULE=off - GO ?= go GO_BUILD=$(GO) build -# Go module support: set `-mod=vendor` to use the vendored sources -ifeq ($(shell go help mod >/dev/null 2>&1 && echo true), true) - GO_BUILD=GO111MODULE=on $(GO) build -mod=vendor -endif BUILDTAGS := containers_image_openpgp,systemd,exclude_graphdriver_devicemapper DESTDIR ?= PREFIX := /usr/local CONFIGDIR := ${PREFIX}/share/containers -PROJECT := github.com/containers/common - -# Enforce the GOPROXY to make sure dependencies are resovled consistently -# across different environments. -export GOPROXY := https://proxy.golang.org - -# If GOPATH not specified, use one in the local directory -ifeq ($(GOPATH),) -export GOPATH := $(CURDIR)/_output -unexport GOBIN -endif -FIRST_GOPATH := $(firstword $(subst :, ,$(GOPATH))) -GOPKGDIR := $(FIRST_GOPATH)/src/$(PROJECT) -GOPKGBASEDIR ?= $(shell dirname "$(GOPKGDIR)") - -GOBIN := $(shell $(GO) env GOBIN) -ifeq ($(GOBIN),) -GOBIN := $(FIRST_GOPATH)/bin -endif - -define go-get - env GO111MODULE=off \ - $(GO) get -u ${1} -endef define go-build CGO_ENABLED=0 \ @@ -90,9 +60,9 @@ vendor-in-container: .PHONY: vendor vendor: - GO111MODULE=on $(GO) mod tidy - GO111MODULE=on $(GO) mod vendor - GO111MODULE=on $(GO) mod verify + $(GO) mod tidy + $(GO) mod vendor + $(GO) mod verify .PHONY: install.tools install.tools: build/golangci-lint .install.md2man @@ -106,9 +76,7 @@ build/golangci-lint: .install.md2man: - if [ ! -x "$(GOBIN)/go-md2man" ]; then \ - $(call go-get,github.com/cpuguy83/go-md2man); \ - fi + $(GO) install github.com/cpuguy83/go-md2man/v2@latest .PHONY: install install: @@ -124,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: