Skip to contentSkip to conversation

skopeo.bb: remove GOBUILDFLAGS override in do_compile to fix textrel QA issue

PATCH In review hh 2 participants 2 messages Jul 4, 2025 – Jul 7, 2025

lore
Share & tools
lore

hh

author
#0 lore raw

PATCH 1/1 skopeo.bb: remove GOBUILDFLAGS override in do_compile to fix textrel QA issue

From: Harish H <[email protected]>

The skopeo recipe was explicitly exporting GOBUILDFLAGS="-trimpath" in the do_compile task, overriding the default settings provided by go.bbclass.

This override causes the resulting Go binary to include relocations in the .text section, leading to the following QA error during do_package_qa:

QA Issue: skopeo: ELF binary /usr/sbin/skopeo has relocations in .text [textrel]

Removing the GOBUILDFLAGS assignment in skopeo_git.bb allows the default behavior from go.bbclass to take effect, resolving the textrel issue and ensuring the binary passes QA checks.

---
 recipes-containers/skopeo/skopeo_git.bb | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
recipes-containers/skopeo/skopeo_git.bb +1 -1
index 561ef103..165114ef 100644
@@ -61,7 +61,7 @@ do_compile() {
 	export CGO_LDFLAGS="${TARGET_LDFLAGS}"
 
 	export GO111MODULE=off
-	export GOBUILDFLAGS="-trimpath"
+	#export GOBUILDFLAGS="-trimpath"
 	export EXTRA_LDFLAGS="-s -w"
 
 	oe_runmake bin/skopeo
Signature · 1 line
2.40.0
#1 lore raw
Quoted 8 lines · Harish via lists.yoctoproject.org

From: Harish H <[email protected]>

The skopeo recipe was explicitly exporting GOBUILDFLAGS="-trimpath" in the do_compile task, overriding the default settings provided by go.bbclass.

This override causes the resulting Go binary to include relocations in the .text section, leading to the following QA error during do_package_qa:

Quoted 8 lines

QA Issue: skopeo: ELF binary /usr/sbin/skopeo has relocations in .text
[textrel]

Removing the GOBUILDFLAGS assignment in skopeo_git.bb allows the default behavior
from go.bbclass to take effect, resolving the textrel issue and ensuring the binary passes QA checks.

I tend not to trust the go bbclases with setting the build flags. They've broken my
builds as often as they've fixed things. That being said, I would take this change
if I could see the issue (see below).

I'm also not seeing this same QA error .. otherwise no updates to skopeo would
be merging.

Can you describe your configuration ? Is this against the latest master-next ?
Do you have local tweaks to the QA tests ?

I can't merge this unless I can reproduce the issue.

Bruce

Quoted 35 lines
---
 recipes-containers/skopeo/skopeo_git.bb | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
recipes-containers/skopeo/skopeo_git.bb +1 -2
index 561ef103..165114ef 100644
@@ -61,7 +61,7 @@ do_compile() {
        export CGO_LDFLAGS="${TARGET_LDFLAGS}"
 
        export GO111MODULE=off
-       export GOBUILDFLAGS="-trimpath"
+       #export GOBUILDFLAGS="-trimpath"
        export EXTRA_LDFLAGS="-s -w"
 
        oe_runmake bin/skopeo
--

2.40.0

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group. View/Reply Online (#9295):
https://lists.yoctoproject.org/g/meta-virtualization/message/9295
Mute This Topic: https://lists.yoctoproject.org/mt/113979362/1050810
Group Owner: [email protected]
Unsubscribe: https://lists.yoctoproject.org/g/meta-virtualization/unsub [ [email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

Signature · 3 lines
- Thou shalt not follow the NULL pointer, for chaos and madness await thee
at its end
- "Use the force Harry" - Gandalf, Star Trek II