Skip to content

Commit 423cd40

Browse files
authored
Merge pull request #5474 from dmcgowan/1.5-cherry-pick-build-updates
[release/1.5] Backport build updates
2 parents c48044f + 3a86110 commit 423cd40

7 files changed

Lines changed: 39 additions & 36 deletions

File tree

.github/workflows/ci.yml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ jobs:
2020

2121
strategy:
2222
matrix:
23-
go-version: [1.16.3]
23+
go-version: [1.16.4]
2424
os: [ubuntu-18.04, macos-10.15, windows-2019]
2525

2626
steps:
@@ -73,7 +73,7 @@ jobs:
7373
steps:
7474
- uses: actions/setup-go@v2
7575
with:
76-
go-version: '1.16.3'
76+
go-version: '1.16.4'
7777

7878
- uses: actions/checkout@v2
7979
with:
@@ -106,7 +106,7 @@ jobs:
106106
steps:
107107
- uses: actions/setup-go@v2
108108
with:
109-
go-version: '1.16.3'
109+
go-version: '1.16.4'
110110

111111
- name: Set env
112112
shell: bash
@@ -152,7 +152,7 @@ jobs:
152152
steps:
153153
- uses: actions/setup-go@v2
154154
with:
155-
go-version: '1.16.3'
155+
go-version: '1.16.4'
156156
- name: Set env
157157
shell: bash
158158
run: |
@@ -217,7 +217,7 @@ jobs:
217217
strategy:
218218
matrix:
219219
os: [ubuntu-18.04, macos-10.15, windows-2019]
220-
go-version: ['1.16.3']
220+
go-version: ['1.16.4']
221221
include:
222222
# Go 1.13.x is still used by Docker/Moby
223223
- go-version: '1.13.x'
@@ -263,7 +263,7 @@ jobs:
263263
steps:
264264
- uses: actions/setup-go@v2
265265
with:
266-
go-version: '1.16.3'
266+
go-version: '1.16.4'
267267

268268
- uses: actions/checkout@v2
269269
with:
@@ -344,7 +344,7 @@ jobs:
344344
steps:
345345
- uses: actions/setup-go@v2
346346
with:
347-
go-version: '1.16.3'
347+
go-version: '1.16.4'
348348

349349
- uses: actions/checkout@v2
350350
with:
@@ -495,7 +495,7 @@ jobs:
495495
steps:
496496
- uses: actions/setup-go@v2
497497
with:
498-
go-version: '1.16.3'
498+
go-version: '1.16.4'
499499

500500
- uses: actions/checkout@v2
501501
with:

.github/workflows/nightly.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ jobs:
1818
steps:
1919
- uses: actions/setup-go@v2
2020
with:
21-
go-version: '1.16.3'
21+
go-version: '1.16.4'
2222

2323
- uses: actions/checkout@v2
2424
with:
@@ -135,7 +135,7 @@ jobs:
135135
steps:
136136
- uses: actions/setup-go@v2
137137
with:
138-
go-version: '1.16.3'
138+
go-version: '1.16.4'
139139

140140
- uses: actions/checkout@v2
141141
with:

.github/workflows/release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ jobs:
6262
- name: Install Go
6363
uses: actions/setup-go@v2
6464
with:
65-
go-version: '1.16.3'
65+
go-version: '1.16.4'
6666

6767
- name: Set env
6868
shell: bash

.zuul/playbooks/containerd-build/run.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
become: yes
33
roles:
44
- role: config-golang
5-
go_version: '1.16.3'
5+
go_version: '1.16.4'
66
arch: arm64
77
tasks:
88
- name: Build containerd

Makefile

Lines changed: 25 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@
1313
# limitations under the License.
1414

1515

16+
# Go command to use for build
17+
GO ?= go
18+
1619
# Root directory of the project (absolute path).
1720
ROOTDIR=$(dir $(abspath $(lastword $(MAKEFILE_LIST))))
1821

