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

ebitenmobile fails in vendor mode and has no option to disable vendor mod #1989

Open
kordax opened this issue Feb 10, 2022 · 5 comments
Open

Comments

@kordax
Copy link

kordax commented Feb 10, 2022

Hi, I have next problem while executing

ebitenmobile bind -a -x -v -target android -javapkg net.isoftservices.client -o ./android/app/libs/client.aar ./src/game/android

Output is:

ebitenmobile bind -a -x -v -target android -javapkg net.isoftservices.client -o ./android/app/libs/client.aar ./src/game/android
PATH=/tmp/ebitenmobile-2356515294/bin:/home/kordax/.nvm/versions/node/v16.13.1/bin:/home/kordax/yandex-cloud/bin:/home/kordax/.symfony/bin:/mnt/extended_partition/Applications/anaconda3/bin:/home/kordax/go/bin:/home/linuxbrew/.linuxbrew/bin:/home/linuxbrew/.linuxbrew/sbin:/home/kordax/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/opt/apache-cxf/bin:/opt/protoc/bin
cd /tmp/ebitenmobile-2356515294
GO111MODULE=on go mod init ebitenmobiletemporary
GO111MODULE=on go get golang.org/x/mobile/cmd/gomobile@5d9a33257ab559d10fa8c96087aed99bf8b6d868
GO111MODULE=on go mod tidy
GO111MODULE=on go build -o bin/gomobile golang.org/x/mobile/cmd/gomobile
GO111MODULE=on go build -o bin/gobind-original golang.org/x/mobile/cmd/gobind
GO111MODULE=on go build -o bin/gobind -tags ebitenmobilegobind src/gobind.go
gomobile init
GOMOBILE=/home/kordax/go/pkg/gomobile
WORK=/tmp/gomobile-work-819293218
GOOS=android CGO_ENABLED=1 /tmp/ebitenmobile-2356515294/bin/gobind -lang=go,java -outdir=$WORK -javapkg=net.isoftservices.client octopus/parts/webgames/bin/shooters-go-client/src/game/android github.com/hajimehoshi/ebiten/v2/mobile/ebitenmobileview
unable to import bind: [-: cannot find package "." in:
	/home/kordax/Projects/maxbet/octopus/vendor/golang.org/x/mobile/bind]
unable to import bind: [-: cannot find package "." in:
	/home/kordax/Projects/maxbet/octopus/vendor/golang.org/x/mobile/bind]
unable to import bind: [-: cannot find package "." in:
	/home/kordax/Projects/maxbet/octopus/vendor/golang.org/x/mobile/bind]
"golang.org/x/mobile/bind" is not found; run go get golang.org/x/mobile/bind: [-: cannot find package "." in:
	/home/kordax/Projects/maxbet/octopus/vendor/golang.org/x/mobile/bind]
2022/02/10 17:03:37 exit status 1
rm -r -f "$WORK"
gomobile: /tmp/ebitenmobile-2356515294/bin/gobind -lang=go,java -outdir=/tmp/gomobile-work-819293218 -javapkg=net.isoftservices.client octopus/parts/webgames/bin/shooters-go-client/src/game/android github.com/hajimehoshi/ebiten/v2/mobile/ebitenmobileview failed: exit status 1

The problem is that ebitenmobile doesn't support -mod mod or -mod readonly and therefore it fails on Gobind when vendor dir is present in the root project's structure.
The current Gomobile package doesn't contain bind and cmd packages in vendor mode and I cannot explicitly force vendor mod for bind/cmd packages using _ import.

$ ls -F vendor/golang.org/x/mobile/
app/  asset/  AUTHORS  CONTRIBUTORS  event/  geom/  gl/  internal/  LICENSE  PATENTS

Is it possible to ignore the vendor directory somehow?
It works fine if there's no vendor directory in the project.

This problem is not as easy as it seems to be, because potentially the Gobind itself can be incapable of such an option.

@hajimehoshi
Copy link
Owner

The current Gomobile package doesn't contain bind and cmd packages in vendor mode and I cannot explicitly force vendor mod for bind/cmd packages using _ import.

I'm not sure the situation, but is this your vendor directory? Is it possible to include cmd in your vendor?

@kordax
Copy link
Author

kordax commented Feb 11, 2022

I can do this, but it will be gone with the next go mod vendor command.

@hajimehoshi
Copy link
Owner

I think this is not an issue in Ebiten but in gomobile. A regular gomobile-bind caused the same error.

@hajimehoshi
Copy link
Owner

golang/go#34181

@hajimehoshi hajimehoshi removed this from the v2.3.0 milestone Feb 11, 2022
@kordax
Copy link
Author

kordax commented Feb 11, 2022

Yep, looks like it's gobind issue:

gobind -lang=go,java -outdir=/tmp/gomobile-work-1386653115 -javapkg=net.isoftservices.client ./src/game/android
unable to import bind: [-: cannot find package "." in:
	/home/kordax/Projects/maxbet/octopus/vendor/golang.org/x/mobile/bind]
unable to import bind: [-: cannot find package "." in:
	/home/kordax/Projects/maxbet/octopus/vendor/golang.org/x/mobile/bind]
unable to import bind: [-: cannot find package "." in:
	/home/kordax/Projects/maxbet/octopus/vendor/golang.org/x/mobile/bind]
"golang.org/x/mobile/bind" is not found; run go get golang.org/x/mobile/bind: [-: cannot find package "." in:
	/home/kordax/Projects/maxbet/octopus/vendor/golang.org/x/mobile/bind]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants