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: gobind: warnings from compiling generated code for ios #48677

Closed
robpike opened this issue Sep 29, 2021 · 3 comments
Closed

x/mobile: gobind: warnings from compiling generated code for ios #48677

robpike opened this issue Sep 29, 2021 · 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

@robpike
Copy link
Contributor

robpike commented Sep 29, 2021

I ran this script while debugging an XCode problem with Apple:

git clone https://github.com/robpike/ivy.git
git clone https://github.com/golang/mobile.git
#brew install golang  # Already had it installed, but this was in the original script.
go install golang.org/x/mobile/cmd/gomobile@latest
go install golang.org/x/mobile/cmd/gobind@latest
export PATH=~/go/bin/:$PATH
mkdir work; cd work
go mod init work
go get -d golang.org/x/mobile/bind@latest
go get -d robpike.io/ivy/mobile
gomobile bind -target=ios,iossimulator,maccatalyst,macos robpike.io/ivy/mobile
cd ../mobile/example/ivy/ios
ditto ../../../../work/Mobile.xcframework/ Mobile.xcframework/
open ivy.xcodeproj 

After this, even though all was clean and up to date, the compiled binary ran but there were warnings:

Lexical or Preprocessor issue
Double-quoted include ref.h in framework header, expected angle-bracketed include instead.
Mobile obc.h
/Users/r/apple/mobile/example/ivy/ios/ivy/DocsController.m:6:9: While building module 'Mobile' imported from /Users/r/apple/mobile/example/ivy/ios/ivy/DocsController.m:6:
/<module-includes>:2:9: In file included from <module-includes>:2:

/Users/r/Library/Developer/Xcode/DerivedData/ivy-blgeokabvnwvsgfxypexcadtustr/Build/Products/Debug-iphonesimulator/mobile.framework/Headers/Mobile.objc.h:11:10: Double-quoted include "Universe.objc.h" in framework header, expected angle-bracketed instead
/Users/r/apple/mobile/example/ivy/ios/ivy/DocsController.m:6:9: While building module 'Mobile' imported from /Users/r/apple/mobile/example/ivy/ios/ivy/DocsController.m:6:
/<module-includes>:2:9: In file included from <module-includes>:2:

/Users/r/Library/Developer/Xcode/DerivedData/ivy-blgeokabvnwvsgfxypexcadtustr/Build/Products/Debug-iphonesimulator/mobile.framework/Headers/Mobile.h:10:10: Double-quoted include "Mobile.objc.h" in framework header, expected angle-bracketed instead
/Users/r/apple/mobile/example/ivy/ios/ivy/DocsController.m:6:9: While building module 'Mobile' imported from /Users/r/apple/mobile/example/ivy/ios/ivy/DocsController.m:6:
/<module-includes>:4:9: In file included from <module-includes>:4:
go version devel go1.18-a1938435d6 Mon Sep 6 19:10:15 2021 +0000 darwin/amd64
mobile@v0.0.0-20210924032853-1c027f395ef7

% go env
GO111MODULE=""
GOARCH="amd64"
GOBIN="/Users/r/bin"
GOCACHE="/Users/r/Library/Caches/go-build"
GOENV="/Users/r/Library/Application Support/go/env"
GOEXE=""
GOEXPERIMENT=""
GOFLAGS="-ldflags=-w"
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GOINSECURE=""
GOMODCACHE="/Users/r/pkg/mod"
GONOPROXY=""
GONOSUMDB=""
GOOS="darwin"
GOPATH="/Users/r"
GOPRIVATE=""
GOPROXY="https://proxy.golang.org,direct"
GOROOT="/Users/r/go"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/Users/r/go/pkg/tool/darwin_amd64"
GOVCS=""
GOVERSION="devel go1.18-a1938435d6 Mon Sep 6 19:10:15 2021 +0000"
GCCGO="gccgo"
AR="ar"
CC="clang"
CXX="clang++"
CGO_ENABLED="1"
GOMOD="/Users/r/apple/mobile/go.mod"
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -arch x86_64 -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/hs/fxh5g1g977x6bvfxsk5vc27w0000gn/T/go-build1182204920=/tmp/go-build -gno-record-gcc-switches -fno-common"
@robpike robpike changed the title gobind: warnings from compiling generated code for ios x/mobile: gobind: warnings from compiling generated code for ios Sep 29, 2021
@gopherbot gopherbot added the mobile Android, iOS, and x/mobile label Sep 29, 2021
@gopherbot gopherbot added this to the Unreleased milestone Sep 29, 2021
@mknyszek mknyszek added the NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. label Oct 4, 2021
@mknyszek
Copy link
Contributor

mknyszek commented Oct 4, 2021

@gopherbot
Copy link

Change https://golang.org/cl/369198 mentions this issue: example/ivy/ios: turn off quoted include warning from clang

@changkun
Copy link
Member

changkun commented Dec 6, 2021

I sent CL 369198 that simply turn off the warning from the project settings. This is the same approach from the widely used CocoaPods who had to face the same issue since Xcode 12. See large discussions in CocoaPods/CocoaPods#9902, CocoaPods/CocoaPods#9905, https://github.com/CocoaPods/cocoapods-integration-specs/pull/287/files, firebase/firebase-ios-sdk#5987.

@golang golang locked and limited conversation to collaborators Dec 6, 2022
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