From: Jagadeesh Krishnanjanappa <[email protected]>

Compile host tools such as deepcopy-gen, defaulter-gen, openapi-gen
   for host architecture, to solve below error:
-- snip --
| +++ [0117 05:31:35] Building go targets for linux/arm64:
|     ./vendor/k8s.io/code-generator/cmd/deepcopy-gen
| touch: cannot touch '_output/bin/deepcopy-gen': No such file or directory
| make[1]: *** [Makefile.generated_files:323: _output/bin/deepcopy-gen] Error 1
| make: *** [Makefile:478: generated_files] Error 2

Signed-off-by: Jagadeesh Krishnanjanappa <[email protected]>
Signed-off-by: Koen Kooi <[email protected]>
---
 recipes-containers/kubernetes/kubernetes_git.bb | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/recipes-containers/kubernetes/kubernetes_git.bb 
b/recipes-containers/kubernetes/kubernetes_git.bb
index 33cb933..f23721c 100644
--- a/recipes-containers/kubernetes/kubernetes_git.bb
+++ b/recipes-containers/kubernetes/kubernetes_git.bb
@@ -73,6 +73,12 @@ do_compile() {
        export CGO_LDFLAGS="${LDFLAGS} --sysroot=${STAGING_DIR_TARGET}"
 
        cd ${S}/src/import
+       # Build the host tools first, using the host compiler
+       export GOARCH="${BUILD_GOARCH}"
+       make generated_files KUBE_BUILD_PLATFORMS="${HOST_GOOS}/${BUILD_GOARCH}"
+
+       # Reset GOARCH to the target one
+       export GOARCH="${TARGET_GOARCH}"
        # to limit what is built, use 'WHAT', i.e. make WHAT=cmd/kubelet
        make cross KUBE_BUILD_PLATFORMS=${GOOS}/${GOARCH}
 }
-- 
2.9.5

-- 
_______________________________________________
meta-virtualization mailing list
[email protected]
https://lists.yoctoproject.org/listinfo/meta-virtualization

Reply via email to