From be7ad386c2fc6e57ff011f5fa931880e589971ce Mon Sep 17 00:00:00 2001 From: Michael McCracken Date: Fri, 10 Jan 2025 17:09:06 -0800 Subject: [PATCH] chore: build umoci directly for tests Instead of using `go get` which now does nothing after moving to 1.22, or `go install` which fails in github CI, let's just clone and build umoci ourselves. Signed-off-by: Michael McCracken --- Makefile | 10 +++++++++- install-build-deps.sh | 1 - 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 8952655d..b9adf085 100644 --- a/Makefile +++ b/Makefile @@ -48,6 +48,8 @@ BATS_VERSION := v1.10.0 # OCI registry ZOT := $(TOOLS_D)/bin/zot ZOT_VERSION := v2.1.0 +UMOCI := $(TOOLS_D)/bin/umoci +UMOCI_VERSION := main export PATH := $(TOOLS_D)/bin:$(PATH) @@ -122,7 +124,7 @@ go-test: go tool cover -html coverage.txt -o $(HACK_D)/coverage.html .PHONY: download-tools -download-tools: $(GOLANGCI_LINT) $(REGCLIENT) $(ZOT) $(BATS) +download-tools: $(GOLANGCI_LINT) $(REGCLIENT) $(ZOT) $(BATS) $(UMOCI) $(GOLANGCI_LINT): @mkdir -p $(dir $@) @@ -160,6 +162,12 @@ $(BATS): cd bats-core; ./install.sh $(TOOLS_D); cd ..; \ rm -rf bats-core +$(UMOCI): + mkdir -p ${GOPATH}/src/github.com/opencontainers/ + git clone https://github.com/opencontainers/umoci.git ${GOPATH}/src/github.com/opencontainers/umoci + cd ${GOPATH}/src/github.com/opencontainers/umoci ; git reset --hard ${UMOCI_VERSION} ; make umoci ; mv umoci $(UMOCI) + $(UMOCI) --version + TEST?=$(patsubst test/%.bats,%,$(wildcard test/*.bats)) PRIVILEGE_LEVEL?= diff --git a/install-build-deps.sh b/install-build-deps.sh index b52b8ab3..e7cf38dd 100755 --- a/install-build-deps.sh +++ b/install-build-deps.sh @@ -108,7 +108,6 @@ EOF installdeps_golang() { go version - GO111MODULE=off go install github.com/opencontainers/umoci/cmd/umoci make download-tools make docker-clone make go-download