From patchwork Wed May 13 17:05:31 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Marko X-Patchwork-Id: 88057 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 53C55CD4F21 for ; Wed, 13 May 2026 17:06:26 +0000 (UTC) Received: from mta-64-225.siemens.flowmailer.net (mta-64-225.siemens.flowmailer.net [185.136.64.225]) by mx.groups.io with SMTP id smtpd.msgproc01-g2.2329.1778691978140648355 for ; Wed, 13 May 2026 10:06:19 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=peter.marko@siemens.com header.s=fm1 header.b=QCQ0YrJ7; spf=pass (domain: rts-flowmailer.siemens.com, ip: 185.136.64.225, mailfrom: fm-256628-2026051317061410df49ebd0000207d4-nuppjs@rts-flowmailer.siemens.com) Received: by mta-64-225.siemens.flowmailer.net with ESMTPSA id 2026051317061410df49ebd0000207d4 for ; Wed, 13 May 2026 19:06:15 +0200 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; s=fm1; d=siemens.com; i=peter.marko@siemens.com; h=Date:From:Subject:To:Message-ID:MIME-Version:Content-Type:Content-Transfer-Encoding:Cc; bh=q1fDRpeUV6Mltx6G9dZHbDnp9rVhoRFbLfLVxZ09Xjs=; b=QCQ0YrJ7J7+7PXuasK4NZJzqIFVyOQ5kNJUd2KRgP9WF11Yj1fKfXu7I1CekDthlMVgKQ0 TfRqRXVlotmcT/k1BJiT5labbC89z2jawE2Zop1Npi136RbTLGFGi6JzD5A9tYXfmrNAaZJf x+6ba5fOrEEoFOg2NjnJxAGHUtV9hynU8XhMV/Mz2+Nmu5v/dChxSY4e0doAWMPGuB6kGlxo VYgyDPGLPPLtX+sHAkh385MQByhn77u3C4HottzUrP2/YORzqMJByEP9mFZB21Z6L/t3h4r7 rmoBnlwAkP9Ga20HBZmrf45lbsETdusUytb8wa0vkDRjSlg41e5xjZWA==; From: Peter Marko To: openembedded-core@lists.openembedded.org Cc: peter.marko@siemens.com Subject: [scarthgap][PATCH 1/3] go.bbclass: change GOTMPDIR to improve reproducibility Date: Wed, 13 May 2026 19:05:31 +0200 Message-ID: <20260513170533.2467950-1-peter.marko@siemens.com> MIME-Version: 1.0 X-Flowmailer-Platform: Siemens Feedback-ID: 519:519-256628:519-21489:flowmailer List-Id: X-Webhook-Received: from 45-33-107-173.ip.linodeusercontent.com [45.33.107.173] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Wed, 13 May 2026 17:06:26 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/236993 From: Changqing Li When cgo is enabled, the Go toolchain writes temporary source files (*.c) under GOTMPDIR and compiles them there. when -trimpath is passed to go, Go passes options such as -ffile-prefix-map=$WORK/b387=/tmp/go-build internally to the GCC instance it invokes. The variable WORK is a temporary directory created under GOTMPDIR, refer the following log: [snip of compile log] WORK=/build/tmp/work/x86-64-v3-wrs-linux/buildah/1.41.5/build-tmp/go-build377321751 cd $WORK/b387 TERM='dumb' x86_64-wrs-linux-gcc -m64 -march=x86-64-v3 -fstack-protector-strong -O2 -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security -Werror=format-security --sysroot=/tmp/work/x86-64-v3-wrs-linux/buildah/1.41.5/recipe-sysroot -I /tmp/work/x86-64-v3-wrs-linux/buildah/1.41.5/sources/buildah-1.41.5/src/github.com/containers/buildah/vendor/github.com/proglottis/gpgme -fPIC -m64 -pthread -Wl,--no-gc-sections -fmessage-length=0 -ffile-prefix-map=$WORK/b387=/tmp/go-build -gno-record-gcc-switches -v -D_FILE_OFFSET_BITS=64 -I $WORK/b387/ -O2 -g -ffile-prefix-map=/tmp/work/x86-64-v3-wrs-linux/buildah/1.41.5/sources/buildah-1.41.5=/usr/src/debug/buildah/1.41.5 -ffile-prefix-map=/tmp/work/x86-64-v3-wrs-linux/buildah/1.41.5/build=/usr/src/debug/buildah/1.41.5 -ffile-prefix-map=/tmp/work/x86-64-v3-wrs-linux/buildah/1.41.5/recipe-sysroot= -ffile-prefix-map=/tmp/work/x86-64-v3-wrs-linux/buildah/1.41.5/recipe-sysroot-native= -pipe -v -ffile-prefix-map=/tmp/work/x86-64-v3-wrs-linux/buildah/1.41.5/sources/buildah-1.41.5/src/github.com/containers/buildah/vendor=/_/vendor -frandom-seed=TZkSPVSBUvDMjg4wKjWS -o $WORK/b387/_x004.o -c unset_agent_info.cgo2.c [snip of compile log] OE also passes its own DEBUG_PREFIX_MAP to GCC(finally by CGO_CFLAGS), including -ffile-prefix-map=${B}=${TARGET_DBGSRC_DIR}, where B is ${WORKDIR}/build. Because GOTMPDIR defaults to ${WORKDIR}/build-tmp, the Go temporary directory looks like ${WORKDIR}/build-tmp/go-buildXYZ. Its prefix therefore begins with ${WORKDIR}/build, so GCC matches the DEBUG_PREFIX_MAP entry for ${B} first. As a result, a path such as ${WORKDIR}/build-tmp/go-buildXYZ is rewritten to ${TARGET_DBGSRC_DIR}-tmp/go-buildXYZ. This breaks the -ffile-prefix-map option that Go itself adds, because the original WORK path no longer matches the value Go expects. Since Go creates go-buildXYZ directories randomly and internally, this causes the build non-reproducible. This patch changes GOTMPDIR from ${WORKDIR}/build-tmp to ${WORKDIR}/tmp-go-build so that the path no longer matches ${B}. This prevents unintended replacements by OE's DEBUG_PREFIX_MAP and restores reproducibility. Note that pure go program like go-helloworld under OE will not have this issue since it doen't use cgo, it is reproducible without this fix Signed-off-by: Changqing Li Signed-off-by: Mathieu Dubois-Briand Signed-off-by: Richard Purdie (From OE-Core rev: 0642d2323072f561a4d0eeb9266213387b2997fc) Signed-off-by: Peter Marko --- meta/classes-recipe/go.bbclass | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/meta/classes-recipe/go.bbclass b/meta/classes-recipe/go.bbclass index d32509aa6d1..61b08a082f7 100644 --- a/meta/classes-recipe/go.bbclass +++ b/meta/classes-recipe/go.bbclass @@ -77,7 +77,7 @@ B = "${WORKDIR}/build" export GOPATH = "${B}" export GOENV = "off" export GOPROXY ??= "https://proxy.golang.org,direct" -export GOTMPDIR ?= "${WORKDIR}/build-tmp" +export GOTMPDIR ?= "${WORKDIR}/tmp-go-build" GOTMPDIR[vardepvalue] = "" python go_do_unpack() { From patchwork Wed May 13 17:05:32 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Marko X-Patchwork-Id: 88059 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 243EDCD4F21 for ; Wed, 13 May 2026 17:06:36 +0000 (UTC) Received: from mta-64-227.siemens.flowmailer.net (mta-64-227.siemens.flowmailer.net [185.136.64.227]) by mx.groups.io with SMTP id smtpd.msgproc02-g2.2353.1778691981028483341 for ; Wed, 13 May 2026 10:06:23 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=peter.marko@siemens.com header.s=fm1 header.b=QGMcN6Q8; spf=pass (domain: rts-flowmailer.siemens.com, ip: 185.136.64.227, mailfrom: fm-256628-202605131706191a98823d76000207db-al1ewh@rts-flowmailer.siemens.com) Received: by mta-64-227.siemens.flowmailer.net with ESMTPSA id 202605131706191a98823d76000207db for ; Wed, 13 May 2026 19:06:19 +0200 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; s=fm1; d=siemens.com; i=peter.marko@siemens.com; h=Date:From:Subject:To:Message-ID:MIME-Version:Content-Type:Content-Transfer-Encoding:Cc:References:In-Reply-To; bh=SoUsCu2POo7s7jpS8gmD0dfZS3UzH29Xz2bVtOVRt3k=; b=QGMcN6Q8emm2zmul/2+AUrxTLLIOLMelHXoeAaA/pR8Jb+JhadKiqDXcDh7eHD5ZhcpoSz odm+X4iWqkyK5W7eCGqVj+/6rCvYvOp+lKCrjB/67Zt7tVjaw+ZJKwlvy/B1hzObbVJmSd9f L841sYLGXlbWhBbeeavI06zGq3WIeHEYoZ7XczhypsBam7q5hGo6IuYTIIlP/GbQspcPD4VN ISvSSoz9xM0ho2W2w0V5yv2/Wc8zoz/CLItfnUAE9hKdw94KB0jX5fPNA3uwtSS2DsdBGsVZ gRfEuyAPEGlcG7TsvtuI+ETQUgeefd0j5RqWOPRc2HGEgwU0mUpYV+/g==; From: Peter Marko To: openembedded-core@lists.openembedded.org Cc: peter.marko@siemens.com Subject: [scarthgap][PATCH 2/3] go.bbclass: disable workspaces Date: Wed, 13 May 2026 19:05:32 +0200 Message-ID: <20260513170533.2467950-2-peter.marko@siemens.com> In-Reply-To: <20260513170533.2467950-1-peter.marko@siemens.com> References: <20260513170533.2467950-1-peter.marko@siemens.com> MIME-Version: 1.0 X-Flowmailer-Platform: Siemens Feedback-ID: 519:519-256628:519-21489:flowmailer List-Id: X-Webhook-Received: from 45-33-107-173.ip.linodeusercontent.com [45.33.107.173] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Wed, 13 May 2026 17:06:36 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/236994 From: Peter Bergin go has a feature of workspaces [1]. If there is a file called go.work in your working directory on any of its parent directories that will be read and used during build. For OE where the builds shall be sandboxed this is bad as a workspace file outside of the build environment can be picked up. This commit wil disable that feature according to the instruction in [1]. This was found and introduced build failures when a file go.work was in the parent directory outside of OE build directory. [1] https://go.dev/ref/mod#workspaces Signed-off-by: Peter Bergin Signed-off-by: Mathieu Dubois-Briand Signed-off-by: Richard Purdie a (From OE-Core rev: c52c5e88626968b08510818f09829f2e1c9f94ae) Signed-off-by: Peter Marko --- meta/classes-recipe/go.bbclass | 1 + 1 file changed, 1 insertion(+) diff --git a/meta/classes-recipe/go.bbclass b/meta/classes-recipe/go.bbclass index 61b08a082f7..36103e8eb0f 100644 --- a/meta/classes-recipe/go.bbclass +++ b/meta/classes-recipe/go.bbclass @@ -22,6 +22,7 @@ export GOARCH = "${TARGET_GOARCH}" export GOOS = "${TARGET_GOOS}" export GOHOSTARCH="${BUILD_GOARCH}" export GOHOSTOS="${BUILD_GOOS}" +export GOWORK = "off" GOARM[export] = "0" GOARM:arm:class-target = "${TARGET_GOARM}" From patchwork Wed May 13 17:05:33 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Marko X-Patchwork-Id: 88058 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3CB7DCD37AC for ; Wed, 13 May 2026 17:06:36 +0000 (UTC) Received: from mta-64-228.siemens.flowmailer.net (mta-64-228.siemens.flowmailer.net [185.136.64.228]) by mx.groups.io with SMTP id smtpd.msgproc02-g2.2356.1778691986697761134 for ; Wed, 13 May 2026 10:06:27 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=peter.marko@siemens.com header.s=fm1 header.b=W73l3WWF; spf=pass (domain: rts-flowmailer.siemens.com, ip: 185.136.64.228, mailfrom: fm-256628-202605131706243c51efb91e00020791-rbuktj@rts-flowmailer.siemens.com) Received: by mta-64-228.siemens.flowmailer.net with ESMTPSA id 202605131706243c51efb91e00020791 for ; Wed, 13 May 2026 19:06:24 +0200 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; s=fm1; d=siemens.com; i=peter.marko@siemens.com; h=Date:From:Subject:To:Message-ID:MIME-Version:Content-Type:Content-Transfer-Encoding:Cc:References:In-Reply-To; bh=hQvB7vB7q+3aCzPbTMrwBj0zY2OA2eKzke3u6OCGSGg=; b=W73l3WWFI1iLiWFgGqXfbTpRO6GSzV21lPHWZdINLCvrPVp1iOGl1NMVrT4j/Bo5p0+P3Z ZNNs7h21PMbe+rsWfJCfesvzyyqDKYrn+yQJ77lW2UWke0BTQvRVZsAko++CKu6KVLlwScOB reAHPGOLHbzJVxruV/clpckaCsUtI88KzgTw3ewysG5ezUri2lb/AfhKpPFl0mBOggXly5F1 tzKcW3ckFMFNkdPjl/uqrVpxy+sduTkJw92cMICevfXtsJPKnZM5eJTq/7ZE9mOlcX3pRFQg 9M8ICwBV+EdK5oCf8590RJqmUbLbPplozOtzrHvuqX9+a8cDbJBDqyUA==; From: Peter Marko To: openembedded-core@lists.openembedded.org Cc: peter.marko@siemens.com Subject: [scarthgap][PATCH 3/3] oeqa: runtime: go: Increase test_go_compile/test_go_module timeout Date: Wed, 13 May 2026 19:05:33 +0200 Message-ID: <20260513170533.2467950-3-peter.marko@siemens.com> In-Reply-To: <20260513170533.2467950-1-peter.marko@siemens.com> References: <20260513170533.2467950-1-peter.marko@siemens.com> MIME-Version: 1.0 X-Flowmailer-Platform: Siemens Feedback-ID: 519:519-256628:519-21489:flowmailer List-Id: X-Webhook-Received: from 45-33-107-173.ip.linodeusercontent.com [45.33.107.173] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Wed, 13 May 2026 17:06:36 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/236995 From: Mathieu Dubois-Briand These tests tend do take a bit of time, and this is probably why they have been seen failing a few times in the past months. Rising the timeout from 5 to 10 minutes appears to help. Fixes [YOCTO #15999] Signed-off-by: Mathieu Dubois-Briand Signed-off-by: Richard Purdie (From OE-Core rev: 998ebfc77db4c8d7567d82560595e0994a310ae0) Signed-off-by: Peter Marko --- meta/lib/oeqa/runtime/cases/go.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/meta/lib/oeqa/runtime/cases/go.py b/meta/lib/oeqa/runtime/cases/go.py index d4b69438a56..0c9c4ff4cd3 100644 --- a/meta/lib/oeqa/runtime/cases/go.py +++ b/meta/lib/oeqa/runtime/cases/go.py @@ -35,7 +35,7 @@ class GoCompileTest(OERuntimeTestCase): self.skipTest('go command not found, output: %s' % output) # Compile the simple Go program - status, output = self.target.run('go build -o /tmp/test /tmp/test.go') + status, output = self.target.run('go build -o /tmp/test /tmp/test.go', 600) msg = 'go compile failed, output: %s' % output self.assertEqual(status, 0, msg=msg) @@ -65,7 +65,7 @@ class GoCompileTest(OERuntimeTestCase): self.assertEqual(status, 0, msg=msg) # Build the module - status, output = self.target.run('cd /tmp/hello-go && go build -o hello main.go') + status, output = self.target.run('cd /tmp/hello-go && go build -o hello main.go', 600) msg = 'go build failed, output: %s' % output self.assertEqual(status, 0, msg=msg)