summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChen Qi <Qi.Chen@windriver.com>2025-01-14 21:46:39 -0800
committerBruce Ashfield <bruce.ashfield@gmail.com>2025-01-17 19:17:10 +0000
commit3763a3a9a61a3a20941341b2a45a651943c8a429 (patch)
tree16e4ec32cb19cc0e9fa47df2a454f7a60a6ddd7d
parent7834a259adaca56f707cfa29d3093b75ddff9b11 (diff)
downloadmeta-virtualization-3763a3a9a61a3a20941341b2a45a651943c8a429.tar.gz
cri-o: fix textrel QA issue
Basically we pass "-buildmode=pie" to fix textrel QA issue. A new patch is added and submitted to upstream: 0001-Makefile-introduce-GO_TEST-for-more-flexible-configu.patch. With this new patch, the old patch, 0001-Add-trimpath-to-build-nri.test.patch, could be dropped. Signed-off-by: Chen Qi <Qi.Chen@windriver.com> Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com>
-rw-r--r--recipes-containers/cri-o/cri-o_git.bb8
-rw-r--r--recipes-containers/cri-o/files/0001-Makefile-introduce-GO_TEST-for-more-flexible-configu.patch41
2 files changed, 46 insertions, 3 deletions
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
17SRCREV_cri-o = "33d75981bee230f791709975125d7386fe2c530a" 17SRCREV_cri-o = "33d75981bee230f791709975125d7386fe2c530a"
18SRC_URI = "\ 18SRC_URI = "\
19 git://github.com/kubernetes-sigs/cri-o.git;branch=release-1.31;name=cri-o;protocol=https;destsuffix=${GO_SRCURI_DESTSUFFIX} \ 19 git://github.com/kubernetes-sigs/cri-o.git;branch=release-1.31;name=cri-o;protocol=https;destsuffix=${GO_SRCURI_DESTSUFFIX} \
20 file://0001-Add-trimpath-to-build-nri.test.patch \ 20 file://0001-Makefile-introduce-GO_TEST-for-more-flexible-configu.patch;patchdir=src/import \
21 file://crio.conf \ 21 file://crio.conf \
22 file://run-ptest \ 22 file://run-ptest \
23 " 23 "
@@ -61,6 +61,9 @@ inherit pkgconfig
61inherit container-host 61inherit container-host
62 62
63EXTRA_OEMAKE = "BUILDTAGS='' DEBUG=1 STRIP=true" 63EXTRA_OEMAKE = "BUILDTAGS='' DEBUG=1 STRIP=true"
64# avoid textrel QA issue
65EXTRA_OEMAKE += "GO_BUILD='${GO} build -trimpath -buildmode=pie'"
66EXTRA_OEMAKE += "GO_TEST='${GO} test -trimpath -buildmode=pie'"
64 67
65do_compile() { 68do_compile() {
66 set +e 69 set +e
@@ -121,8 +124,7 @@ FILES:${PN} += "${systemd_unitdir}/system/*"
121FILES:${PN} += "/usr/local/bin/*" 124FILES:${PN} += "/usr/local/bin/*"
122FILES:${PN} += "/usr/share/containers/oci/hooks.d" 125FILES:${PN} += "/usr/share/containers/oci/hooks.d"
123 126
124INSANE_SKIP:${PN} += "ldflags textrel" 127INSANE_SKIP:${PN}-ptest += "ldflags"
125INSANE_SKIP:${PN}-ptest += "textrel"
126 128
127RDEPENDS:${PN}-ptest += " \ 129RDEPENDS:${PN}-ptest += " \
128 bash \ 130 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 @@
1From 656cb24b07b1e5b63939c15dc31d8c9839ecce75 Mon Sep 17 00:00:00 2001
2From: Chen Qi <Qi.Chen@windriver.com>
3Date: Tue, 14 Jan 2025 20:55:50 -0800
4Subject: [PATCH] Makefile: introduce GO_TEST for more flexible configuration
5
6Introduce GO_TEST and make it similar to GO_BUILD.
7
8Note that with this change, the default behavior changes a little bit,
9that is, TRIMPATH, GCFLAGS and GO_LDFALGS all have effect on test/nri/nri.test.
10
11Upstream-Status: Submitted [https://github.com/cri-o/cri-o/pull/8912]
12
13Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
14---
15 Makefile | 3 ++-
16 1 file changed, 2 insertions(+), 1 deletion(-)
17
18diff --git a/Makefile b/Makefile
19index 34f9d429d..f02213894 100644
20--- a/Makefile
21+++ b/Makefile
22@@ -3,6 +3,7 @@ GO ?= go
23 TRIMPATH ?= -trimpath
24 GO_ARCH=$(shell $(GO) env GOARCH)
25 GO_BUILD ?= $(GO) build $(TRIMPATH)
26+GO_TEST ?= $(GO) test $(TRIMPATH)
27 GO_RUN ?= $(GO) run
28 NIX_IMAGE ?= nixos/nix:2.24.3
29
30@@ -213,7 +214,7 @@ test/checkcriu/checkcriu: $(GO_FILES) ## Build the checkcriu test binary.
31 $(GO_BUILD) $(GCFLAGS) $(GO_LDFLAGS) -tags "$(BUILDTAGS)" -o $@ ./test/checkcriu
32
33 test/nri/nri.test: $(wildcard test/nri/*.go) ## Build the NRI test binary.
34- $(GO) test --tags "test $(BUILDTAGS)" -c ./test/nri -o $@
35+ $(GO_TEST) $(GCFLAGS) $(GO_LDFLAGS) --tags "test $(BUILDTAGS)" -c ./test/nri -o $@
36
37 bin/crio: $(GO_FILES) ## Build the CRI-O main binary.
38 $(GO_BUILD) $(GCFLAGS) $(GO_LDFLAGS) -tags "$(BUILDTAGS)" -o $@ ./cmd/crio
39--
402.25.1
41