diff mbox series

package/go: fix installation

Message ID 9e52d2493ec60db3f2dafc9429171566b3ce4e38.1695641310.git.yann.morin@orange.com
State Superseded
Headers show
Series package/go: fix installation | expand

Commit Message

Yann E. MORIN Sept. 25, 2023, 11:28 a.m. UTC
From: "Yann E. MORIN" <yann.morin@orange.com>

When building for a target architecture that go does not support, the
isntallation fails with:

    $ make host-go
    [...]
    ln -sf ../lib/go/bin/go /home/nyma7486/dev/work/5GCroCo/O/pouet/per-package/host-go/host/bin/
    ln: failed to create symbolic link '/home/nyma7486/dev/work/5GCroCo/O/pouet/per-package/host-go/host/bin/': No such file or directory

Indeed, the HOST_DIR/bin is not guaranteed to exist when we install a
host package, so it needs to be explicitly created before we can create
entries in there.

Signed-off-by: Yann E. MORIN <yann.morin@orange.com>
Cc: Christian Stewart <christian@aperture.us>
Cc: Anisse Astier <anisse@astier.eu>
---
 package/go/go.mk | 4 ++++
 1 file changed, 4 insertions(+)
diff mbox series

Patch

diff --git a/package/go/go.mk b/package/go/go.mk
index aa5d7f97b5..76eaf6beb3 100644
--- a/package/go/go.mk
+++ b/package/go/go.mk
@@ -35,6 +35,9 @@  HOST_GO_COMMON_ENV = \
 
 ifeq ($(BR2_PACKAGE_HOST_GO_TARGET_ARCH_SUPPORTS),y)
 
+# WIP: WHY?
+HOST_GO_DEPENDENCIES += toolchain
+
 ifeq ($(BR2_arm),y)
 GO_GOARCH = arm
 ifeq ($(BR2_ARM_CPU_ARMV5),y)
@@ -146,6 +149,7 @@  define HOST_GO_INSTALL_CMDS
 	$(INSTALL) -D -m 0755 $(@D)/bin/go $(HOST_GO_ROOT)/bin/go
 	$(INSTALL) -D -m 0755 $(@D)/bin/gofmt $(HOST_GO_ROOT)/bin/gofmt
 
+	mkdir -p $(HOST_DIR)/bin
 	ln -sf ../lib/go/bin/go $(HOST_DIR)/bin/
 	ln -sf ../lib/go/bin/gofmt $(HOST_DIR)/bin/