Skip to contentSkip to conversation

kubernetes: do not strip binaries at build

PATCH In review [email protected] 2 participants 2 messages Jun 28, 2023 – Jul 5, 2023

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 kubernetes: do not strip binaries at build

From: Chen Qi <[email protected]>

Yocto/OE has its own way to control binary stripping. So don't do it in the go build process. Otherwise, we'll get empty dbg packages.

Setting DBG=1 solves this problem, as stated in comments in the Makefile.
"""
# Note: Specify DBG=1 for building unstripped binaries, which allows you to use code debugging

  # tools like delve. When DBG is unspecified, it defaults to "-s -w" which strips debug
  # information.
"""
---
 recipes-containers/kubernetes/kubernetes_git.bb | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
recipes-containers/kubernetes/kubernetes_git.bb +1 -1
index 3a6e711..8b7c9e0 100644
@@ -87,7 +87,7 @@ do_compile() {
 	export GOBIN=""
 
 	# to limit what is built, use 'WHAT', i.e. make WHAT=cmd/kubelet
-	make cross CGO_FLAGS=${CGO_FLAGS} GO=${GO} KUBE_BUILD_PLATFORMS=${GOOS}/${GOARCH} GOLDFLAGS=""
+	make cross CGO_FLAGS=${CGO_FLAGS} GO=${GO} KUBE_BUILD_PLATFORMS=${GOOS}/${GOARCH} GOLDFLAGS="" DBG=1
 }
 
 do_install() {
Signature · 1 line
2.34.1
#1 lore raw

I haven't forgotten about these.

I'm going through an uprev cycle for many of the packages (and the kernel), so I've been fighting a few issues.

If I can't get the other issues resolved, I will bump the priority on these and merge them wednesday.

Bruce

Quoted 43 lines · Chen Qi via lists.yoctoproject.org

From: Chen Qi <[email protected]>

Yocto/OE has its own way to control binary stripping. So don't do it in the go build process. Otherwise, we'll get empty dbg packages.

Setting DBG=1 solves this problem, as stated in comments in the Makefile.
"""
# Note: Specify DBG=1 for building unstripped binaries, which allows you to use code debugging

  # tools like delve. When DBG is unspecified, it defaults to "-s -w" which strips debug
  # information.
"""
---
 recipes-containers/kubernetes/kubernetes_git.bb | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
recipes-containers/kubernetes/kubernetes_git.bb +1 -2
index 3a6e711..8b7c9e0 100644
@@ -87,7 +87,7 @@ do_compile() {
        export GOBIN=""
 
        # to limit what is built, use 'WHAT', i.e. make WHAT=cmd/kubelet
-       make cross CGO_FLAGS=${CGO_FLAGS} GO=${GO} KUBE_BUILD_PLATFORMS=${GOOS}/${GOARCH} GOLDFLAGS=""
+       make cross CGO_FLAGS=${CGO_FLAGS} GO=${GO} KUBE_BUILD_PLATFORMS=${GOOS}/${GOARCH} GOLDFLAGS="" DBG=1
 }
 
 do_install() {
--

2.34.1

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#8113): https://lists.yoctoproject.org/g/meta-virtualization/message/8113
Mute This Topic: https://lists.yoctoproject.org/mt/99823673/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