elastic / golang-crossbuild

Apache License 2.0
2 stars 32 forks source link

Add SWIG to images #42

Open pgaskin opened 4 years ago

pgaskin commented 4 years ago

SWIG is used by Go to generate bindings for C++ CGO libs.

andresrc commented 4 years ago

ping @elastic/observablt-robots

andresrc commented 4 years ago

Can you provide more information on what you are using the image for? Thanks for the contribution!!

pgaskin commented 4 years ago

I'm using it for libmarisa (a C++ library) bindings as part of my dictutil tool. Currently, I manually install it with apt during the build.

I recently switched most of my other projects over to this image (to replace dockercore/golang-cross, which is outdated and doesn't have the best layout). This is currently my only project which needs it, but SWIG is the recommended (and built-in) way to use C++ in CGO (see the doc near the top of https://golang.org/pkg/cmd/go/internal/help/), so this is likely to be useful for other people as well.

kuisathaverat commented 4 years ago

In a nutshell, SWIG is a compiler that takes C/C++ declarations and creates the wrappers needed to access those declarations from other languages including Perl, Python, Tcl, Ruby, Guile, and Java.

SWIG is a CLI tool to make wrappers to programs made in C/C++ and use them in several languages. @andresrc Do you want us to install this tool on the workers of our CI (beats-ci)? Do you want us to install this tool in the cross-build images? Do you have a job where we can test it??