Skip to content

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

Closed
@hajimehoshi

Description

@hajimehoshi

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.

Activity

added this to the Unreleased milestone on Apr 6, 2018
bcmills

bcmills commented on Apr 6, 2018

@bcmills
Contributor
added
NeedsInvestigationSomeone must examine and confirm this is a valid issue and not a duplicate of an existing one.
on Apr 6, 2018
eliasnaur

eliasnaur commented on Apr 6, 2018

@eliasnaur
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.

added
WaitingForInfoIssue is not actionable because of missing required information, which needs to be provided.
on Apr 6, 2018
hajimehoshi

hajimehoshi commented on Apr 7, 2018

@hajimehoshi
MemberAuthor

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

hajimehoshi commented on Apr 7, 2018

@hajimehoshi
MemberAuthor

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!

locked and limited conversation to collaborators on Apr 7, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    FrozenDueToAgeNeedsInvestigationSomeone must examine and confirm this is a valid issue and not a duplicate of an existing one.WaitingForInfoIssue is not actionable because of missing required information, which needs to be provided.mobileAndroid, iOS, and x/mobile

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @hajimehoshi@eliasnaur@bcmills@gopherbot

        Issue actions

          x/mobile/cmd/gomobile: gomobile bind targetting iOS fails · Issue #24733 · golang/go