From: Peter Korsgaard <peter@korsgaard.com>
To: buildroot@busybox.net
Subject: [Buildroot] [PATCH 1/2] package/pkg-golang: use 'build' instead of 'install'
Date: Sun, 01 Apr 2018 16:36:12 +0200 [thread overview]
Message-ID: <877eprro2r.fsf@dell.be.48ers.dk> (raw)
In-Reply-To: <20180401115136.1345-1-thomas.petazzoni@bootlin.com> (Thomas Petazzoni's message of "Sun, 1 Apr 2018 13:51:35 +0200")
>>>>> "Thomas" == Thomas Petazzoni <thomas.petazzoni@bootlin.com> writes:
> So far, we were using the 'go install' mechanism to build a package
> and have its binary installed in
> $$($(2)_WORKSPACE)/bin/linux_$$(GO_GOARCH). This worked fine when
> building on x86-64 for ARM, but failed when building on x86-64 for
> x86-64 because the binaries were installed in $$($(2)_WORKSPACE)/bin/.
> Instead of doing some complicated logic to guess whether Go is going
> to put our binaries in $$($(2)_WORKSPACE)/bin/ or in
> $$($(2)_WORKSPACE)/bin/linux_$$(GO_GOARCH), we revert back to using
> "go build", as it was done before the introduction of the golang
> package infrastructure. "go build" lets us pass explicitly the
> destination path of the binary to be generated.
> There's just one complexity with how to decide on the name of the
> binary that should be produced, and we have two cases:
> - <pkg>_BUILD_TARGETS is the default, i.e ".". In this case we assume
> a single binary is produced by "go build", and we name if after the
> lower case package name. We allow this to be overridden thanks to
> <pkg>_BIN_NAME.
> - <pkg>_BUILD_TARGETS is non-default, and typically contains
> something like "foo bar" or "cmd/foo cmd/bar". In this case, we
> assume the binaries to be produced are "foo" and "bar", i.e we take
> the non-directory part of the build target to name the binaries.
> Because we're using this -o option, we no longer need to explicitly
> create the binary directory, it is done by "go build".
> Fixes:
> http://autobuild.buildroot.net/results/1f9cd7c48e8c8f41326632a9c0de83915d72c45b/
> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
Committed after changing the logic to use $(if as suggested by Arnout,
thanks.
--
Bye, Peter Korsgaard
prev parent reply other threads:[~2018-04-01 14:36 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-04-01 11:51 [Buildroot] [PATCH 1/2] package/pkg-golang: use 'build' instead of 'install' Thomas Petazzoni
2018-04-01 11:51 ` [Buildroot] [PATCH 2/2] package/pkg-golang: drop the fixed <pkg>_BINDIR variable Thomas Petazzoni
2018-04-01 12:27 ` Yann E. MORIN
2018-04-01 14:42 ` Peter Korsgaard
2018-04-01 12:25 ` [Buildroot] [PATCH 1/2] package/pkg-golang: use 'build' instead of 'install' Yann E. MORIN
2018-04-01 12:26 ` Arnout Vandecappelle
2018-04-01 14:35 ` Peter Korsgaard
2018-04-01 14:36 ` Peter Korsgaard [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=877eprro2r.fsf@dell.be.48ers.dk \
--to=peter@korsgaard.com \
--cc=buildroot@busybox.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox