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: darwin rename issue #14503

Open
diegostamigni opened this issue Feb 25, 2016 · 5 comments

Comments

@diegostamigni
Copy link

commented Feb 25, 2016

Hello guys, I've updated gomobile and gobind today with go get but unfortunately I'm getting this error while trying to initialize it:

➜ ~ gomobile init
gomobile: rename /Users/osiris/Sviluppo/go/pkg/gomobile/work-984282710/android-ndk-r10e/platforms/android-15/arch-x86/usr /Users/osiris/Sviluppo/go/pkg/gomobile/android-ndk-r10e/x86/sysroot/usr: no such file or directory
➜ ~

Here it is the version:
➜ ~ gomobile version
gomobile version +74f8898 Thu Feb 25 00:29:21 2016 +0000 (android,ios); androidSDK=/Users/osiris/Sviluppo/Android/adt-bundle-mac-x86_64-20140702/sdk/platforms/android-23
➜ ~

@rakyll rakyll added this to the Unreleased milestone Feb 29, 2016

@rakyll rakyll changed the title gomobile darwin rename issue x/mobile/cmd/gomobile: darwin rename issue Feb 29, 2016

@hyangah

This comment has been minimized.

Copy link
Contributor

commented Mar 3, 2016

Deleting $GOPATH/pkg/gomobile/dl directory and run gomobile init again may fix the problem.

@diegostamigni can you do me a favor before deleting the directory?

Run

ls -al $GOPATH/pkg/gomobile/dl

If you find gomobile-ndk-r10e-darwin-x86_64.tar.gz file (or similar) in the directory, let me know what's in the file (tmp.txt from the following command output)

tar -tvzf gomobile-ndk-r10e-darwin-x86_64.tar.gz > tmp.txt

Thanks.

@diegostamigni

This comment has been minimized.

Copy link
Author

commented Mar 3, 2016

Hello @hyangah,
Let's see:

➜ ~ ls -al $GOPATH/pkg/gomobile/dl
total 67232
drwxr-xr-x 5 osiris staff 170 25 Feb 11:24 .
drwxr-xr-x 4 osiris staff 136 3 Mar 17:18 ..
-rw-r--r--@ 1 osiris staff 6148 25 Feb 11:25 .DS_Store
-rw------- 1 osiris staff 33772609 27 Ago 2015 gomobile-ndk-r10e-darwin-x86_64.tar.gz
-rw------- 1 osiris staff 636130 27 Ago 2015 gomobile-openal-soft-1.16.0.1.tar.gz
➜ ~ tar -tvzf $GOPATH/pkg/gomobile/dl/gomobile-ndk-r10e-darwin-x86_64.tar.gz > ~/Desktop/tmp.txt
➜ ~ gomobile init
➜ ~

As you suggested, deleting the $GOPATH/pkg/gomobile/dl fixes the issue.
Regarding the tmp.txt, there you go: tmp.txt

Thanks

@DavidYangNO1

This comment has been minimized.

Copy link

commented Mar 24, 2016

can't download gomobile-ndk-r10e-darwin-x86_64 pkg

@hyangah

This comment has been minimized.

Copy link
Contributor

commented Mar 24, 2016

@DavidYangNO1 Please attach gomobile init -v -x output.

Also, can you check if you can download https://dl.google.com/go/mobile/gomobile-ndk-r10e-darwin-x86_64.tar.gz (using wget or with your browser)?

aoeu pushed a commit to aoeu/mobile that referenced this issue Apr 19, 2016
Travis McDemus
Check hashes of files in download cache for validity
The gomobile init command will use files cached in a 'dl' folder
in lieu of downloading a new file from scratch. If a user of gomobile
does not upgrade for a substantial amount of time, the cached files
will be out of date and possibly cause the init command to fail because
they are missing something the init command now expects.

The init command has a list of expectad sha256 message digests of files
it downloads, which can be utilized to check a file that exists in the 'dl'
folder before proceeeding to utilize it to continue with the init process.

This fixes the problem cited in issue #14503, which is not platform-specific:
golang/go#14503

Some files detailing debugging of the original problem and asserting a solution
are at the following URL:
https://gist.github.com/aoeu/657386c35131b71893153efe34ec07b4
@aoeu

This comment has been minimized.

Copy link

commented Apr 21, 2016

I encountered the same error on one of my systems, and there was enough information here to attempt debugging. I don't believe this problem is unique to Darwin. It appears that gomobile init will use any existing archive file in the 'dl' directory matching an expected filename, even if that archive file has since changed on the hosting server after being originally fetched by gomobile init (and therefore may have a different SHA256 checksum than what is defined for the filename in hashes.go).

I realize this behavior of gomobile init is consistent with go get (fetch, and don't update unless the -u flag is specified), but maybe the code in init.go could assert an archive file found in the 'dl' directory matches the expected hash defined in hashes.go, and provide an error or recommendation to run with the -u flag (or just re-download the archive file automatically)?

If it helps, I documented my debugging session in a forked repository (that Github apparently automatically referenced above) and in https://gist.github.com/aoeu/657386c35131b71893153efe34ec07b4 . Also, if there's a change that could be advised and no one else is already working on it, I can volunteer an attempt at implementing it. (I'm more accustomed to using Gerrit than Github.)

@gopherbot gopherbot added the mobile label Jul 20, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
7 participants
You can’t perform that action at this time.