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: swig recipe compiles .so to wrong location #5739

Closed
slimsag opened this issue Jun 20, 2013 · 8 comments
Closed

cmd/go: swig recipe compiles .so to wrong location #5739

slimsag opened this issue Jun 20, 2013 · 8 comments
Milestone

Comments

@slimsag
Copy link

slimsag commented Jun 20, 2013

What steps will reproduce the problem?
If possible, include a link to a program on play.golang.org.
1. Place two files in $GOPATH/src/test:
    test.go (contains only one line 'package test')
    test.swigcxx (empty)
2. go install test
3. Receive the following:
go install test: open test-test-swigcxx.so: The system cannot find the file specified.


What is the expected output?
I expect the package to be installed properly (without error).

What do you see instead?
Output of go install -x is here:
http://play.golang.org/p/YurY-smzPE

Which compiler are you using (5g, 6g, 8g, gccgo)?
6g

Which operating system are you using?
Windows 64 bit.

Which version are you using?  (run 'go version')
go version devel +363b75191352 Thu Jun 20 10:29:38 2013 +1000 windows/amd64
@minux
Copy link
Member

minux commented Jun 20, 2013

Comment 1:

cannot reproduce this on linux.
could you please do this:
go install -work -x
and go to the work directory and see if there is a test-test-swigcxx.so file?
you could try the final link step yourself and see if the required file is
generated:
gcc -I "C:\\Users\\stephen\\Desktop\\godev\\src\\test" -g -O2 -m64 -mthreads -o
test-test-swigcxx.so "test_wrap.o" -shared -lm -mthreads -lstdc++

@minux
Copy link
Member

minux commented Jun 20, 2013

Comment 2:

Status changed to WaitingForReply.

@slimsag
Copy link
Author

slimsag commented Jun 20, 2013

Comment 3:

I tried as you said.
After 'go install -work -x'; inside the $WORK directory; there is no
test-test-swigcxx.so file present.
If I enter $WORK\test\_obj and run the GCC command you pasted; the .so file is created
and go install works properly.
I will continue to try and debug further.

@slimsag
Copy link
Author

slimsag commented Jun 20, 2013

Comment 4:

Upon 'go install -work -x' (with $GOPATH/pkg directory being empty):
    1. test-test-swigcxx.so ends up at $GOPATH/src/test/test-test-swigcxx.so
    2. There are no .so files in the $WORK directory.

@rsc
Copy link
Contributor

rsc commented Jul 25, 2013

Comment 5:

Thank you for finding that. The problem is that the gcc command says
    -o test-test-swigcxx.so
but it needs to say -o $WORK/test/_obj/test-test-swigcxx.so.

Labels changed: added priority-later, go1.2, removed priority-triage.

Status changed to Accepted.

@ianlancetaylor
Copy link
Contributor

Comment 6:

Owner changed to @ianlancetaylor.

Status changed to Started.

@ianlancetaylor
Copy link
Contributor

Comment 7:

https://golang.org/cl/13352046

@ianlancetaylor
Copy link
Contributor

Comment 8:

This issue was closed by revision 7f062fa.

Status changed to Fixed.

@rsc rsc added this to the Go1.2 milestone Apr 14, 2015
@rsc rsc removed the go1.2 label Apr 14, 2015
@golang golang locked and limited conversation to collaborators Jun 24, 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