Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] Using a go.mod in a subdirectory
@ 2023-06-23 16:59 Bryce Johnson
  2023-06-24 15:27 ` Yann E. MORIN
  0 siblings, 1 reply; 3+ messages in thread
From: Bryce Johnson @ 2023-06-23 16:59 UTC (permalink / raw)
  To: buildroot; +Cc: christian

Hi All,
I was looking at adding a package for shellhub in buildroot.  Two
issues, first one is that the latest needs go 1.20.  I applied this
patch (https://patchwork.ozlabs.org/project/buildroot/list/?series=358451)
to get around that which seems to work so far.   CC: Christian since
I'm testing with his patch set.

The 2nd issue is the agent is in a subdirectory with its own go.mod
that is different from one the on the root directory.

Is there a way to do this better?  Or is the go.mod required to be in
the root of the repo?

SHELLHUB_VERSION = v0.12.3
SHELLHUB_SITE = $(call github,shellhub-io,shellhub,$(SHELLHUB_VERSION))
SHELLHUB_LICENSE = Apache-2.0
SHELLHUB_LICENSE_FILES = LICENSE.md
SHELLHUB_DEPENDENCIES = libxcrypt

SHELLHUB_GOMOD = github.com/shellhub-io/shellhub/agent
SHELLHUB_LDFLAGS =  -X main.AgentVersion=${SHELLHUB_VERSION}

# SHELLHUB_BUILD_TARGETS = agent
# SHELLHUB_INSTALL_BINS = $(notdir $(SHELLHUB_BUILD_TARGETS))

 $(eval $(golang-package))


I can export my output/host/usr/bin and do go build -ldflags "-X
main.AgentVersion=v0.12.3" and it is able to build in that way, so it
seems the host-go 1.20 patch is working.

Bryce
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2023-06-26 13:20 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-06-23 16:59 [Buildroot] Using a go.mod in a subdirectory Bryce Johnson
2023-06-24 15:27 ` Yann E. MORIN
2023-06-26 13:19   ` Bryce Johnson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox