sourcegraph / go-webkit2

WebKit API bindings (WebKitGTK+ v2) for Go
https://sourcegraph.com/github.com/sourcegraph/go-webkit2
Other
313 stars 61 forks source link

run test failed #25

Closed zx9597446 closed 2 months ago

zx9597446 commented 8 years ago

go version 1.6 os ubuntu 14.04 sudo apt-get install libwebkit2gtk-3.0-dev

  1. there's a build issue (mutiple define) when running: go get -tags gtk_3_10 github.com/sourcegraph/go-webkit2/... I think it's because evaljs.go import "github.com/conformal/gotk3/gtk" and webkit2 import "github.com/gotk3/gotk3/glib".
  2. fix issue 1, running go test -tags gtk_3_10 failed: go test -tags gtk_3_10

--- FAIL: TestWebView_RunJavaScript (0.01s) panic: runtime error: cgo argument has Go pointer to Go pointer [recovered] panic: runtime error: cgo argument has Go pointer to Go pointer

goroutine 28 [running]: panic(0xb47580, 0xc82000b7b0) /usr/local/go/src/runtime/panic.go:464 +0x3e6 testing.tRunner.func1(0xc820073290) /usr/local/go/src/testing/testing.go:467 +0x192 panic(0xb47580, 0xc82000b7b0) /usr/local/go/src/runtime/panic.go:426 +0x4e9 github.com/sourcegraph/go-webkit2/webkit2.(*WebView).RunJavaScript(0xc82000b750, 0xd9a420, 0x28, 0xc820017740) /home/zxl/go/src/github.com/sourcegraph/go-webkit2/webkit2/webview.go:147 +0x1dd github.com/sourcegraph/go-webkit2/webkit2.TestWebView_RunJavaScript.func1(0xc820024278, 0x3) /home/zxl/go/src/github.com/sourcegraph/go-webkit2/webkit2/webview_test.go:219 +0xe6 reflect.Value.call(0x9880c0, 0xc820017680, 0x13, 0xca6170, 0x4, 0xc820017710, 0x2, 0x2, 0x0, 0x0, ...) /usr/local/go/src/reflect/value.go:435 +0x120d reflect.Value.Call(0x9880c0, 0xc820017680, 0x13, 0xc820017710, 0x2, 0x2, 0x0, 0x0, 0x0) /usr/local/go/src/reflect/value.go:303 +0xb1 github.com/gotk3/gotk3/glib.goMarshal(0x7f2c28020dc0, 0x0, 0x2, 0x7f2c398de350, 0x7f2c398de2f0, 0x0) /home/zxl/go/src/github.com/gotk3/gotk3/glib/glib.go:215 +0xa33 github.com/gotk3/gotk3/glib._cgoexpwrap_e2096792664d_goMarshal(0x7f2c28020dc0, 0x0, 0x600000002, 0x7f2c398de350, 0x7f2c398de2f0, 0x0) ??:0 +0x51 github.com/gotk3/gotk3/gtk._Cfunc_gtk_main() ??:0 +0x36 github.com/gotk3/gotk3/gtk.Main() /home/zxl/go/src/github.com/gotk3/gotk3/gtk/gtk.go:866 +0x14 github.com/sourcegraph/go-webkit2/webkit2.TestWebView_RunJavaScript(0xc820073290) /home/zxl/go/src/github.com/sourcegraph/go-webkit2/webkit2/webview_test.go:228 +0x1b0 testing.tRunner(0xc820073290, 0x147fae0) /usr/local/go/src/testing/testing.go:473 +0x98 created by testing.RunTests /usr/local/go/src/testing/testing.go:582 +0x892 exit status 2 FAIL github.com/sourcegraph/go-webkit2/webkit2 0.213s z

petard commented 8 years ago

Same for me on Ubuntu 14.04

nandakola commented 8 years ago

I am also facing the same issue..(Ubuntu 14.4 go 1.6)

tried with version 1.5.4 . go get -u -tags gtk_3_10 github.com/sourcegraph/go-webkit2/...

same eval.go issue described above.. fixed it and re ran the tests..

go test -tags gtk_3_10 github.com/sourcegraph/go-webkit2/webkit2

getting the following issue..

(webkit2.test:3015): Gtk-WARNING **: cannot open display: FAIL github.com/sourcegraph/go-webkit2/webkit2 0.056s

zx9597446 commented 8 years ago

@nandakola: to fix display issue, you should install xfvb, from the document: Note: The tests require an X display. If you are not running in a graphical environment, you can use Xvfb:

Xvfb :1 & export DISPLAY=:1 go test ./webkit2

nandakola commented 8 years ago

Thanks @zx9597446 that works..

jojo05 commented 8 years ago

hi, any idea on how to fix the Go 1.6 pointer sharing issues?

stephenwithav commented 8 years ago

@jojo05 either rewrite the code or run with GODEBUG=chocheck=0.

jojo05 commented 8 years ago

was asking about the pointer sharing issue. Is the issue with the Go webview object or the callback having a Go pointer or both?

geraldstanje commented 7 years ago

is GODEBUG=chocheck=0 still required for go version 1.7.4?