Navigation Menu

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/cmd/gomobile: gomobile bind targetting iOS fails #24733

Closed
hajimehoshi opened this issue Apr 6, 2018 · 4 comments
Closed

x/mobile/cmd/gomobile: gomobile bind targetting iOS fails #24733

hajimehoshi opened this issue Apr 6, 2018 · 4 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. WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided.
Milestone

Comments

@hajimehoshi
Copy link
Member

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

go version go1.10 darwin/amd64

gomobile: 90139f6bae39796e57897e1c9b5728ccb27ac318 (Tue Apr 3 16:24:44 2018 +0200)

Does this issue reproduce with the latest release?

Yes

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

$ go env
GOARCH="amd64"
GOBIN=""
GOCACHE="/Users/hajimehoshi/Library/Caches/go-build"
GOEXE=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GOOS="darwin"
GOPATH="/Users/hajimehoshi/go"
GORACE=""
GOROOT="/usr/local/go"
GOTMPDIR=""
GOTOOLDIR="/usr/local/go/pkg/tool/darwin_amd64"
GCCGO="gccgo"
CC="clang"
CXX="clang++"
CGO_ENABLED="1"
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/7t/qw3np69559591s1v0mk5_p1m0000gn/T/go-build856726715=/tmp/go-build -gno-record-gcc-switches -fno-common"

What did you do?

gomobile bind -target ios golang.org/x/mobile/example/bind/hello

What did you expect to see?

Building succeeds.

What did you see instead?

gomobile: darwin-arm: go build -tags ios -buildmode=c-archive -o /var/folders/7t/qw3np69559591s1v0mk5_p1m0000gn/T/gomobile-work-985560466/hello-arm.a gobind failed: exit status 2
# gobind
In file included from /var/folders/7t/qw3np69559591s1v0mk5_p1m0000gn/T/gomobile-work-985560466/src/gobind/go_hellomain.go:10:
In file included from ./seq.h:7:
./seq_darwin.h:8:2: fatal error: file '/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS11.3.sdk/usr/include/sysexits.h' has been modified since the module file '/var/folders/7t/qw3np69559591s1v0mk5_p1m0000gn/C/org.llvm.clang.hajimehoshi/ModuleCache/3OZO79KXKA6K2/Foundation-A3SOD99KJ0S9.pcm' was built
#include <Foundation/Foundation.h>
 ^
./seq_darwin.h:8:2: note: '/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS11.3.sdk/usr/include/sysexits.h' required by '/var/folders/7t/qw3np69559591s1v0mk5_p1m0000gn/C/org.llvm.clang.hajimehoshi/ModuleCache/3OZO79KXKA6K2/Darwin-MI6WZSG1PNOM.pcm'
./seq_darwin.h:8:2: note: '/var/folders/7t/qw3np69559591s1v0mk5_p1m0000gn/C/org.llvm.clang.hajimehoshi/ModuleCache/3OZO79KXKA6K2/Darwin-MI6WZSG1PNOM.pcm' required by '/var/folders/7t/qw3np69559591s1v0mk5_p1m0000gn/C/org.llvm.clang.hajimehoshi/ModuleCache/3OZO79KXKA6K2/CoreFoundation-10I2D2XL7L7X9.pcm'
./seq_darwin.h:8:2: note: '/var/folders/7t/qw3np69559591s1v0mk5_p1m0000gn/C/org.llvm.clang.hajimehoshi/ModuleCache/3OZO79KXKA6K2/CoreFoundation-10I2D2XL7L7X9.pcm' required by '/var/folders/7t/qw3np69559591s1v0mk5_p1m0000gn/C/org.llvm.clang.hajimehoshi/ModuleCache/3OZO79KXKA6K2/Foundation-A3SOD99KJ0S9.pcm'
./seq_darwin.h:8:2: note: please rebuild precompiled header '/var/folders/7t/qw3np69559591s1v0mk5_p1m0000gn/C/org.llvm.clang.hajimehoshi/ModuleCache/3OZO79KXKA6K2/Foundation-A3SOD99KJ0S9.pcm'
1 error generated.
@gopherbot gopherbot added this to the Unreleased milestone Apr 6, 2018
@gopherbot gopherbot added the mobile Android, iOS, and x/mobile label Apr 6, 2018
@bcmills
Copy link
Contributor

bcmills commented Apr 6, 2018

(CC @eliasnaur)

@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 6, 2018
@eliasnaur
Copy link
Contributor

I can't reproduce this and from the message about the stale precompiled header it doesn't seem like a gomobile issue. Can you build and run Objective-C apps from Xcode?

FWIW, https://stackoverflow.com/questions/19391768/file-has-been-modified-since-the-precompiled-header-was-built suggests cleaning the precompiled header cache.

@bcmills bcmills added the WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided. label Apr 6, 2018
@hajimehoshi
Copy link
Member Author

Can you build and run Objective-C apps from Xcode?

Yes.

FWIW, https://stackoverflow.com/questions/19391768/file-has-been-modified-since-the-precompiled-header-was-built suggests cleaning the precompiled header cache.

Removing that directory didn't solve this problem...

@hajimehoshi
Copy link
Member Author

Ah, it looks like removing /var/folders/7t/qw3np69559591s1v0mk5_p1m0000gn/C/org.llvm.clang.hajimehoshi/ModuleCache solved this problem. gomobile bind succeeded after that. Thank you!

@golang golang locked and limited conversation to collaborators Apr 7, 2019
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. WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided.
Projects
None yet
Development

No branches or pull requests

4 participants