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: iOS binding generation fails when package name starts with an uppercase #21552

Closed
omartin opened this issue Aug 22, 2017 · 1 comment

Comments

Projects
None yet
2 participants
@omartin
Copy link

commented Aug 22, 2017

Please answer these questions before submitting your issue. Thanks!

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

1.8.3

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/olive/go"
GORACE=""
GOROOT="/usr/local/go"
GOTOOLDIR="/usr/local/go/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/jc/w249cklx2k12hyfc5bl1zzpc0000gn/T/go-build190811611=/tmp/go-build -gno-record-gcc-switches -fno-common"
CXX="clang++"
CGO_ENABLED="1"
PKG_CONFIG="pkg-config"
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"

What did you do?

gomobile bind -target ios

With a simple file :

package Foo

type Foo struct {
}

=> fails

But if I use
package foo

It works

What did you expect to see?

It should generate the iOS binding

What did you see instead?

gomobile: darwin-armv7: go build -pkgdir=/Users/olive/go/pkg/gomobile/pkg_darwin_arm -tags ios -buildmode=c-archive -o /var/folders/jc/w249cklx2k12hyfc5bl1zzpc0000gn/T/gomobile-work-917987727/Foo-arm.a /var/folders/jc/w249cklx2k12hyfc5bl1zzpc0000gn/T/gomobile-work-917987727/src/iosbin/main.go failed: exit status 2
# _/var/folders/jc/w249cklx2k12hyfc5bl1zzpc0000gn/T/gomobile-work-917987727/src/gomobile_bind
/var/folders/jc/w249cklx2k12hyfc5bl1zzpc0000gn/T/gomobile-work-917987727/src/gomobile_bind/Foo.m:12:17: error: cannot find interface declaration for 'FooFoo' [-Werror]
/var/folders/jc/w249cklx2k12hyfc5bl1zzpc0000gn/T/gomobile-work-917987727/src/gomobile_bind/Foo.m:16:10: error: 'FooFoo' cannot use 'super' because it is a root class
/var/folders/jc/w249cklx2k12hyfc5bl1zzpc0000gn/T/gomobile-work-917987727/src/gomobile_bind/Foo.m:17:14: error: use of undeclared identifier '__ref'
/var/folders/jc/w249cklx2k12hyfc5bl1zzpc0000gn/T/gomobile-work-917987727/src/gomobile_bind/Foo.m:22:10: error: 'FooFoo' cannot use 'super' because it is a root class
/var/folders/jc/w249cklx2k12hyfc5bl1zzpc0000gn/T/gomobile-work-917987727/src/gomobile_bind/Foo.m:24:3: error: use of undeclared identifier '__ref'
/var/folders/jc/w249cklx2k12hyfc5bl1zzpc0000gn/T/gomobile-work-917987727/src/gomobile_bind/Foo.m:12:17: error: class 'FooFoo' defined without specifying a base class [-Werror,-Wobjc-root-class]
/var/folders/jc/w249cklx2k12hyfc5bl1zzpc0000gn/T/gomobile-work-917987727/src/gomobile_bind/Foo.m:12:23: note: add a super class to fix this problem

@gopherbot gopherbot added this to the Unreleased milestone Aug 22, 2017

@gopherbot gopherbot added the mobile label Aug 22, 2017

@gopherbot

This comment has been minimized.

Copy link

commented Mar 16, 2018

Change https://golang.org/cl/101116 mentions this issue: bind: avoid header guard clashes for uppercase Go packages

@golang golang locked and limited conversation to collaborators Mar 21, 2019

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