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: gomobile iOS compile error: pointer is missing a nullability type specifier #31284

Closed
halseth opened this issue Apr 5, 2019 · 3 comments
Labels
FrozenDueToAge mobile Android, iOS, and x/mobile NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Milestone

Comments

@halseth
Copy link

halseth commented Apr 5, 2019

Re-opening this, since the previous report was closed without a fix: #31015

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

$ go version
go version go1.12.1 darwin/amd64

Does this issue reproduce with the latest release?

Yes

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

go env Output
$ go env
GOARCH="amd64"
GOBIN=""
GOCACHE="/Users/johan/Library/Caches/go-build"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GOOS="darwin"
GOPATH="/Users/johan/golang"
GOPROXY=""
GORACE=""
GOROOT="/usr/local/Cellar/go/1.12.1/libexec"
GOTMPDIR=""
GOTOOLDIR="/usr/local/Cellar/go/1.12.1/libexec/pkg/tool/darwin_amd64"
GCCGO="gccgo"
CC="clang"
CXX="clang++"
CGO_ENABLED="1"
GOMOD="/dev/null"
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 -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/kq/3436m_v11sg0l7zqtmv2r1gw0000gn/T/go-build512725961=/tmp/go-build -gno-record-gcc-switches -fno-common"

What did you do?

Install latest Xcode (10.2) and command line tools.
Install gomobile:

$ GO111MODULE=auto go get -u -v golang.org/x/mobile/cmd/...
$ GO111MODULE=off gomobile init
$ GO111MODULE=off gomobile version
gomobile version +167ebed Wed Mar 27 16:31:28 2019 +0000 (android,ios); androidSDK=<user>/Library/Android/sdk/platforms/android-28

Bulding lnd with gomobile

GO111MODULE=off ${GOPATH}/bin/gomobile bind -target=ios -tags="ios" -v -o ./build/Lndmobile.framework github.com/lightningnetwork/lnd/mobile

(see https://github.com/halseth/lnd/tree/mobile-support/mobile)

What did you expect to see?

Successfully build the iOS framework.

What did you see instead?

github.com/lightningnetwork/lnd/mobile
gobind
# gobind
In file included from _cgo_export.c:4:
In file included from go_lndmobilemain.go:10:
In file included from /var/folders/kq/3436m_v11sg0l7zqtmv2r1gw0000gn/T/gomobile-work-958859495/src/gobind/seq.h:7:
In file included from /var/folders/kq/3436m_v11sg0l7zqtmv2r1gw0000gn/T/gomobile-work-958859495/src/gobind/seq_darwin.h:10:
/var/folders/kq/3436m_v11sg0l7zqtmv2r1gw0000gn/T/gomobile-work-958859495/src/gobind/Universe.objc.h:23:29: error: pointer is missing a nullability type specifier (_Nonnull, _Nullable, or _Null_unspecified) [-Werror,-Wnullability-completeness]
/var/folders/kq/3436m_v11sg0l7zqtmv2r1gw0000gn/T/gomobile-work-958859495/src/gobind/Universe.objc.h:23:29: note: insert '_Nullable' if the pointer may be null
/var/folders/kq/3436m_v11sg0l7zqtmv2r1gw0000gn/T/gomobile-work-958859495/src/gobind/Universe.objc.h:23:29: note: insert '_Nonnull' if the pointer should never be null
/var/folders/kq/3436m_v11sg0l7zqtmv2r1gw0000gn/T/gomobile-work-958859495/src/gobind/Universe.objc.h:25:4: error: pointer is missing a nullability type specifier (_Nonnull, _Nullable, or _Null_unspecified) [-Werror,-Wnullability-completeness]
/var/folders/kq/3436m_v11sg0l7zqtmv2r1gw0000gn/T/gomobile-work-958859495/src/gobind/Universe.objc.h:25:4: note: insert '_Nullable' if the pointer may be null
/var/folders/kq/3436m_v11sg0l7zqtmv2r1gw0000gn/T/gomobile-work-958859495/src/gobind/Universe.objc.h:25:4: note: insert '_Nonnull' if the pointer should never be null
/var/folders/kq/3436m_v11sg0l7zqtmv2r1gw0000gn/T/gomobile-work-958859495/src/gobind/Universe.objc.h:25:30: error: pointer is missing a nullability type specifier (_Nonnull, _Nullable, or _Null_unspecified) [-Werror,-Wnullability-completeness]
/var/folders/kq/3436m_v11sg0l7zqtmv2r1gw0000gn/T/gomobile-work-958859495/src/gobind/Universe.objc.h:25:30: note: insert '_Nullable' if the pointer may be null
/var/folders/kq/3436m_v11sg0l7zqtmv2r1gw0000gn/T/gomobile-work-958859495/src/gobind/Universe.objc.h:25:30: note: insert '_Nonnull' if the pointer should never be null
/Users/johan/golang/bin/gomobile: darwin-arm: go build -tags ios dev experimental ios -v -ldflags -X github.com/lightningnetwork/lnd/build.Commit=queue/v1.0.1-166-gc14a8dca0826718ef8cea820d1b1662dee5bec72 -buildmode=c-archive -o /var/folders/kq/3436m_v11sg0l7zqtmv2r1gw0000gn/T/gomobile-work-958859495/lndmobile-arm.a gobind failed: exit status 2

Note: possible workaround is mentioned in the closed issue: #31015 (comment)

@bcmills bcmills changed the title gomobile iOS compile error: pointer is missing a nullability type specifier x/mobile: gomobile iOS compile error: pointer is missing a nullability type specifier Apr 10, 2019
@gopherbot gopherbot added this to the Unreleased milestone Apr 10, 2019
@gopherbot gopherbot added the mobile Android, iOS, and x/mobile label Apr 10, 2019
@bcmills
Copy link
Contributor

bcmills commented Apr 10, 2019

CC @hyangah

@bcmills bcmills added the NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. label Apr 10, 2019
@champo
Copy link

champo commented Apr 12, 2019

Opened golang/mobile#29 to solve this issue

@halseth
Copy link
Author

halseth commented Apr 23, 2019

Confirming that this is fixed as of 3e0bab5405d63a8f5dd9d9764a24c8e5ac4997fa (master).

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge mobile Android, iOS, and x/mobile NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Projects
None yet
Development

No branches or pull requests

4 participants