Closed
Description
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.
Metadata
Metadata
Assignees
Labels
Type
Projects
Relationships
Development
No branches or pull requests
Activity
bcmills commentedon Apr 6, 2018
(CC @eliasnaur)
eliasnaur commentedon Apr 6, 2018
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.
hajimehoshi commentedon Apr 7, 2018
Yes.
Removing that directory didn't solve this problem...
hajimehoshi commentedon Apr 7, 2018
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!