diff mbox series

[PATCHv2] package/go: fix installation

Message ID a9774109676af0756f842322eb9baf0a7bacdf48.1695641648.git.yann.morin@orange.com
State Accepted
Headers show
Series [PATCHv2] package/go: fix installation | expand

Commit Message

Yann E. MORIN Sept. 25, 2023, 11:34 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>

---
Changes v1 -> v2:
  - drop surious hunk
---
 package/go/go.mk | 1 +
 1 file changed, 1 insertion(+)

Comments

Peter Korsgaard Oct. 1, 2023, 2:36 p.m. UTC | #1
>>>>>   <yann.morin@orange.com> writes:

 > 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>

 > ---
 > Changes v1 -> v2:
 >   - drop surious hunk

Committed, thanks.
Peter Korsgaard Oct. 13, 2023, 2:37 p.m. UTC | #2
>>>>> "Peter" == Peter Korsgaard <peter@korsgaard.com> writes:

>>>>>   <yann.morin@orange.com> writes:
 >> 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>

 >> ---
 >> Changes v1 -> v2:
 >> - drop surious hunk

 > Committed, thanks.

Committed to 2023.02.x and 2023.08.x, thanks.
diff mbox series

Patch

diff --git a/package/go/go.mk b/package/go/go.mk
index aa5d7f97b5..e5195089ac 100644
--- a/package/go/go.mk
+++ b/package/go/go.mk
@@ -146,6 +146,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/