[meta-virtualization][PATCH 15/15] podman: improve reproducibility

<[email protected]>
Newsgroups org.yoctoproject.lists.meta-virtualization
Message-ID <[email protected]>
From: Changqing Li <[email protected]>

* set go buildid to empty for improving reproducibility
* set -buildvcs=false to improve reproducibility. do_compile will
  generate several binaries, when -buildvcs=true, check with command "go
version -m binray", some binraies with vcs.modified=false and clean mod
version,  some binaries with vcs.modified=true, and mod version append
with "+dirty", and the result is random. But actually, the git tree is
clean. It seems go have a different way to define clean repo. Just
disable buildvcs for improving reproducibility

Signed-off-by: Changqing Li <[email protected]>
---
 recipes-containers/podman/podman_git.bb | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/recipes-containers/podman/podman_git.bb b/recipes-containers/podman/podman_git.bb
index f09e01f8..06d1f3df 100644
--- a/recipes-containers/podman/podman_git.bb
+++ b/recipes-containers/podman/podman_git.bb
@@ -48,7 +48,7 @@ export LDFLAGS = ""
 TOOLCHAIN = "gcc"
 
 # podmans Makefile expects BUILDFLAGS to be set but go.bbclass defines them in GOBUILDFLAGS
-export BUILDFLAGS = "${GOBUILDFLAGS}"
+export BUILDFLAGS = "${GOBUILDFLAGS} -buildvcs=false"
 
 inherit go goarch
 inherit container-host
@@ -91,6 +91,8 @@ do_compile() {
 	export CGO_CFLAGS="${CFLAGS} --sysroot=${STAGING_DIR_TARGET}"
 	export CGO_LDFLAGS="${LDFLAGS} --sysroot=${STAGING_DIR_TARGET}"
 
+	export EXTRA_LDFLAGS="-buildid="
+
 	# podman now builds go-md2man and requires the host/build details
 	export NATIVE_GOOS=${BUILD_GOOS}
 	export NATIVE_GOARCH=${BUILD_GOARCH}
-- 
2.34.1
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.