summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChangqing Li <changqing.li@windriver.com>2024-04-24 16:11:55 +0800
committerBruce Ashfield <bruce.ashfield@gmail.com>2024-05-02 18:16:26 +0000
commit829dc1f9b4035bd988c7c4d6905fcb43144d92c1 (patch)
treedb179e0f1ea389deeae327d8933ed92d7dc9f426
parent0ad7db7dbd2f355288a239009b32375569103e04 (diff)
downloadmeta-virtualization-829dc1f9b4035bd988c7c4d6905fcb43144d92c1.tar.gz
cni: pass BuildVersion info to avoid runtime warning
The default value of BuildVersion is 'unknown' and it requires an override at link time to embed such version info into binary. Signed-off-by: Chen Qi <Qi.Chen@windriver.com> Signed-off-by: Changqing Li <changqing.li@windriver.com> Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com>
-rw-r--r--recipes-networking/cni/cni_git.bb3
1 files changed, 2 insertions, 1 deletions
diff --git a/recipes-networking/cni/cni_git.bb b/recipes-networking/cni/cni_git.bb
index fda7af60..b41b47cf 100644
--- a/recipes-networking/cni/cni_git.bb
+++ b/recipes-networking/cni/cni_git.bb
@@ -34,6 +34,7 @@ LIC_FILES_CHKSUM = "file://src/import/LICENSE;md5=fa818a259cbed7ce8bc2a22d35a464
34GO_IMPORT = "import" 34GO_IMPORT = "import"
35 35
36PV = "v1.2.0-rc0+git${SRCREV_cni}" 36PV = "v1.2.0-rc0+git${SRCREV_cni}"
37CNI_VERSION = "v1.2.0"
37 38
38inherit go 39inherit go
39inherit goarch 40inherit goarch
@@ -68,7 +69,7 @@ do_compile() {
68 for p in $PLUGINS; do 69 for p in $PLUGINS; do
69 plugin="$(basename "$p")" 70 plugin="$(basename "$p")"
70 echo "building: $p" 71 echo "building: $p"
71 ${GO} build ${GOBUILDFLAGS} -o ${B}/plugins/bin/$plugin github.com/containernetworking/plugins/$p 72 ${GO} build ${GOBUILDFLAGS} -ldflags '-X github.com/containernetworking/plugins/pkg/utils/buildversion.BuildVersion=${CNI_VERSION}' -o ${B}/plugins/bin/$plugin github.com/containernetworking/plugins/$p
72 done 73 done
73} 74}
74 75