@@ -26,9 +29,9 @@ REVISION=$(shell git rev-parse HEAD)$(shell if ! git diff --no-ext-diff --quiet
2629
PACKAGE=github.com/containerd/containerd
2730
SHIM_CGO_ENABLED ?= 0
2831

29-
ifneq "$(strip $(shell command -v go 2>/dev/null))" ""
30-
GOOS ?= $(shell go env GOOS)
31-
GOARCH ?= $(shell go env GOARCH)
32+
ifneq "$(strip $(shell command -v $(GO) 2>/dev/null))" ""
33+
GOOS ?= $(shell $(GO) env GOOS)
34+
GOARCH ?= $(shell $(GO) env GOARCH)
3235
else
3336
ifeq ($(GOOS),)
3437
# approximate GOOS for the platform if we don't have Go and GOOS isn't
@@ -85,7 +88,7 @@ GO_LDFLAGS=-ldflags '-X $(PKG)/version.Version=$(VERSION) -X $(PKG)/version.Revi
8588
SHIM_GO_LDFLAGS=-ldflags '-X $(PKG)/version.Version=$(VERSION) -X $(PKG)/version.Revision=$(REVISION) -X $(PKG)/version.Package=$(PACKAGE) -extldflags "-static" $(EXTRA_LDFLAGS)'
8689

8790
# Project packages.
88-
PACKAGES=$(shell go list ${GO_TAGS} ./... | grep -v /vendor/ | grep -v /integration)
91+
PACKAGES=$(shell $(GO) list ${GO_TAGS} ./... | grep -v /vendor/ | grep -v /integration)
8992
TEST_REQUIRES_ROOT_PACKAGES=$(filter \
9093
${PACKAGES}, \
9194
$(shell \
@@ -122,7 +125,7 @@ TESTFLAGS ?= $(TESTFLAGS_RACE) $(EXTRA_TESTFLAGS)
122125
TESTFLAGS_PARALLEL ?= 8
123126

124127
# Use this to replace `go test` with, for instance, `gotestsum`
125-
GOTEST ?= go test
128+
GOTEST ?= $(GO) test
126129

127130
OUTPUTDIR = $(join $(ROOTDIR), _output)
128131
CRIDIR=$(OUTPUTDIR)/cri
@@ -143,7 +146,7 @@ AUTHORS: .mailmap .git/HEAD
143146

144147
generate: protos
145148
@echo "$(WHALE) $@"
146-
@PATH="${ROOTDIR}/bin:${PATH}" go generate -x ${PACKAGES}
149+
@PATH="${ROOTDIR}/bin:${PATH}" $(GO) generate -x ${PACKAGES}
147150

148151
protos: bin/protoc-gen-gogoctrd ## generate protobuf
149152
@echo "$(WHALE) $@"
@@ -170,7 +173,7 @@ proto-fmt: ## check format of proto files
170173

171174
build: ## build the go packages
172175
@echo "$(WHALE) $@"
173-
@go build ${DEBUG_GO_GCFLAGS} ${GO_GCFLAGS} ${GO_BUILD_FLAGS} ${EXTRA_FLAGS} ${GO_LDFLAGS} ${PACKAGES}
176+
@$(GO) build ${DEBUG_GO_GCFLAGS} ${GO_GCFLAGS} ${GO_BUILD_FLAGS} ${EXTRA_FLAGS} ${GO_LDFLAGS} ${PACKAGES}
174177

175178
test: ## run tests, except integration tests and tests that require root
176179
@echo "$(WHALE) $@"
@@ -182,12 +185,12 @@ root-test: ## run tests, except integration tests
182185

183186
integration: ## run integration tests
184187
@echo "$(WHALE) $@"
185-
@cd "${ROOTDIR}/integration/client" && go mod download && $(GOTEST) -v ${TESTFLAGS} -test.root -parallel ${TESTFLAGS_PARALLEL} .
188+
@cd "${ROOTDIR}/integration/client" && $(GO) mod download && $(GOTEST) -v ${TESTFLAGS} -test.root -parallel ${TESTFLAGS_PARALLEL} .
186189

187190
# TODO integrate cri integration bucket with coverage
188191
bin/cri-integration.test:
189192
@echo "$(WHALE) $@"
190-
@go test -c ./integration -o bin/cri-integration.test
193+
@$(GO) test -c ./integration -o bin/cri-integration.test
191194

192195
cri-integration: binaries bin/cri-integration.test ## run cri integration tests
193196
@echo "$(WHALE) $@"
@@ -196,13 +199,13 @@ cri-integration: binaries bin/cri-integration.test ## run cri integration tests
196199

197200
benchmark: ## run benchmarks tests
198201
@echo "$(WHALE) $@"
199-
@go test ${TESTFLAGS} -bench . -run Benchmark -test.root
202+
@$(GO) test ${TESTFLAGS} -bench . -run Benchmark -test.root
200203

201204
FORCE:
202205

203206
define BUILD_BINARY
204207
@echo "$(WHALE) $@"
205-
@go build ${DEBUG_GO_GCFLAGS} ${GO_GCFLAGS} ${GO_BUILD_FLAGS} -o $@ ${GO_LDFLAGS} ${GO_TAGS} ./$<
208+
@$(GO) build ${DEBUG_GO_GCFLAGS} ${GO_GCFLAGS} ${GO_BUILD_FLAGS} -o $@ ${GO_LDFLAGS} ${GO_TAGS} ./$<
206209
endef
207210

208211
# Build a binary from a cmd.
@@ -211,15 +214,15 @@ bin/%: cmd/% FORCE
211214

212215
bin/containerd-shim: cmd/containerd-shim FORCE # set !cgo and omit pie for a static shim build: https://github.com/golang/go/issues/17789#issuecomment-258542220
213216
@echo "$(WHALE) bin/containerd-shim"
214-
@CGO_ENABLED=${SHIM_CGO_ENABLED} go build ${GO_BUILD_FLAGS} -o bin/containerd-shim ${SHIM_GO_LDFLAGS} ${GO_TAGS} ./cmd/containerd-shim
217+
@CGO_ENABLED=${SHIM_CGO_ENABLED} $(GO) build ${GO_BUILD_FLAGS} -o bin/containerd-shim ${SHIM_GO_LDFLAGS} ${GO_TAGS} ./cmd/containerd-shim
215218

216219
bin/containerd-shim-runc-v1: cmd/containerd-shim-runc-v1 FORCE # set !cgo and omit pie for a static shim build: https://github.com/golang/go/issues/17789#issuecomment-258542220
217220
@echo "$(WHALE) bin/containerd-shim-runc-v1"
218-
@CGO_ENABLED=${SHIM_CGO_ENABLED} go build ${GO_BUILD_FLAGS} -o bin/containerd-shim-runc-v1 ${SHIM_GO_LDFLAGS} ${GO_TAGS} ./cmd/containerd-shim-runc-v1
221+
@CGO_ENABLED=${SHIM_CGO_ENABLED} $(GO) build ${GO_BUILD_FLAGS} -o bin/containerd-shim-runc-v1 ${SHIM_GO_LDFLAGS} ${GO_TAGS} ./cmd/containerd-shim-runc-v1
219222

220223
bin/containerd-shim-runc-v2: cmd/containerd-shim-runc-v2 FORCE # set !cgo and omit pie for a static shim build: https://github.com/golang/go/issues/17789#issuecomment-258542220
221224
@echo "$(WHALE) bin/containerd-shim-runc-v2"
222-
@CGO_ENABLED=${SHIM_CGO_ENABLED} go build ${GO_BUILD_FLAGS} -o bin/containerd-shim-runc-v2 ${SHIM_GO_LDFLAGS} ${GO_TAGS} ./cmd/containerd-shim-runc-v2
225+
@CGO_ENABLED=${SHIM_CGO_ENABLED} $(GO) build ${GO_BUILD_FLAGS} -o bin/containerd-shim-runc-v2 ${SHIM_GO_LDFLAGS} ${GO_TAGS} ./cmd/containerd-shim-runc-v2
223226

224227
binaries: $(BINARIES) ## build binaries
225228
@echo "$(WHALE) $@"
@@ -235,11 +238,11 @@ genman: man/containerd.8 man/ctr.8
235238

236239
man/containerd.8: FORCE
237240
@echo "$(WHALE) $@"
238-
go run cmd/gen-manpages/main.go $(@F) $(@D)
241+
$(GO) run cmd/gen-manpages/main.go $(@F) $(@D)
239242

240243
man/ctr.8: FORCE
241244
@echo "$(WHALE) $@"
242-
go run cmd/gen-manpages/main.go $(@F) $(@D)
245+
$(GO) run cmd/gen-manpages/main.go $(@F) $(@D)
243246

244247
man/%: docs/man/%.md FORCE
245248
@echo "$(WHALE) $@"
@@ -365,9 +368,9 @@ endif
365368
coverage: ## generate coverprofiles from the unit tests, except tests that require root
366369
@echo "$(WHALE) $@"
367370
@rm -f coverage.txt
368-
@go test -i ${TESTFLAGS} ${PACKAGES} 2> /dev/null
371+
@$(GO) test -i ${TESTFLAGS} ${PACKAGES} 2> /dev/null
369372
@( for pkg in ${PACKAGES}; do \
370-
go test ${TESTFLAGS} \
373+
$(GO) test ${TESTFLAGS} \
371374
-cover \
372375
-coverprofile=profile.out \
373376
-covermode=atomic $$pkg || exit; \
@@ -379,9 +382,9 @@ coverage: ## generate coverprofiles from the unit tests, except tests that requi
379382

380383
root-coverage: ## generate coverage profiles for unit tests that require root
381384
@echo "$(WHALE) $@"
382-
@go test -i ${TESTFLAGS} ${TEST_REQUIRES_ROOT_PACKAGES} 2> /dev/null
385+
@$(GO) test -i ${TESTFLAGS} ${TEST_REQUIRES_ROOT_PACKAGES} 2> /dev/null
383386
@( for pkg in ${TEST_REQUIRES_ROOT_PACKAGES}; do \
384-
go test ${TESTFLAGS} \
387+
$(GO) test ${TESTFLAGS} \
385388
-cover \
386389
-coverprofile=profile.out \
387390
-covermode=atomic $$pkg -test.root || exit; \
@@ -393,8 +396,8 @@ root-coverage: ## generate coverage profiles for unit tests that require root
393396

394397
vendor: ## vendor
395398
@echo "$(WHALE) $@"
396-
@go mod tidy
397-
@go mod vendor
399+
@$(GO) mod tidy
400+
@$(GO) mod vendor
398401

399402
help: ## this help
400403
@awk 'BEGIN {FS = ":.*?## "} /^[a-zA-Z_-]+:.*?## / {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}' $(MAKEFILE_LIST) | sort

Vagrantfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ Vagrant.configure("2") do |config|
7777
config.vm.provision "install-golang", type: "shell", run: "once" do |sh|
7878
sh.upload_path = "/tmp/vagrant-install-golang"
7979
sh.env = {
80-
'GO_VERSION': ENV['GO_VERSION'] || "1.16.3",
80+
'GO_VERSION': ENV['GO_VERSION'] || "1.16.4",
8181
}
8282
sh.inline = <<~SHELL
8383
#!/usr/bin/env bash

contrib/Dockerfile.test

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
#
1111
# docker build -t containerd-test --build-arg RUNC_VERSION=v1.0.0-rc93 -f Dockerfile.test ../
1212

13-
ARG GOLANG_VERSION=1.16.3
13+
ARG GOLANG_VERSION=1.16.4
1414

1515
FROM golang:${GOLANG_VERSION} AS golang-base
1616
RUN mkdir -p /go/src/github.com/containerd/containerd

0 commit comments

Comments
 (0)