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

x/mobile: add support of Obj-C unsigned char #27723

Closed
tadovas opened this issue Sep 18, 2018 · 1 comment

Comments

Projects
None yet
2 participants
@tadovas
Copy link

commented Sep 18, 2018

Please answer these questions before submitting your issue. Thanks!

What version of Go are you using (go version)?

go version go1.9.2 darwin/amd64

Does this issue reproduce with the latest release?

yes

What operating system and processor architecture are you using (go env)?

GOARCH="amd64"
GOBIN=""
GOEXE=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GOOS="darwin"
GOPATH="/Users/tadovas/work/go/openvpnv3-go-bindings"
GORACE=""
GOROOT="/usr/local/Cellar/go/1.9.2/libexec"
GOTOOLDIR="/usr/local/Cellar/go/1.9.2/libexec/pkg/tool/darwin_amd64"
GCCGO="gccgo"
CC="clang"
GOGCCFLAGS="-fPIC -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/_j/73ymsvw56v989xyfwn6q18_m0000gn/T/go-build298437704=/tmp/go-build -gno-record-gcc-switches -fno-common"
CXX="clang++"
CGO_ENABLED="1"
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"

What did you do?

import "Objc/NetworkExtension/NEPacket"
....
_ = NEPacket.NewWithData(data, uint8(PF_INET))

If possible, provide a recipe for reproducing the error.
A complete runnable program is good.
A link on play.golang.org is best.

What did you expect to see?

succesful gomobile bind command

What did you see instead?

gomobile: /Users/tadovas/work/go/openvpnv3-go-bindings/bin/gobind -lang=go,objc -outdir=/var/folders/_j/73ymsvw56v989xyfwn6q18_m0000gn/T/gomobile-work-389033767 -tags=ios ... failed: exit status 2
panic: invalid kind

goroutine 1 [running]:
golang.org/x/mobile/bind.(*ObjcWrapper).goType(0xc4200f79e0, 0xc420248d40, 0x0, 0x0, 0x0)
/Users/tadovas/work/go/openvpnv3-go-bindings/src/golang.org/x/mobile/bind/genobjcw.go:752 +0x290
golang.org/x/mobile/bind.(*ObjcWrapper).genFuncDecl(0xc4200f79e0, 0x132a000, 0xc42137f860)
/Users/tadovas/work/go/openvpnv3-go-bindings/src/golang.org/x/mobile/bind/genobjcw.go:600 +0xb5
golang.org/x/mobile/bind.(*ObjcWrapper).GenPackage(0xc4200f79e0, 0x3)
/Users/tadovas/work/go/openvpnv3-go-bindings/src/golang.org/x/mobile/bind/genobjcw.go:552 +0x62c
main.genObjcPackages(0x7ffeefbff93e, 0x48, 0xc42135d7e0, 0x3, 0x4, 0x0, 0x0, 0x0, 0x0, 0xc420047b08)
/Users/tadovas/work/go/openvpnv3-go-bindings/src/golang.org/x/mobile/cmd/gobind/gen.go:201 +0x4f9
main.run()
/Users/tadovas/work/go/openvpnv3-go-bindings/src/golang.org/x/mobile/cmd/gobind/main.go:128 +0xec1
main.main()
/Users/tadovas/work/go/openvpnv3-go-bindings/src/golang.org/x/mobile/cmd/gobind/main.go:45 +0x27

It seems that, gomobile correctly handles objc.Char types, but panics on objc.UChar type, which can be easily implemented. PR follows

@gopherbot

This comment has been minimized.

Copy link

commented Sep 18, 2018

Change https://golang.org/cl/135875 mentions this issue: bind: add support for objc.Uchar

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.