[yocto] Integrating Golang

Leo Schwab lschwab at sensity.com
Thu Apr 17 12:54:46 PDT 2014


On Thu, Apr 17, 2014 at 1:49 AM, Martin Donnelly <martin.donnelly at ge.com> wrote:
> On 05/03/2014 21:55, Leo Schwab wrote:
>> Has anyone else done any work here?  Is there anything that I can
>> steal^H^H^H^H^Htake inspiration from?  Or am I in completely
>> unexplored territory?
>
> I posted an RFC patch set last year but it didn't get any traction and
> we subsequently ruled out use of go so I never followed up on it but it
> might be a useful starting point.
>
> http://lists.openembedded.org/pipermail/openembedded-core/2013-May/078606.html
>
We cobbled together our own recipes to build the Go compiler
(available upon request), which seem to be working well enough.  We
didn't need to make any changes to the recipes building the GCC
toolchain.

What I was more interested in learning was how people were integrating
the building of Go applications into Yocto.  Specifically: 'go get
foo' will build 'foo' and, in the process, fetch and build all its
dependencies.  This conflicts directly with Yocto's duties -- fetching
and building dependencies.

My current not-solution is rather ugly:  Create a repository that is a
standard Go build environment pre-populated with the app source code
and all of its dependencies.  The idea is that 'go get foo' will find
everything it needs already there and won't try and fetch anything
else.  Then create a simple Yocto recipe that fetches this repository
and builds it using 'go get ...'.  The repository itself is maintained
via rather delicate use of git-subtree.

This gets the job done, and prevents Go and Yocto having a fight about
who fetches what and how, but it's damned ugly...

Schwab



More information about the yocto mailing list