Description
When compiling Go applications using Wails with go get/go build/go install, a set of warnings are printed to the terminal. These warnings are mainly due to the use of two deprecated functions of Webkit, namely webkit_javascript_result_get_global_context and webkit_javascript_result_get_value.
This is mostly apparent when using go install ./... to build all Go packages and commands of a given repository, as otherwise one would use wails build (which seems to silent these warnings).
For at least one of the deprecated functions (webkit_javascript_result_get_value), a replacement function is suggested (webkit_javascript_result_get_js_value).
‘webkit_javascript_result_get_value’ is deprecated: Use 'webkit_javascript_result_get_js_value' instead
No replacement function is listed for webkit_javascript_result_get_global_context’.
warning: ‘webkit_javascript_result_get_global_context’ is deprecated
To Reproduce
Steps to reproduce the behaviour:
wails init to create a new project, and select any of the templates (I tried Angular, but all should illustrate the same warning).go installExpected behaviour
Successful build with no warning messages.
Observed behaviour
Successful build but with warning messages.
u@x1 ~/D/g/s/p/foo123123> wails init
Wails v0.17.0 - Initialising project
System not initialised. Running setup.
What is your name: foo
What is your email address: foo
Wails config saved to: /home/u/.wails/wails.json
Feel free to customise these settings.
The name of the project (My Project): foo
Project Name: foo
The output binary name (foo): foo
Output binary Name: foo
Project directory name (foo): foo
Project Directory: foo
Please select a template:
1: Angular - Angular 8 template (Requires node 10.8+)
2: React JS - Create React App v3 template
3: Vue2/Webpack Basic - A basic Vue2/WebPack4 template
4: Vuetify Basic - Vuetify + Webpack
Please choose an option [1]:
Template: Angular
✓ Generating project...
✓ Building project (this may take a while)...
Project 'foo' built in directory 'foo'!
u@x1 ~/D/g/s/p/foo123123> go install
can't load package: package play/foo123123: no Go files in /home/u/Desktop/go/src/play/foo123123
u@x1 ~/D/g/s/p/foo123123> ls
ï„• foo/
u@x1 ~/D/g/s/p/foo123123> cd foo
$ go install
# github.com/wailsapp/webview
In file included from webview.go:27,
from _cgo_export.c:4:
/home/u/goget/pkg/mod/github.com/wailsapp/[email protected]/webview.h: In function ‘external_message_received_cb’:
/home/u/goget/pkg/mod/github.com/wailsapp/[email protected]/webview.h:278:5: warning: ‘webkit_javascript_result_get_global_context’ is deprecated [-Wdeprecated-declarations]
278 | JSGlobalContextRef context = webkit_javascript_result_get_global_context(r);
| ^~~~~~~~~~~~~~~~~~
In file included from /usr/include/webkitgtk-4.0/webkit2/webkit2.h:56,
from /home/u/goget/pkg/mod/github.com/wailsapp/[email protected]/webview.h:45,
from webview.go:27,
from _cgo_export.c:4:
/usr/include/webkitgtk-4.0/webkit2/WebKitJavascriptResult.h:49:1: note: declared here
49 | webkit_javascript_result_get_global_context (WebKitJavascriptResult *js_result);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from webview.go:27,
from _cgo_export.c:4:
/home/u/goget/pkg/mod/github.com/wailsapp/[email protected]/webview.h:279:5: warning: ‘webkit_javascript_result_get_value’ is deprecated: Use 'webkit_javascript_result_get_js_value' instead [-Wdeprecated-declarations]
279 | JSValueRef value = webkit_javascript_result_get_value(r);
| ^~~~~~~~~~
In file included from /usr/include/webkitgtk-4.0/webkit2/webkit2.h:56,
from /home/u/goget/pkg/mod/github.com/wailsapp/[email protected]/webview.h:45,
from webview.go:27,
from _cgo_export.c:4:
/usr/include/webkitgtk-4.0/webkit2/WebKitJavascriptResult.h:52:1: note: declared here
52 | webkit_javascript_result_get_value (WebKitJavascriptResult *js_result);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# github.com/wailsapp/webview
In file included from /home/u/goget/pkg/mod/github.com/wailsapp/[email protected]/webview.go:27:
/home/u/goget/pkg/mod/github.com/wailsapp/[email protected]/webview.h: In function ‘external_message_received_cb’:
/home/u/goget/pkg/mod/github.com/wailsapp/[email protected]/webview.h:278:5: warning: ‘webkit_javascript_result_get_global_context’ is deprecated [-Wdeprecated-declarations]
278 | JSGlobalContextRef context = webkit_javascript_result_get_global_context(r);
| ^~~~~~~~~~~~~~~~~~
In file included from /usr/include/webkitgtk-4.0/webkit2/webkit2.h:56,
from /home/u/goget/pkg/mod/github.com/wailsapp/[email protected]/webview.h:45,
from /home/u/goget/pkg/mod/github.com/wailsapp/[email protected]/webview.go:27:
/usr/include/webkitgtk-4.0/webkit2/WebKitJavascriptResult.h:49:1: note: declared here
49 | webkit_javascript_result_get_global_context (WebKitJavascriptResult *js_result);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /home/u/goget/pkg/mod/github.com/wailsapp/[email protected]/webview.go:27:
/home/u/goget/pkg/mod/github.com/wailsapp/[email protected]/webview.h:279:5: warning: ‘webkit_javascript_result_get_value’ is deprecated: Use 'webkit_javascript_result_get_js_value' instead [-Wdeprecated-declarations]
279 | JSValueRef value = webkit_javascript_result_get_value(r);
| ^~~~~~~~~~
In file included from /usr/include/webkitgtk-4.0/webkit2/webkit2.h:56,
from /home/u/goget/pkg/mod/github.com/wailsapp/[email protected]/webview.h:45,
from /home/u/goget/pkg/mod/github.com/wailsapp/[email protected]/webview.go:27:
/usr/include/webkitgtk-4.0/webkit2/WebKitJavascriptResult.h:52:1: note: declared here
52 | webkit_javascript_result_get_value (WebKitJavascriptResult *js_result);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
System Details
Please provide your platform, GO version and variables, etc
$ go version
go version go1.13rc2 linux/amd64
$ go env
GO111MODULE=""
GOARCH="amd64"
GOBIN=""
GOCACHE="/home/u/.cache/go-build"
GOENV="/home/u/.config/go/env"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GONOPROXY=""
GONOSUMDB=""
GOOS="linux"
GOPATH="/home/u/goget:/home/u/Desktop/go"
GOPRIVATE=""
GOPROXY="https://proxy.golang.org,direct"
GOROOT="/home/u/go1.13"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/home/u/go1.13/pkg/tool/linux_amd64"
GCCGO="gccgo"
AR="ar"
CC="gcc"
CXX="g++"
CGO_ENABLED="1"
GOMOD="/home/u/Desktop/go/src/play/foo123123/foo/go.mod"
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build258041166=/tmp/go-build -gno-record-gcc-switches"
$ wails version
_ __ _ __
| | / /___ _(_) /____
| | /| / / __ `/ / / ___/
| |/ |/ / /_/ / / (__ ) v0.17.0
|__/|__/\__,_/_/_/____/ https://wails.app
Edit: I didn't intend for this issue to be labeled bug as it should mostly be considered an enhancement to improve the user experience when building projects that use Wails.
Hi. This is a known issue and will be addressed once we move from WebView.
Use wails build for compilation.
On Fri, 4 Oct 2019, 08:30 Robin Eklind, notifications@github.com wrote:
Description
When compiling Go applications using Wails with go get/go build/go install,
a set of warnings are printed to the terminal. These warnings are mainly
due to the use of two deprecated functions of Webkit, namely
webkit_javascript_result_get_global_context and
webkit_javascript_result_get_value.This is mostly apparent when using go install ./... to build all Go
packages and commands of a given repository, as otherwise one would use wails
build (which seems to silent these warnings).For at least one of the deprecated functions (
webkit_javascript_result_get_value), a replacement function is suggested (
webkit_javascript_result_get_js_value).‘webkit_javascript_result_get_value’ is deprecated: Use 'webkit_javascript_result_get_js_value' instead
No replacement function is listed for
webkit_javascript_result_get_global_context’.warning: ‘webkit_javascript_result_get_global_context’ is deprecated
To Reproduce
Steps to reproduce the behaviour:
- Run wails init to create a new project, and select any of the
templates (I tried Angular, but all should illustrate the same warning).- Navigate into the newly created directory and run go install
Expected behaviour
Successful build with no warning messages.Observed behaviour
Successful build but with warning messages.u@x1 ~/D/g/s/p/foo123123> wails init
Wails v0.17.0 - Initialising project
System not initialised. Running setup.
What is your name: foo
What is your email address: foo
Wails config saved to: /home/u/.wails/wails.json
Feel free to customise these settings.
The name of the project (My Project): foo
Project Name: foo
The output binary name (foo): foo
Output binary Name: foo
Project directory name (foo): foo
Project Directory: foo
Please select a template:
1: Angular - Angular 8 template (Requires node 10.8+)
2: React JS - Create React App v3 template
3: Vue2/Webpack Basic - A basic Vue2/WebPack4 template
4: Vuetify Basic - Vuetify + Webpack
Please choose an option [1]:
Template: Angular
✓ Generating project...
✓ Building project (this may take a while)...
Project 'foo' built in directory 'foo'!
u@x1 ~/D/g/s/p/foo123123> go install
can't load package: package play/foo123123: no Go files in /home/u/Desktop/go/src/play/foo123123
u@x1 ~/D/g/s/p/foo123123> ls
ï„• foo/
u@x1 ~/D/g/s/p/foo123123> cd foo
$ go install
github.com/wailsapp/webview
In file included from webview.go:27,
from _cgo_export.c:4:/home/u/goget/pkg/mod/github.com/wailsapp/[email protected]/webview.h: In function ‘external_message_received_cb’:
/home/u/goget/pkg/mod/github.com/wailsapp/[email protected]/webview.h:278:5: warning: ‘webkit_javascript_result_get_global_context’ is deprecated [-Wdeprecated-declarations]
278 | JSGlobalContextRef context = webkit_javascript_result_get_global_context(r);
| ^~~~~~~~~~~~~~~~~~In file included from /usr/include/webkitgtk-4.0/webkit2/webkit2.h:56,
from /home/u/goget/pkg/mod/github.com/wailsapp/[email protected]/webview.h:45, from webview.go:27, from _cgo_export.c:4:/usr/include/webkitgtk-4.0/webkit2/WebKitJavascriptResult.h:49:1: note: declared here
49 | webkit_javascript_result_get_global_context (WebKitJavascriptResult *js_result);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~In file included from webview.go:27,
from _cgo_export.c:4:/home/u/goget/pkg/mod/github.com/wailsapp/[email protected]/webview.h:279:5: warning: ‘webkit_javascript_result_get_value’ is deprecated: Use 'webkit_javascript_result_get_js_value' instead [-Wdeprecated-declarations]
279 | JSValueRef value = webkit_javascript_result_get_value(r);
| ^~~~~~~~~~In file included from /usr/include/webkitgtk-4.0/webkit2/webkit2.h:56,
from /home/u/goget/pkg/mod/github.com/wailsapp/[email protected]/webview.h:45, from webview.go:27, from _cgo_export.c:4:/usr/include/webkitgtk-4.0/webkit2/WebKitJavascriptResult.h:52:1: note: declared here
52 | webkit_javascript_result_get_value (WebKitJavascriptResult *js_result);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~github.com/wailsapp/webview
In file included from /home/u/goget/pkg/mod/github.com/wailsapp/[email protected]/webview.go:27:
/home/u/goget/pkg/mod/github.com/wailsapp/[email protected]/webview.h: In function ‘external_message_received_cb’:
/home/u/goget/pkg/mod/github.com/wailsapp/[email protected]/webview.h:278:5: warning: ‘webkit_javascript_result_get_global_context’ is deprecated [-Wdeprecated-declarations]
278 | JSGlobalContextRef context = webkit_javascript_result_get_global_context(r);
| ^~~~~~~~~~~~~~~~~~In file included from /usr/include/webkitgtk-4.0/webkit2/webkit2.h:56,
from /home/u/goget/pkg/mod/github.com/wailsapp/[email protected]/webview.h:45, from /home/u/goget/pkg/mod/github.com/wailsapp/[email protected]/webview.go:27:/usr/include/webkitgtk-4.0/webkit2/WebKitJavascriptResult.h:49:1: note: declared here
49 | webkit_javascript_result_get_global_context (WebKitJavascriptResult *js_result);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~In file included from /home/u/goget/pkg/mod/github.com/wailsapp/[email protected]/webview.go:27:
/home/u/goget/pkg/mod/github.com/wailsapp/[email protected]/webview.h:279:5: warning: ‘webkit_javascript_result_get_value’ is deprecated: Use 'webkit_javascript_result_get_js_value' instead [-Wdeprecated-declarations]
279 | JSValueRef value = webkit_javascript_result_get_value(r);
| ^~~~~~~~~~In file included from /usr/include/webkitgtk-4.0/webkit2/webkit2.h:56,
from /home/u/goget/pkg/mod/github.com/wailsapp/[email protected]/webview.h:45, from /home/u/goget/pkg/mod/github.com/wailsapp/[email protected]/webview.go:27:/usr/include/webkitgtk-4.0/webkit2/WebKitJavascriptResult.h:52:1: note: declared here
52 | webkit_javascript_result_get_value (WebKitJavascriptResult *js_result);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~System Details
Please provide your platform, GO version and variables, etc$ go version
go version go1.13rc2 linux/amd64
$ go env
GO111MODULE=""
GOARCH="amd64"
GOBIN=""
GOCACHE="/home/u/.cache/go-build"
GOENV="/home/u/.config/go/env"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GONOPROXY=""
GONOSUMDB=""
GOOS="linux"
GOPATH="/home/u/goget:/home/u/Desktop/go"
GOPRIVATE=""
GOPROXY="https://proxy.golang.org,direct"
GOROOT="/home/u/go1.13"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/home/u/go1.13/pkg/tool/linux_amd64"
GCCGO="gccgo"
AR="ar"
CC="gcc"
CXX="g++"
CGO_ENABLED="1"
GOMOD="/home/u/Desktop/go/src/play/foo123123/foo/go.mod"
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build258041166=/tmp/go-build -gno-record-gcc-switches"
$ wails version
_ __ _ __
| | / /___ _(_) /____
| | /| / / __ `/ / / ___/
| |/ |/ / /_/ / / (__ ) v0.17.0
|__/|__/__,_/_/_/____/ https://wails.app
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
https://github.com/wailsapp/wails/issues/247?email_source=notifications&email_token=AAO2SYGMEHTHOQ66IKDNQR3QMZXCBA5CNFSM4I5I63WKYY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4HPQ6WXQ,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AAO2SYCG2IOGZGQ43FXIFFDQMZXCBANCNFSM4I5I63WA
.
Most helpful comment
Hi. This is a known issue and will be addressed once we move from WebView.
Use
wails buildfor compilation.On Fri, 4 Oct 2019, 08:30 Robin Eklind, notifications@github.com wrote: