Re: [meta-virtualization][PATCH 00/15] set go buildid to empty for improving reproducibility
Changqing Li <[email protected]>
| Newsgroups | org.yoctoproject.lists.meta-virtualization |
|---|---|
| Message-ID | <[email protected]> |
On 1/14/26 22:13, Bruce Ashfield wrote: > ** > *CAUTION: This email comes from a non Wind River email account!* > Do not click links or open attachments unless you recognize the sender > and know the content is safe. > > > On Wed, Jan 14, 2026 at 12:05 AM Changqing Li > <[email protected]> wrote: > > > On 1/8/26 21:21, Bruce Ashfield wrote: >> ** >> *CAUTION: This email comes from a non Wind River email account!* >> Do not click links or open attachments unless you recognize the >> sender and know the content is safe. >> >> >> On Thu, Jan 8, 2026 at 1:26 AM Changqing Li via >> lists.yoctoproject.org >> <https://urldefense.com/v3/__http://lists.yoctoproject.org__;!!AjveYdw8EvQ!cbNtO-fTMjWd2OzmvTZIAie15dDo_FY3nqpvLRTvvQfXr7UevOCeAyVJRhJLLTrJW6bjrQaAFZmCsF_sHzefcUMGHw_79Q$> >> <changqing.li >> <https://urldefense.com/v3/__http://changqing.li__;!!AjveYdw8EvQ!cbNtO-fTMjWd2OzmvTZIAie15dDo_FY3nqpvLRTvvQfXr7UevOCeAyVJRhJLLTrJW6bjrQaAFZmCsF_sHzefcUMuaHYLRg$>[email protected]> >> wrote: >> >> From: Changqing Li <[email protected]> >> >> These series of patches are mostly set buildid to empty for >> improving >> reproducibility, I also send a patch to oe-core with subject: >> [PATCH V3] go.bbclass: set buildid to empty string to improve >> reproducibility >> >> which add -buildid= in default GO_LDFLAGS, but since packages >> compiled >> with go may not use GO_LDFLAGS in go.bbclass, they can have >> their own >> Makefiles, define their own variables for passing ldflags, so >> change >> them one by one. >> >> >> Rather than setting it to empty, I'd rather set it to a value >> that might >> be useful to us. >> >> Perhaps the git hash we are building ? or the checksum of another >> set of files ? > > Hi, Bruce > > The idea is good, for the recipes changed one by one in this series patch, maybe we can easily give them a value one by one. > > but for go.bbclass, I have two ideas: > > GO_BUILDID ?= ' -buildid="${@d.getVar('SRCREV') if d.getVar('SRCREV') != 'INVALID' else ( d.getVar('SRCREV_%s'%${PN}) if d.getVar('SRCREV_%s'%${PN}) != '' else ( d.getVarFlag('SRC_URI', 'sha256sum') if d.getvarflag('sha256sum') != '' if () else '') )}' > > This is complicated, andtheoretically speaking, not sure it always have a value. And do we really need this value, how to use it? > > GO_BUILDID ?= ' -buildid=d.getVar('PV') > > This can ensure it always have a value, but I think this is not very useful. usually, we can get version by "binray --version". > > > It isn't about getting the version, it is about traceability in more > of a CI/CD type environment > (and even in our layers where I don't bump by version, but use git > hashes more often) > > I view it similarly to the "latest" tag in containers. It is mainly > useful in development and CI type > environments, but at release real tags are used when doing a container. > > So capturing something about the build that is traceable and > reproducible is my goal. The > SRCREV of the recipe we are building is the obvious choice, even > though it is sometimes > captured in other places as well. > > I don't mind your GO_BUILDID concept, even if it doesn't go to the > main bbclass, we could > test it in meta-virt. Thanks for explanation. Richard also don't like to set it to empty. I will try to check if if this can be resolved by patching go. If it is not easy to patch, then try to make this GO_BUILDID concept better. //Changqing > > Bruce > > Consider above, how about set it to empty if we don't have special usage of this buildid? > > > > //Sandy > >> >> Bruce >> >> >> podman also disable buildvcs >> >> Changqing Li (15): >> docker-compose: set go buildid to empty for improving >> reproducibility >> docker: set go buildid to empty for improving reproducibility >> kubernetes: set go buildid to empty for improving >> reproducibility >> nerdctl: set go buildid to empty for improving reproducibility >> runc: set go buildid to empty for improving reproducibility >> skopeo: set go buildid to empty for improving reproducibility >> umoci: set go buildid to empty for improving reproducibility >> cni: update GO_EXTRA_LDFLAGS >> oci-image-tools: set go buildid to empty for improving >> reproducibility >> docker-distribution: set go buildid to empty for improving >> reproducibility >> containerd: set go buildid to empty for improving >> reproducibility >> cri-o: set go buildid to empty for improving reproducibility >> cri-tools: set go buildid to empty for improving >> reproducibility >> oci-runtime-tools: set go buildid to empty for improving >> reproducibility >> podman: improve reproducibility >> >> .../containerd/containerd_git.bb >> <https://urldefense.com/v3/__http://containerd_git.bb__;!!AjveYdw8EvQ!cbNtO-fTMjWd2OzmvTZIAie15dDo_FY3nqpvLRTvvQfXr7UevOCeAyVJRhJLLTrJW6bjrQaAFZmCsF_sHzefcUNo9zLiWA$> >> | 1 + >> recipes-containers/cri-o/cri-o_git.bb >> <https://urldefense.com/v3/__http://cri-o_git.bb__;!!AjveYdw8EvQ!cbNtO-fTMjWd2OzmvTZIAie15dDo_FY3nqpvLRTvvQfXr7UevOCeAyVJRhJLLTrJW6bjrQaAFZmCsF_sHzefcUMs78D5Ig$> >> | 1 + >> recipes-containers/cri-tools/cri-tools_git.bb >> <https://urldefense.com/v3/__http://cri-tools_git.bb__;!!AjveYdw8EvQ!cbNtO-fTMjWd2OzmvTZIAie15dDo_FY3nqpvLRTvvQfXr7UevOCeAyVJRhJLLTrJW6bjrQaAFZmCsF_sHzefcUMpCb2ntg$> >> | 2 +- >> .../docker-compose/docker-compose_git.bb >> <https://urldefense.com/v3/__http://docker-compose_git.bb__;!!AjveYdw8EvQ!cbNtO-fTMjWd2OzmvTZIAie15dDo_FY3nqpvLRTvvQfXr7UevOCeAyVJRhJLLTrJW6bjrQaAFZmCsF_sHzefcUN5gCwGXw$> >> | 4 +- >> .../docker-distribution_git.bb >> <https://urldefense.com/v3/__http://docker-distribution_git.bb__;!!AjveYdw8EvQ!cbNtO-fTMjWd2OzmvTZIAie15dDo_FY3nqpvLRTvvQfXr7UevOCeAyVJRhJLLTrJW6bjrQaAFZmCsF_sHzefcUPPOSTQ1A$> >> | 2 + >> ...01-Makefile-remove-duplicate-ldflags.patch | 39 >> +++++++++++++++++++ >> recipes-containers/docker/docker.inc >> <https://urldefense.com/v3/__http://docker.inc__;!!AjveYdw8EvQ!cbNtO-fTMjWd2OzmvTZIAie15dDo_FY3nqpvLRTvvQfXr7UevOCeAyVJRhJLLTrJW6bjrQaAFZmCsF_sHzefcUNwIT0NzQ$> >> | 2 + >> .../kubernetes/kubernetes_git.bb >> <https://urldefense.com/v3/__http://kubernetes_git.bb__;!!AjveYdw8EvQ!cbNtO-fTMjWd2OzmvTZIAie15dDo_FY3nqpvLRTvvQfXr7UevOCeAyVJRhJLLTrJW6bjrQaAFZmCsF_sHzefcUOnhKFbpA$> >> | 2 +- >> recipes-containers/nerdctl/nerdctl_git.bb >> <https://urldefense.com/v3/__http://nerdctl_git.bb__;!!AjveYdw8EvQ!cbNtO-fTMjWd2OzmvTZIAie15dDo_FY3nqpvLRTvvQfXr7UevOCeAyVJRhJLLTrJW6bjrQaAFZmCsF_sHzefcUNO5-GgCA$> >> | 1 + >> .../0001-Makefile-add-EXTRA_LDFLAGS.patch | 39 >> +++++++++++++++++++ >> .../oci-image-tools/oci-image-tools_git.bb >> <https://urldefense.com/v3/__http://oci-image-tools_git.bb__;!!AjveYdw8EvQ!cbNtO-fTMjWd2OzmvTZIAie15dDo_FY3nqpvLRTvvQfXr7UevOCeAyVJRhJLLTrJW6bjrQaAFZmCsF_sHzefcUPoEWN6-w$> >> | 5 ++- >> .../0001-Makefile-add-EXTRA_LDFLAGS.patch | 33 ++++++++++++++++ >> .../oci-runtime-tools_git.bb >> <https://urldefense.com/v3/__http://oci-runtime-tools_git.bb__;!!AjveYdw8EvQ!cbNtO-fTMjWd2OzmvTZIAie15dDo_FY3nqpvLRTvvQfXr7UevOCeAyVJRhJLLTrJW6bjrQaAFZmCsF_sHzefcUOHvuIx5g$> >> | 2 + >> recipes-containers/podman/podman_git.bb >> <https://urldefense.com/v3/__http://podman_git.bb__;!!AjveYdw8EvQ!cbNtO-fTMjWd2OzmvTZIAie15dDo_FY3nqpvLRTvvQfXr7UevOCeAyVJRhJLLTrJW6bjrQaAFZmCsF_sHzefcUN_RLh2RA$> >> | 4 +- >> recipes-containers/runc/runc.inc >> <https://urldefense.com/v3/__http://runc.inc__;!!AjveYdw8EvQ!cbNtO-fTMjWd2OzmvTZIAie15dDo_FY3nqpvLRTvvQfXr7UevOCeAyVJRhJLLTrJW6bjrQaAFZmCsF_sHzefcUN6fsNm5A$> >> | 1 + >> recipes-containers/skopeo/skopeo_git.bb >> <https://urldefense.com/v3/__http://skopeo_git.bb__;!!AjveYdw8EvQ!cbNtO-fTMjWd2OzmvTZIAie15dDo_FY3nqpvLRTvvQfXr7UevOCeAyVJRhJLLTrJW6bjrQaAFZmCsF_sHzefcUPMeA_sbQ$> >> | 2 +- >> recipes-containers/umoci/umoci_git.bb >> <https://urldefense.com/v3/__http://umoci_git.bb__;!!AjveYdw8EvQ!cbNtO-fTMjWd2OzmvTZIAie15dDo_FY3nqpvLRTvvQfXr7UevOCeAyVJRhJLLTrJW6bjrQaAFZmCsF_sHzefcUO9-Ps7rA$> >> | 4 +- >> recipes-networking/cni/cni_git.bb >> <https://urldefense.com/v3/__http://cni_git.bb__;!!AjveYdw8EvQ!cbNtO-fTMjWd2OzmvTZIAie15dDo_FY3nqpvLRTvvQfXr7UevOCeAyVJRhJLLTrJW6bjrQaAFZmCsF_sHzefcUN-aL8Klg$> >> | 4 +- >> 18 files changed, 138 insertions(+), 10 deletions(-) >> create mode 100644 >> recipes-containers/docker-distribution/files/0001-Makefile-remove-duplicate-ldflags.patch >> create mode 100644 >> recipes-containers/oci-image-tools/files/0001-Makefile-add-EXTRA_LDFLAGS.patch >> create mode 100644 >> recipes-containers/oci-runtime-tools/files/0001-Makefile-add-EXTRA_LDFLAGS.patch >> >> -- >> 2.34.1 >> >> >> -=-=-=-=-=-=-=-=-=-=-=- >> Links: You receive all messages sent to this group. >> View/Reply Online (#9531): >> https://lists.yoctoproject.org/g/meta-virtualization/message/9531 >> <https://urldefense.com/v3/__https://lists.yoctoproject.org/g/meta-virtualization/message/9531__;!!AjveYdw8EvQ!cbNtO-fTMjWd2OzmvTZIAie15dDo_FY3nqpvLRTvvQfXr7UevOCeAyVJRhJLLTrJW6bjrQaAFZmCsF_sHzefcUOR0VWQvA$> >> Mute This Topic: >> https://lists.yoctoproject.org/mt/117148688/1050810 >> <https://urldefense.com/v3/__https://lists.yoctoproject.org/mt/117148688/1050810__;!!AjveYdw8EvQ!cbNtO-fTMjWd2OzmvTZIAie15dDo_FY3nqpvLRTvvQfXr7UevOCeAyVJRhJLLTrJW6bjrQaAFZmCsF_sHzefcUORBdhH5w$> >> Group Owner: [email protected] >> <mailto:meta-virtualization%[email protected]> >> Unsubscribe: >> https://lists.yoctoproject.org/g/meta-virtualization/unsub >> <https://urldefense.com/v3/__https://lists.yoctoproject.org/g/meta-virtualization/unsub__;!!AjveYdw8EvQ!cbNtO-fTMjWd2OzmvTZIAie15dDo_FY3nqpvLRTvvQfXr7UevOCeAyVJRhJLLTrJW6bjrQaAFZmCsF_sHzefcUNro6bbiw$> >> [[email protected]] >> -=-=-=-=-=-=-=-=-=-=-=- >> >> >> >> -- >> - Thou shalt not follow the NULL pointer, for chaos and madness >> await thee at its end >> - "Use the force Harry" - Gandalf, Star Trek II >> > > > -- > - Thou shalt not follow the NULL pointer, for chaos and madness await > thee at its end > - "Use the force Harry" - Gandalf, Star Trek II >