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

cmd/go: go build failed because mod could not write #33360

Closed
wawababe opened this issue Jul 30, 2019 · 2 comments
Closed

cmd/go: go build failed because mod could not write #33360

wawababe opened this issue Jul 30, 2019 · 2 comments

Comments

@wawababe
Copy link

wawababe commented Jul 30, 2019

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

go version go1.12.6 darwin/amd64

Does this issue reproduce with the latest release?

yes

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

go env Output
GOARCH="amd64"
GOBIN=""
GOCACHE="/Users/ting/Library/Caches/go-build"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GOOS="darwin"
GOPATH="/Users/ting/work"
GOPROXY="https://proxy.golang.org"
GORACE=""
GOROOT="/usr/local/opt/go/libexec"
GOTMPDIR=""
GOTOOLDIR="/usr/local/opt/go/libexec/pkg/tool/darwin_amd64"
GCCGO="gccgo"
CC="clang"
CXX="clang++"
CGO_ENABLED="1"
GOMOD="/Users/ting/work/src/wx-gitlab.xunlei.cn/light-wallet/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 -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/bp/t2ccpzqs2632vbxd_j4p1mz00000gn/T/go-build278264811=/tmp/go-build -gno-record-gcc-switches -fno-common"

What did you do?

I turned on GO111MODULE and use the go mobile to build the project. But it failed. The message is:

tingdeMacBook-Pro:light-wallet ting$ make android
build/env.sh go run build/ci.go aar --local
go: finding golang.org/x/sys v0.0.0-20190726091711-fc99dfbffb4e
>>> /usr/local/opt/go/libexec/bin/go get golang.org/x/mobile/cmd/gomobile golang.org/x/mobile/cmd/gobind
go: finding golang.org/x/mobile latest
>>> /Users/ting/work/src/wx-gitlab.xunlei.cn/light-wallet/build/_workspace/src/wx-gitlab.xunlei.cn/light-wallet/build/bin/gomobile bind -ldflags -s -w --target android --javapkg org.ethereum -v wx-gitlab.xunlei.cn/light-wallet/mobile
type-checking package "wx-gitlab.xunlei.cn/light-wallet/mobile" failed (/Users/ting/work/src/wx-gitlab.xunlei.cn/light-wallet/build/_workspace/src/wx-gitlab.xunlei.cn/light-wallet/mobile/accounts.go:35:2: could not import wx-gitlab.xunlei.cn/light-wallet/accounts/keystore (type-checking package "wx-gitlab.xunlei.cn/light-wallet/accounts/keystore" failed (/Users/ting/work/src/wx-gitlab.xunlei.cn/light-wallet/accounts/keystore/watch.go:25:2: could not import github.com/rjeczalik/notify (type-checking package "github.com/rjeczalik/notify" failed (/Users/ting/work/src/wx-gitlab.xunlei.cn/light-wallet/build/_workspace/pkg/mod/github.com/rjeczalik/notify@v0.9.2/event_inotify.go:9:8: could not import golang.org/x/sys/unix (go/build: importGo golang.org/x/sys/unix: exit status 1
go: writing go.sum: open /Users/ting/work/src/wx-gitlab.xunlei.cn/light-wallet/build/_workspace/pkg/mod/github.com/rjeczalik/notify@v0.9.2/go.sum975357160.tmp: permission denied

))))))

/Users/ting/work/src/wx-gitlab.xunlei.cn/light-wallet/build/_workspace/src/wx-gitlab.xunlei.cn/light-wallet/build/bin/gomobile: /Users/ting/work/src/wx-gitlab.xunlei.cn/light-wallet/build/_workspace/src/wx-gitlab.xunlei.cn/light-wallet/build/bin/gobind -lang=go,java -outdir=/var/folders/bp/t2ccpzqs2632vbxd_j4p1mz00000gn/T/gomobile-work-233318859 -javapkg=org.ethereum wx-gitlab.xunlei.cn/light-wallet/mobile failed: exit status 1

util.go:45: exit status 1
exit status 1
make: *** [android] Error 1

What did you expect to see?

The compiled jar package.

What did you see instead?

go: writing go.sum: open /Users/ting/work/src/wx-gitlab.xunlei.cn/light-wallet/build/_workspace/pkg/mod/github.com/rjeczalik/notify@v0.9.2/go.sum975357160.tmp: permission denied

@AlexRouSg
Copy link
Contributor

gomobile does not support modules yet. See #27234

@katiehockman
Copy link
Contributor

Duplicate of #27234

For now, just keep GO111MODULE=off for go mobile.

@golang golang locked and limited conversation to collaborators Jul 29, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants