Skip to content

x/mobile: build failing when using go modules #37048

Closed
@axet

Description

@axet

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

go version go1.13.7 linux/amd64

Does this issue reproduce with the latest release?

yes

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

go env Output
GO111MODULE=""
GOARCH="amd64"
GOBIN=""
GOCACHE="/home/axet/.cache/go-build"
GOENV="/home/axet/.config/go/env"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GONOPROXY=""
GONOSUMDB=""
GOOS="linux"
GOPATH="/home/axet/.go"
GOPRIVATE=""
GOPROXY="https://proxy.golang.org,direct"
GOROOT="/snap/go/5243"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/snap/go/5243/pkg/tool/linux_amd64"
GCCGO="gccgo"
AR="ar"
CC="gcc"
CXX="g++"
CGO_ENABLED="1"
GOMOD="/home/axet/local/libtorrent/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 -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build037966773=/tmp/go-build -gno-record-gcc-switches"

What did you do?

gomobile failed with "replacement module directory path ... cannot have version"

Probably because gomobile does not support 'go.mod replace command'. Full log:

# git clone -b dev https://gitlab.com/axet/libtorrent
# gomobile bind
gomobile: go build -buildmode=c-shared -o=/tmp/gomobile-work-296787665/android/src/main/jniLibs/armeabi-v7a/libgojni.so ./gobind failed: exit status 1
go: errors parsing go.mod:
/tmp/gomobile-work-296787665/src/go.mod:181: replacement module directory path "/home/axet/.go/pkg/mod/gitlab.com/axet/torrent@v0.0.0-20200205141541-92b4b9e7387e" cannot have version

It also failed with "proper" version like "v0.14.0" or "libtorrent-0.14.0"

Metadata

Metadata

Assignees

No one assigned

    Labels

    FrozenDueToAgeWaitingForInfoIssue is not actionable because of missing required information, which needs to be provided.mobileAndroid, iOS, and x/mobile

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions