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

add OS X / Android armv7 combo to Travis builds - #2344

Closed
incanus wants to merge 2 commits into
masterfrom
osx-android-build-matrix
Closed

incanus wants to merge 2 commits into
masterfrom
osx-android-build-matrix

Conversation

@incanus

@incanus incanus commented Sep 16, 2015

Copy link
Copy Markdown
Contributor

The geojsonvt-related changes in #2288 that landed yesterday turned up some problems in the Android build toolchain on an OS X host. Travis currently only tests Android on Linux hosts, so this adds yet another matrix item to do a simple Android armv7 build on OS X (Xcode 6.4 currently; let's not get too crazy).

/cc @bleege @mikemorris @jfirebaugh @lucaswoj @ljbade

@ljbade

ljbade commented Sep 16, 2015

Copy link
Copy Markdown
Contributor

Xcode version shouldn't matter

@ljbade

ljbade commented Sep 16, 2015

Copy link
Copy Markdown
Contributor

Only travis job failing is new OSX Android matrix which is expected until geojson stuff is fixed.

@jfirebaugh

Copy link
Copy Markdown
Contributor

The build failure here is not due to the geojsonvt stuff:

Installing Android dependencies
$ android-update-sdk --components=build-tools-23.0.1
/Users/travis/build.sh: line 41: android-update-sdk: command not found

@incanus

incanus commented Sep 17, 2015

Copy link
Copy Markdown
Contributor Author

Blocked now by #2351.

@incanus

incanus commented Sep 17, 2015

Copy link
Copy Markdown
Contributor Author

Unblocked.

@bleege

bleege commented Sep 17, 2015

Copy link
Copy Markdown
Contributor

