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

Cannot get sample working under Go 1.6.x? #83

Closed
myitcv opened this issue Jun 29, 2016 · 6 comments
Closed

Cannot get sample working under Go 1.6.x? #83

myitcv opened this issue Jun 29, 2016 · 6 comments
Assignees
Labels

Comments

@myitcv
Copy link

myitcv commented Jun 29, 2016

Apologies if I'm missing something blindingly obvious here, but I cannot get the command line example working under Go 1.6.x

Everything works fine under Go 1.5.3, but under Go 1.6.2 I see:

$ go env
GOARCH="amd64"
GOBIN=""
GOEXE=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOOS="linux"
GOPATH="/home/myitcv/gostuff"
GORACE=""
GOROOT="/home/myitcv/gos"
GOTOOLDIR="/home/myitcv/gos/pkg/tool/linux_amd64"
GO15VENDOREXPERIMENT="1"
CC="gcc"
GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0"
CXX="g++"
CGO_ENABLED="1"
$ python
Python 2.7.10 (default, Jun 14 2015, 18:40:08)
[GCC 4.9.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import hi
>>> hi.Hello("you")
panic: runtime error: cgo result has Go pointer

goroutine 17 [running, locked to thread]:
panic(0x7fbaac0da9a0, 0xc82007e1c0)
        /home/myitcv/gos/src/runtime/panic.go:481 +0x3ea
main._cgoexpwrap_1c71e8bfd213__cgopy_GoString.func1(0xc820040ee8)
        _/tmp/gopy-122143260/_obj/_cgo_gotypes.go:85 +0x68
main._cgoexpwrap_1c71e8bfd213__cgopy_GoString(0x7fbaadaa1b94, 0xc82007e181, 0x3)
        _/tmp/gopy-122143260/_obj/_cgo_gotypes.go:87 +0x85
Aborted (core dumped)

Happy to continue playing under Go 1.5.3 for now but any help much appreciated.

@sbinet sbinet added the bug label Jun 29, 2016
@sbinet sbinet self-assigned this Jun 29, 2016
@sbinet
Copy link
Member

sbinet commented Jun 29, 2016

yes, unfortunately, gopy isn't Go-1.6 (>=1.6, actually) compliant.
you could run it with Go >=1.6 if you were to export GODEBUG="cgocheck=0" (that's not something to be done in production, though) as documented here:
https://golang.org/cmd/cgo/#hdr-Passing_pointers

I have been working off and on on rewriting some of the generated code to be compliant with the "new" cgo rules. the WIP code is there: https://github.com/go-python/gopy/tree/bind-seq
(but it's lacking a great deal of features wrt the master branch.)

I'll carve up time to get back to this during July-August.

Sorry about this.

@myitcv
Copy link
Author

myitcv commented Jun 30, 2016

Thanks @sbinet, appreciate the quick response

Might just be worth tweaking the README in the meantime?

@sbinet
Copy link
Member

sbinet commented Jun 30, 2016

Right. Will do when in front of a real keyboard :)

@sbinet
Copy link
Member

sbinet commented Jul 1, 2016

done: a4a4772

@pombredanne
Copy link

Any plan to add support for more recent Go versions? Thanks!

@rcoreilly
Copy link
Member

for old version, closing

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants