golang / go

The Go programming language
https://go.dev
BSD 3-Clause "New" or "Revised" License
124.04k stars 17.67k forks source link

x/mobile/cmd/gomobile: gomobile bind fails with Xcode 15 #63141

Closed hajimehoshi closed 1 year ago

hajimehoshi commented 1 year ago

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

$ go version
go version go1.21.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
GO111MODULE=''
GOARCH='amd64'
GOBIN=''
GOCACHE='/Users/hajimehoshi/Library/Caches/go-build'
GOENV='/Users/hajimehoshi/Library/Application Support/go/env'
GOEXE=''
GOEXPERIMENT=''
GOFLAGS=''
GOHOSTARCH='amd64'
GOHOSTOS='darwin'
GOINSECURE=''
GOMODCACHE='/Users/hajimehoshi/go/pkg/mod'
GONOPROXY=''
GONOSUMDB=''
GOOS='darwin'
GOPATH='/Users/hajimehoshi/go'
GOPRIVATE=''
GOPROXY='https://proxy.golang.org,direct'
GOROOT='/usr/local/go'
GOSUMDB='sum.golang.org'
GOTMPDIR=''
GOTOOLCHAIN='auto'
GOTOOLDIR='/usr/local/go/pkg/tool/darwin_amd64'
GOVCS=''
GOVERSION='go1.21.1'
GCCGO='gccgo'
GOAMD64='v1'
AR='ar'
CC='clang'
CXX='clang++'
CGO_ENABLED='1'
GOMOD='/Users/hajimehoshi/go-x-mobile/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/60/khbk2xqn1c5bml1byjn89dwc0000gn/T/go-build2181238540=/tmp/go-build -gno-record-gcc-switches -fno-common'

What did you do?

Install Xcode 15.0.

In gomobile directory, run

gomobile bind -target=ios ./example/bind/hello/

What did you expect to see?

This command succeeds

What did you see instead?

This command fails:

gomobile: xcodebuild -create-xcframework -framework /var/folders/60/khbk2xqn1c5bml1byjn89dwc0000gn/T/gomobile-work-3454804453/ios/iphoneos/Hello.framework -framework /var/folders/60/khbk2xqn1c5bml1byjn89dwc0000gn/T/gomobile-work-3454804453/iossimulator/iphonesimulator/Hello.framework -framework /var/folders/60/khbk2xqn1c5bml1byjn89dwc0000gn/T/gomobile-work-3454804453/iossimulator/iphonesimulator/Hello.framework -output Hello.xcframework failed: exit status 70
error: cannot compute path of binary 'Path(str: "/private/var/folders/60/khbk2xqn1c5bml1byjn89dwc0000gn/T/gomobile-work-3454804453/ios/iphoneos/Hello.framework/Versions/A/Hello")' relative to that of '/var/folders/60/khbk2xqn1c5bml1byjn89dwc0000gn/T/gomobile-work-3454804453/ios/iphoneos/Hello.framework'

/CC @hyangah @dmitshur

hajimehoshi commented 1 year ago

I'm sending a CL soon.

gopherbot commented 1 year ago

Change https://go.dev/cl/530135 mentions this issue: cmd/gomobile: resolve symblic links as a workaround for an Xcode bug

brave723 commented 1 year ago

so,how to slove it?

brave723 commented 1 year ago

I'm sending a CL soon.

please send your cl

hajimehoshi commented 1 year ago

please send your cl

https://github.com/golang/go/issues/63141#issuecomment-1729760259

brave723 commented 1 year ago

please send your cl

#63141 (comment)

thanks , I have slove, rebuild gomobile

cherrymui commented 1 year ago

@hajimehoshi on the CL you mentioned that this is likely a bug in xcodebuild in Xcode 15. Have you reported it to Apple? Thanks.

hajimehoshi commented 1 year ago

No, I have not.

hajimehoshi commented 1 year ago

I reported the issue to the forum. This is under review now.

EDIT: https://developer.apple.com/forums/thread/738070

cherrymui commented 1 year ago

Thanks.

losh11 commented 1 year ago

Is there a temp fix for this bug?

cherrymui commented 1 year ago

This is already fixed in the latest version of gomobile. Please update gomobile. Thanks.