Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cmd/go: build static swig wrapper #7156

Closed
cookieo9 opened this issue Jan 20, 2014 · 7 comments
Closed

cmd/go: build static swig wrapper #7156

cookieo9 opened this issue Jan 20, 2014 · 7 comments
Milestone

Comments

@cookieo9
Copy link
Contributor

The SWIG logic in the go tool builds a dynamic library of most of the wrapper code
generated by the swig tool and is dynamically linked at runtime. This causes a few
problems:
 - An extra dynamic library is needed to distribute the binary (at least one for each swig enabled package)
 - In places where rpath doesn't work as expected (eg: OSX), extra measures are needed to ensure the library is found (eg: [DY]LD_LIBRARY_PATH)
 - go build throws away this "intermediate file", before you can use the generated binary
 - go test builds the library, but it's left in a subdirectory of the temporary $WORK directory that is different from the subdirectory the test binary itself is in, so it can't be found for testing
 - a go installed version of the package will put a shared library in a place that may be discovered by go build/test binaries, but it would likely be out of date for a package in development

Now that we have external linking, it should be possible to instead statically link the
SWIG generated wrapper, and thus eliminate most/all these problems.
@ianlancetaylor
Copy link
Contributor

Comment 1:

Labels changed: added release-go1.3, repo-main.

Owner changed to @ianlancetaylor.

Status changed to Accepted.

@ianlancetaylor
Copy link
Contributor

Comment 3:

SWIG 3.0 will be released soon, with support for the relatively new cgo pragmas, making
this possible.

@rsc
Copy link
Contributor

rsc commented Apr 3, 2014

Comment 4:

Should we try to get this SWIG 3 support into the 1.3 release, Ian?

@alberts
Copy link
Contributor

alberts commented Apr 3, 2014

Comment 5:

Please.

@ianlancetaylor
Copy link
Contributor

Comment 6:

I think we should, though of course there is a catch: it will mean that people have to
use SWIG 3.0, which is quite a recent release.

@gopherbot
Copy link

Comment 7:

CL https://golang.org/cl/97120046 mentions this issue.

@ianlancetaylor
Copy link
Contributor

Comment 8:

This issue was closed by revision 02cc45a.

Status changed to Fixed.

@rsc rsc added this to the Go1.3 milestone Apr 14, 2015
@rsc rsc removed the release-go1.3 label Apr 14, 2015
@golang golang locked and limited conversation to collaborators Jun 25, 2016
This issue was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

5 participants