diff --git a/recipes-containers/cri-o/cri-o_git.bb b/recipes-containers/cri-o/cri-o_git.bb index 6fdd58a1..1ef32ab0 100644 --- a/recipes-containers/cri-o/cri-o_git.bb +++ b/recipes-containers/cri-o/cri-o_git.bb @@ -17,7 +17,7 @@ At a high level, we expect the scope of cri-o to be restricted to the following SRCREV_cri-o = "33d75981bee230f791709975125d7386fe2c530a" SRC_URI = "\ git://github.com/kubernetes-sigs/cri-o.git;branch=release-1.31;name=cri-o;protocol=https;destsuffix=${GO_SRCURI_DESTSUFFIX} \ - file://0001-Add-trimpath-to-build-nri.test.patch \ + file://0001-Makefile-introduce-GO_TEST-for-more-flexible-configu.patch;patchdir=src/import \ file://crio.conf \ file://run-ptest \ " @@ -61,6 +61,9 @@ inherit pkgconfig inherit container-host EXTRA_OEMAKE = "BUILDTAGS='' DEBUG=1 STRIP=true" +# avoid textrel QA issue +EXTRA_OEMAKE += "GO_BUILD='${GO} build -trimpath -buildmode=pie'" +EXTRA_OEMAKE += "GO_TEST='${GO} test -trimpath -buildmode=pie'" do_compile() { set +e @@ -121,8 +124,7 @@ FILES:${PN} += "${systemd_unitdir}/system/*" FILES:${PN} += "/usr/local/bin/*" FILES:${PN} += "/usr/share/containers/oci/hooks.d" -INSANE_SKIP:${PN} += "ldflags textrel" -INSANE_SKIP:${PN}-ptest += "textrel" +INSANE_SKIP:${PN}-ptest += "ldflags" RDEPENDS:${PN}-ptest += " \ bash \ diff --git a/recipes-containers/cri-o/files/0001-Makefile-introduce-GO_TEST-for-more-flexible-configu.patch b/recipes-containers/cri-o/files/0001-Makefile-introduce-GO_TEST-for-more-flexible-configu.patch new file mode 100644 index 00000000..33c65b5a --- /dev/null +++ b/recipes-containers/cri-o/files/0001-Makefile-introduce-GO_TEST-for-more-flexible-configu.patch @@ -0,0 +1,41 @@ +From 656cb24b07b1e5b63939c15dc31d8c9839ecce75 Mon Sep 17 00:00:00 2001 +From: Chen Qi +Date: Tue, 14 Jan 2025 20:55:50 -0800 +Subject: [PATCH] Makefile: introduce GO_TEST for more flexible configuration + +Introduce GO_TEST and make it similar to GO_BUILD. + +Note that with this change, the default behavior changes a little bit, +that is, TRIMPATH, GCFLAGS and GO_LDFALGS all have effect on test/nri/nri.test. + +Upstream-Status: Submitted [https://github.com/cri-o/cri-o/pull/8912] + +Signed-off-by: Chen Qi +--- + Makefile | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/Makefile b/Makefile +index 34f9d429d..f02213894 100644 +--- a/Makefile ++++ b/Makefile +@@ -3,6 +3,7 @@ GO ?= go + TRIMPATH ?= -trimpath + GO_ARCH=$(shell $(GO) env GOARCH) + GO_BUILD ?= $(GO) build $(TRIMPATH) ++GO_TEST ?= $(GO) test $(TRIMPATH) + GO_RUN ?= $(GO) run + NIX_IMAGE ?= nixos/nix:2.24.3 + +@@ -213,7 +214,7 @@ test/checkcriu/checkcriu: $(GO_FILES) ## Build the checkcriu test binary. + $(GO_BUILD) $(GCFLAGS) $(GO_LDFLAGS) -tags "$(BUILDTAGS)" -o $@ ./test/checkcriu + + test/nri/nri.test: $(wildcard test/nri/*.go) ## Build the NRI test binary. +- $(GO) test --tags "test $(BUILDTAGS)" -c ./test/nri -o $@ ++ $(GO_TEST) $(GCFLAGS) $(GO_LDFLAGS) --tags "test $(BUILDTAGS)" -c ./test/nri -o $@ + + bin/crio: $(GO_FILES) ## Build the CRI-O main binary. + $(GO_BUILD) $(GCFLAGS) $(GO_LDFLAGS) -tags "$(BUILDTAGS)" -o $@ ./cmd/crio +-- +2.25.1 +