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

x/mobile/cmd/gomobile: gomobile install fails when assets dir is symlink #12713

Closed
mokiat opened this issue Sep 22, 2015 · 2 comments
Closed

Comments

@mokiat
Copy link

mokiat commented Sep 22, 2015

It seems that gomobile fails when the assets directory is a symlink. (In my case equal to ../assets/).

I am using go version go1.5.1 darwin/amd64 and gomobile version +afa8a11 Fri Sep 18 00:19:08 2015 +0000 (android,ios);.

panic: runtime error: slice bounds out of range

goroutine 1 [running]:
main.goAndroidBuild.func4(0xc8201f9140, 0x57, 0xaa4180, 0xc8201f59a0, 0x0, 0x0, 0x0, 0x0)
    /Users/momchil/Workspace/Go/src/golang.org/x/mobile/cmd/gomobile/build_androidapp.go:189 +0x170
path/filepath.walk(0xc8201f9140, 0x57, 0xaa4180, 0xc8201f59a0, 0xc82020bb28, 0x0, 0x0)
    /usr/local/go/src/path/filepath/path.go:349 +0x80
path/filepath.Walk(0xc8201f9140, 0x57, 0xc82020bb28, 0x0, 0x0)
    /usr/local/go/src/path/filepath/path.go:396 +0xe1
main.goAndroidBuild(0xc820156000, 0x0, 0x0, 0x0)
    /Users/momchil/Workspace/Go/src/golang.org/x/mobile/cmd/gomobile/build_androidapp.go:191 +0x1ac0
main.runBuild(0x927140, 0x0, 0x0)
    /Users/momchil/Workspace/Go/src/golang.org/x/mobile/cmd/gomobile/build.go:101 +0x760
main.runInstall(0x927140, 0x0, 0x0)
    /Users/momchil/Workspace/Go/src/golang.org/x/mobile/cmd/gomobile/install.go:36 +0xa7
main.main()
    /Users/momchil/Workspace/Go/src/golang.org/x/mobile/cmd/gomobile/main.go:63 +0x495

goroutine 17 [syscall, locked to thread]:
runtime.goexit()
    /usr/local/go/src/runtime/asm_amd64.s:1696 +0x1

Use case: I want to have something that can be compiled both as an Android library but can also be tested as a standalone application, since the later is much quicker to run (and also since Library GL applications are not yet actually supported #12649). I cannot have a lib package and main package in the same folder so they have to be separated and share the assets directory somehow.

@ianlancetaylor ianlancetaylor added this to the Unreleased milestone Sep 22, 2015
@ianlancetaylor
Copy link
Contributor

CC @crawshaw

@rakyll rakyll self-assigned this Sep 22, 2015
@gopherbot
Copy link

CL https://golang.org/cl/14824 mentions this issue.

@golang golang locked and limited conversation to collaborators Sep 23, 2016
imWildCat pushed a commit to imWildCat/go-mobile that referenced this issue Apr 10, 2021
Fixes golang/go#12713.

Change-Id: Ie63a48b2ab3f39d6481fab702e00c762587501b2
Reviewed-on: https://go-review.googlesource.com/14824
Reviewed-by: David Crawshaw <crawshaw@golang.org>
imWildCat pushed a commit to imWildCat/go-mobile that referenced this issue Apr 11, 2021
Fixes golang/go#12713.

Change-Id: Ie63a48b2ab3f39d6481fab702e00c762587501b2
Reviewed-on: https://go-review.googlesource.com/14824
Reviewed-by: David Crawshaw <crawshaw@golang.org>
@rsc rsc unassigned rakyll Jun 23, 2022
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