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 bind with go1.23 no exported names in the package #69612

Open
2me2 opened this issue Sep 24, 2024 · 5 comments
Open

x/mobile: gomobile bind with go1.23 no exported names in the package #69612

2me2 opened this issue Sep 24, 2024 · 5 comments
Labels
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

@2me2
Copy link

2me2 commented Sep 24, 2024

Go version

go version go1.23.0.darwin-amd64

Output of go env in your module/workspace:

GO111MODULE=''
GOARCH='amd64'
GOBIN=''
GOCACHE='/Users/2me2/Library/Caches/go-build'
GOENV='/Users/2me2/Library/Application Support/go/env'
GOEXE=''
GOEXPERIMENT=''
GOFLAGS=''
GOHOSTARCH='amd64'
GOHOSTOS='darwin'
GOINSECURE=''
GOMODCACHE='/Users/2me2/go/pkg/mod'
GONOPROXY=''
GONOSUMDB=''
GOOS='darwin'
GOPATH='/Users/2me2/go'
GOPRIVATE=''
GOPROXY='https://proxy.golang.org,direct'
GOROOT='/Users/2me2/go/pkg/mod/golang.org/[email protected]'
GOSUMDB='sum.golang.org'
GOTMPDIR=''
GOTOOLCHAIN='auto'
GOTOOLDIR='/Users/2me2/go/pkg/mod/golang.org/[email protected]/pkg/tool/darwin_amd64'
GOVCS=''
GOVERSION='go1.23.0'
GODEBUG=''
GOTELEMETRY='local'
GOTELEMETRYDIR='/Users/2me2/Library/Application Support/go/telemetry'
GCCGO='gccgo'
GOAMD64='v1'
AR='ar'
CC='clang'
CXX='clang++'
CGO_ENABLED='1'
GOMOD='/Users/2me2/src/play/go.mod'
GOWORK=''
CGO_CFLAGS='-O2 -g'
CGO_CPPFLAGS=''
CGO_CXXFLAGS='-O2 -g'
CGO_FFLAGS='-O2 -g'
CGO_LDFLAGS='-O2 -g'
PKG_CONFIG='pkg-config'
GOGCCFLAGS='-fPIC -arch x86_64 -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -ffile-prefix-map=/var/folders/q_/16fwpggs3_z0skpfkj4_cnfm0000gn/T/go-build3768234229=/tmp/go-build -gno-record-gcc-switches -fno-common'

What did you do?

go install golang.org/x/mobile/cmd/gomobile@latest
gomobile init
go get golang.org/x/mobile/cmd/gomobile@latest

gomobile bind -target ios -x ./mobile

inside ./mobile is a file mobile.go that has the following:

package mobile

func Blah() int {
	return 1
}

go.mod specifically specifies go1.23.0

What did you see happen?

~/src/play  > gomobile bind -target ios -x ./mobile
GOMOBILE=/Users/2me2/go/pkg/gomobile
WORK=/var/folders/q_/16fwpggs3_z0skpfkj4_cnfm0000gn/T/gomobile-work-2833558045
rm -r -f "Mobile.xcframework"
GOOS=ios CGO_ENABLED=1 $GOPATH/bin/gobind -lang=go,objc -outdir=$WORK/ios -tags=ios 2me2test/mobile
GOOS=ios CGO_ENABLED=1 $GOPATH/bin/gobind -lang=go,objc -outdir=$WORK/iossimulator -tags=ios 2me2test/mobile
rm -r -f "$WORK"
gomobile: /Users/2me2/go/bin/gobind -lang=go,objc -outdir=/var/folders/q_/16fwpggs3_z0skpfkj4_cnfm0000gn/T/gomobile-work-2833558045/iossimulator -tags=ios 2me2test/mobile failed: exit status 1
no exported names in the package "2me2test/mobile"
no exported names in the package "2me2test/mobile"
no exported names in the package "2me2test/mobile"
no exported names in the package "2me2test/mobile"

What did you expect to see?

Expected to see everything work fine without the no exported names in the package errors. It works just fine if in go.mod I change the version to 1.22.x. Only seeing this issue in 1.23.x

@gopherbot gopherbot added the mobile Android, iOS, and x/mobile label Sep 24, 2024
@gopherbot gopherbot added this to the Unreleased milestone Sep 24, 2024
@2me2
Copy link
Author

2me2 commented Sep 24, 2024

2me2 was originally a different name i just find/replaced it so you can assume where you see 2me2 it could have been "asdf" or something else. Just in case someone points out gomodule name cannot start with a number (the original didn't).

@hajimehoshi
Copy link
Member

/CC @hyangah @dmitshur

Just in case someone points out gomodule name cannot start with a number (the original didn't).

This is me, and this was my misundertanding: I found a module name only with a number worked https://go.dev/play/p/FfZKGZu-nQn

@dr2chase
Copy link
Contributor

Just because I'm curious if maybe some code wasn't expecting the ".0" (I think that's new-ish) maybe try with 1.23.1. That's a very long shot, though.

@dr2chase dr2chase added the NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. label Sep 26, 2024
@2me2
Copy link
Author

2me2 commented Sep 29, 2024

I've tried with 1.23.1 and same issue.
Removing the .0 gets an error just running go mod tidy.

It works if I do 1.22.7 for example.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
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

5 participants