Just to be clear here, in order for Android GL to be a "true" and "useful" test on Travis it needs to run the actual build script. I'm admittedly a bit unclear about what it currently runs and how it's configured, but from my perspective an Android build on Travis needs to run the following:

  • make android
    • Compiles the Core GL C++ layer and makes an arm7 ABI .so object for Android to use
    • Could also use make apackage instead as it compiles ALL shippable ABI
      • Would take longer but would be a "more true" and thorough test
    • The last part of make android and make aproject runs the gradle build script which
      • Compiles the Java portion of the Android SDK
      • Produces shipable binaries (aka artifacts, aka Android Library `.aar')
      • Will be configured to run the automated tests on the Android Library

Again, it's not totally clear to me how or what the existing Android build jobs on Travis are configured to do (and I would ❤️ to know more ). It is clear to me that they currently are not doing what I described above ^^ as the original geojsonvt issue from #2288 would not have returned the false positives that it did.

@incanus

incanus commented Sep 17, 2015

Copy link
Copy Markdown
Contributor Author

This PR attempts to run the build process. The problem is that currently we aren't building Android on OS X at all, just Linux, and that's what missed the issue.

@bleege

bleege commented Sep 17, 2015

Copy link
Copy Markdown
Contributor

@incanus Right. Can you help me understand what running on OS X will do to solve this that Linux currently is failing at? TBH, I'd prefer that Android be built on OS X as that mirrors what the majority of developers use (at least internally).

Also, can you help me understand exactly what the "build process" means to you / what is being setup? What I'm worried about is that Travis is being setup to run a "build process" that isn't accurate.

@incanus

incanus commented Sep 17, 2015

Copy link
Copy Markdown
Contributor Author

OS X vs. Linux: When #2288 landed, it wasn't manually tested for running make android on a Mac, only Travis-tested, which only tests Linux-based Android builds. Hence this PR to catch this class of problems.

Build process: Once this is set, it's going to run like the Linux-based Android or even the OS X client build tests run: using the stuff in scripts/android to essentially run make android.

@bleege

bleege commented Sep 17, 2015

Copy link
Copy Markdown
Contributor

Thanks for the explaination @incanus!

Stupid Question: Can we remove the Android on Linux builds and just build Android on OS X?

@incanus

incanus commented Sep 17, 2015

Copy link
Copy Markdown
Contributor Author

Can we remove the Android on Linux builds and just build Android on OS X?

We could, but one thing we do do on the Linux side is test a bunch of ABIs:

- os: linux
env: FLAVOR=android ANDROID_ABI=arm-v7 BUILDTYPE=Release
android:
components: [ 'build-tools-23.0.1', 'android-23', 'extra-android-m2repository', 'extra-android-support', 'extra-google-m2repository' ]
addons:
apt:
packages: [ 'lib32stdc++6' ]
- os: linux
env: FLAVOR=android ANDROID_ABI=arm-v7 BUILDTYPE=Debug
android:
components: [ 'build-tools-23.0.1', 'android-23', 'extra-android-m2repository', 'extra-android-support', 'extra-google-m2repository' ]
addons:
apt:
packages: [ 'lib32stdc++6' ]
- os: linux
env: FLAVOR=android ANDROID_ABI=arm-v8 BUILDTYPE=Release
android:
components: [ 'build-tools-23.0.1', 'android-23', 'extra-android-m2repository', 'extra-android-support', 'extra-google-m2repository' ]
addons:
apt:
packages: [ 'lib32stdc++6' ]
- os: linux
env: FLAVOR=android ANDROID_ABI=x86 BUILDTYPE=Release
android:
components: [ 'build-tools-23.0.1', 'android-23', 'extra-android-m2repository', 'extra-android-support', 'extra-google-m2repository' ]
addons:
apt:
packages: [ 'lib32stdc++6' ]

@bleege

bleege commented Sep 17, 2015

Copy link
Copy Markdown
Contributor

True, but can those tests also be done on OS X? I'm just trying to minimize the number of moving pieces that are floating around.

@mikemorris

Copy link
Copy Markdown
Contributor

@bleege We should make sure we continue to test:

  • Android builds on OS X and Linux.
  • All the Android platforms.

Maybe this means consolidating the matrix into make apackage on OS X and Linux (if that doesn't take forever), but we shouldn't just drop the Linux builds.

@bleege

bleege commented Sep 17, 2015

Copy link
Copy Markdown
Contributor

@mikemorris Can you help me understand what running the Android builds on Linux achieves? Java / Android compilation is platform independent. As long as the C++ compiler / NDK work the same on both OS X and Linux I don't understand why part of a build is done on OS X and another part is done on Linux.

@incanus

incanus commented Sep 17, 2015

Copy link
Copy Markdown
Contributor Author

Can you help me understand what running the Android builds on Linux achieves?

It's the flip side of what we just saw with OS X + Android: inadvertently breaking another team's toolchain with the assumption that tests passing = everything's ok.

@jfirebaugh

Copy link
Copy Markdown
Contributor

What @incanus said. If we're really squeezed for build capacity or Android CI is the critical path (I don't think either is true at the moment) we might consider dropping just the Linux FLAVOR=android ANDROID_ABI=arm-v7 BUILDTYPE=Release row from the matrix and leaving the other three Linux Android rows. But testing at least one Android build on both Linux and OS X is valuable.

@incanus What's the current status here? Looks like CI is still failing on android-update-sdk: command not found?

@bleege

bleege commented Sep 17, 2015

Copy link
Copy Markdown
Contributor

Ah... so this is more about extending test coverage to other binding SDK products in the specific binding SDK product's natural environment. ie, npm's home is Linux but when committing it needs to know that it's not breaking iOS and / or Android in their natural environments. Gotcha.

Thanks for the insight and humoring me @incanus @jfirebaugh @mikemorris . 👍

@incanus

incanus commented Sep 17, 2015

Copy link
Copy Markdown
Contributor Author

What's the current status here?

Yes, failing on that command after first cut. I will get back to this after #2295, but I think I need to more comprehensively go through Travis' Android setup guide first.

@incanus
incanus force-pushed the osx-android-build-matrix branch from 01e6e39 to 44ee26b Compare September 24, 2015 21:42
@incanus

incanus commented Sep 24, 2015

Copy link
Copy Markdown
Contributor Author

It's not clear from the Android environment docs what the OS is, but it's probably Linux. Trying this on OS X fails with the first command related to the Android SDK.

I attempted to use Travis' help chat, but no one was currently online, so I left a message per their system. Submitting it then had a web application failure and ate my message, so I'll be trying again later.

paris_tuileries_garden_facepalm_statue

@incanus

incanus commented Sep 24, 2015

Copy link
Copy Markdown
Contributor Author

Heard back:

At the moment we do not provide any support for Android on OSX.

You could manually set it up using before_install: steps in your .travis.yml, but we can't guarantee it will work.

Will hold on this for now, but this is an approach we can try — downloading the Android SDK stuff and updating the reqs ourselves. Especially since we don't need to test in emulator right now, just build.

@ljbade

ljbade commented Sep 24, 2015

Copy link
Copy Markdown
Contributor

@incanus Ah like we used to do when we used Linux environment way back. Checkout some really old commits to see if you can revive the install scripts we had for installing Android on Travis.

@incanus

incanus commented Sep 24, 2015

Copy link
Copy Markdown
Contributor Author

Nice, thanks @ljbade.

@ljbade

ljbade commented Nov 12, 2015

Copy link
Copy Markdown
Contributor

We are switching to bitrise, however they only provide Linux build support.

We will have to keep monitoring OSX build issues manually.

@ljbade ljbade closed this Nov 12, 2015
@ljbade
ljbade deleted the osx-android-build-matrix branch November 12, 2015 05:57
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 macOS Mapbox Maps SDK for macOS tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants