Skip to content
This repository has been archived by the owner on Aug 8, 2023. It is now read-only.

make android redownloads ndk on every build #2346

Closed
mikemorris opened this issue Sep 16, 2015 · 22 comments
Closed

make android redownloads ndk on every build #2346

mikemorris opened this issue Sep 16, 2015 · 22 comments
Labels
Android Mapbox Maps SDK for Android build

Comments

@mikemorris
Copy link
Contributor

This makes testing any Android build system changes quite slow.

@mikemorris mikemorris added build Android Mapbox Maps SDK for Android labels Sep 16, 2015
@incanus
Copy link
Contributor

incanus commented Sep 16, 2015

Currently looking into this as part of #2344.

@incanus
Copy link
Contributor

incanus commented Sep 16, 2015

From what I can see, the various Mason scripts involved use mason_download, which does in fact check mason_packages/.cache. Digging further.

@incanus
Copy link
Contributor

incanus commented Sep 16, 2015

Checking this list of NDK downloads and hashes — I have a hunch we have a bad hash and that is causing the re-download every time.

https://gist.github.com/incanus/016ac1d43fdc4fae8978

@incanus
Copy link
Contributor

incanus commented Sep 16, 2015

And the scripts are re-downloading arm-9-r10e.tar.gz which isn't mentioned in Mason...

@incanus
Copy link
Contributor

incanus commented Sep 16, 2015

@mikemorris Are you on 10.10 or 10.11? I'm on 10.11.

@incanus
Copy link
Contributor

incanus commented Sep 16, 2015

I think the problem is no osx-10.11 cache:

$ aws s3 ls s3://mason-binaries/ | grep osx
                           PRE osx-10.10/
                           PRE osx-10.9/

@incanus
Copy link
Contributor

incanus commented Sep 16, 2015

Not necessarily the problem, as this version is based on:

xcrun --sdk macosx --show-sdk-version

Which returns 10.10 even on 10.11, depending on Xcode version currently in use.

@incanus
Copy link
Contributor

incanus commented Sep 16, 2015

This may however be a discrepancy between the SDK version and the host version, the latter of which is used for the cache path.

@incanus
Copy link
Contributor

incanus commented Sep 16, 2015

Mason seems to be downloading nested binaries, for example trying to write the NDK to here:

.../gl-native/mason_packages/.build/geojson-vt-cpp-1.1.0/mason_packages/.binaries/osx-10.10/android-ndk/arm-9-r10e.tar.gz

Now this seems related to the geojson-vt changes in #2348.

@incanus
Copy link
Contributor

incanus commented Sep 16, 2015

I'm going to wait until the npm-related changes are reverted in master in #2349 before pursuing this any further.

@incanus
Copy link
Contributor

incanus commented Sep 17, 2015

Confirmed — once #2349 landed, the NDK is only downloaded once.

@incanus incanus closed this as completed Sep 17, 2015
@ljbade
Copy link
Contributor

ljbade commented Sep 17, 2015

On Linux the NDK is cached fine, so never noticed this issue.

@ljbade
Copy link
Contributor

ljbade commented Sep 17, 2015

Oh, @incanus actually yes I remember seeing NDK redownload yesterday and put it down to random network glitch (that was before I was aware of #2348)

@mikemorris
Copy link
Contributor Author

I think the problem is no osx-10.11 cache

I was seeing this on OS X 10.10.5, xcrun --sdk macosx --show-sdk-version returns 10.11 though. That directory nesting does look wrong.

@incanus
Copy link
Contributor

incanus commented Sep 17, 2015

Yeah, this was related to the now-reverted geojson-vt change using it's own nested Mason and installing the NDK multiple times. That's gone now.

@mikemorris
Copy link
Contributor Author

So the initial bug is that there isn't a matching binary published yet...

* Building for Platform 'android/arm-v7-9'...
* Loading install script 'https://github.com/mapbox/mason/blob/android-ndk-arm-9-r10e/script.sh'...
* Downloading binary package osx-10.11/android-ndk/arm-9-r10e.tar.gz...
curl: (22) The requested URL returned error: 403 Forbidden
* Binary not available yet for osx-10.11/android-ndk/arm-9-r10e.tar.gz
* Downloading http://dl.google.com/android/ndk/android-ndk-r10e-darwin-x86_64.bin...

But after downloading the ndk source, everything gets moved into the geojson-vt-cpp directory for some reason and then starts building for the wrong platform?

* Building for Platform 'osx/10.11'...
Copying prebuilt binaries...
Copying sysroot headers and libraries...
Copying c++ runtime headers and libraries (with libc++abi)...
Copying files to: /Users/mikemorris/Projects/mapbox-gl-native/mason_packages/.build/geojson-vt-cpp-1.1.0/mason_packages/osx-10.11/android-ndk/arm-9-r10e

@mikemorris mikemorris reopened this Sep 17, 2015
@incanus
Copy link
Contributor

incanus commented Sep 17, 2015

I think we are talking about two different things.

  1. What I was seeing was with a 10.10 SDK, so the osx-10.10/android-ndk/arm-9-r10e.tar.gz binary did exist, and was getting downloaded, but geojson-vt was nesting it one or more times, so it kept re-downloading it.
  2. What you are seeing @mikemorris is due to the osx-10.11/android-ndk/arm-9-r10e.tar.gz binary not existing, getting downloaded from dl.google.com instead of S3, but also having some problem relating to geojsonvt copying files.

@incanus
Copy link
Contributor

incanus commented Sep 17, 2015

FWIW with a 10.10 SDK, I no longer see my problem as of #2349.

@mikemorris
Copy link
Contributor Author

Looks like geojsonvt-1.1.0 is overwriting the MASON_BUILD_PATH at https://github.com/mapbox/mason/blob/geojsonvt-1.1.0/script.sh#L16? Although other packages seem to do this as well...

@ljbade
Copy link
Contributor

ljbade commented Oct 30, 2015

Does this still happen?

@mikemorris
Copy link
Contributor Author

Think this was "fixed" by adding a mason binary.

@ljbade
Copy link
Contributor

ljbade commented Oct 30, 2015

Ah yeah that's the usual way to prevent recompiling.

@ljbade ljbade closed this as completed Oct 30, 2015
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Android Mapbox Maps SDK for Android build
Projects
None yet
Development

No branches or pull requests

3 participants