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: target maccatalyst cannot find OpenGLES header #70664

Open
xcolwell opened this issue Dec 3, 2024 · 2 comments
Open

x/mobile: target maccatalyst cannot find OpenGLES header #70664

xcolwell opened this issue Dec 3, 2024 · 2 comments
Labels
help wanted 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

@xcolwell
Copy link

xcolwell commented Dec 3, 2024

Go version

go version go1.23.3 darwin/arm64

Output of go env in your module/workspace:

GO111MODULE='auto'
GOARCH='arm64'
GOBIN=''
GOCACHE='/Users/brien/Library/Caches/go-build'
GOENV='/Users/brien/Library/Application Support/go/env'
GOEXE=''
GOEXPERIMENT=''
GOFLAGS=''
GOHOSTARCH='arm64'
GOHOSTOS='darwin'
GOINSECURE=''
GOMODCACHE='/Users/brien/go/pkg/mod'
GONOPROXY=''
GONOSUMDB=''
GOOS='darwin'
GOPATH='/Users/brien/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_arm64'
GOVCS=''
GOVERSION='go1.23.3'
GODEBUG=''
GOTELEMETRY='local'
GOTELEMETRYDIR='/Users/brien/Library/Application Support/go/telemetry'
GCCGO='gccgo'
GOARM64='v8.0'
AR='ar'
CC='clang'
CXX='clang++'
CGO_ENABLED='1'
GOMOD='/Users/brien/bringyour/sdk/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 arm64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -ffile-prefix-map=/var/folders/r3/v_3z60rx2cxg0s1r9tl9fbmw0000gn/T/go-build1634776604=/tmp/go-build -gno-record-gcc-switches -fno-common'

What did you do?

Create a xcframework using the following gomobile bind command:

gomobile bind \
	-ldflags "-X client.Version=$WARP_VERSION" \
	-target ios,iossimulator,macos,maccatalyst -iosversion 16.0 \
	-bundleid com.bringyour \
	-trimpath \
	-gcflags "-dwarf=true" \
	-ldflags "-X client.Version=$WARP_VERSION -compressdwarf=false -B gobuildid" \
	-o "build/$BUILD_DIR/URnetworkSdk.xcframework" \
	github.com/urnetwork/sdk;

The command ends with an error:

gomobile: maccatalyst/amd64: go build -gcflags -dwarf=true -ldflags -X client.Version=2024.12.3-outerwerld -compressdwarf=false -B gobuildid -trimpath -buildmode=c-archive -o /var/folders/r3/v_3z60rx2cxg0s1r9tl9fbmw0000gn/T/gomobile-work-3462168386/URnetworkSdk-maccatalyst-amd64.a ./gobind failed: exit status 1
# golang.org/x/mobile/gl
In file included from /Users/brien/go/pkg/mod/golang.org/x/mobile@v0.0.0-20241108191957-fa514ef75a0f/gl/work.go:25:
./work.h:18:10: fatal error: 'OpenGLES/ES2/glext.h' file not found
   18 | #include <OpenGLES/ES2/glext.h>
      |          ^~~~~~~~~~~~~~~~~~~~~~
1 error generated.

What did you see happen?

go build cannot find header file.

In file included from /Users/brien/go/pkg/mod/golang.org/x/mobile@v0.0.0-20241108191957-fa514ef75a0f/gl/work.go:25:
./work.h:18:10: fatal error: 'OpenGLES/ES2/glext.h' file not found
   18 | #include <OpenGLES/ES2/glext.h>
      |          ^~~~~~~~~~~~~~~~~~~~~~
1 error generated.

What did you expect to see?

The maccatalyst libraries should be included in the built xcframework without error.

@gopherbot gopherbot added the mobile Android, iOS, and x/mobile label Dec 3, 2024
@gopherbot gopherbot added this to the Unreleased milestone Dec 3, 2024
@mknyszek mknyszek added help wanted NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. labels Dec 4, 2024
@mknyszek
Copy link
Contributor

mknyszek commented Dec 4, 2024

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