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

Remove mips and armeabi as supported ABIs #11458

Merged
merged 1 commit into from
May 22, 2018
Merged

Remove mips and armeabi as supported ABIs #11458

merged 1 commit into from
May 22, 2018

Conversation

tobrun
Copy link
Member

@tobrun tobrun commented Mar 15, 2018

Capturing from ndk-guides that:

armeabi and mips were deprecated in r16 and will be removed in r17

This PR adds the required changes to build with NDK 17.

cc @mapbox/maps-android

@tobrun tobrun added the Android Mapbox Maps SDK for Android label Mar 15, 2018
@tobrun tobrun added this to the android-v7.0.0 milestone Mar 15, 2018
@tobrun tobrun self-assigned this Mar 15, 2018
@tobrun tobrun requested a review from kkaefer March 15, 2018 12:15
@tobrun tobrun added the ⚠️ DO NOT MERGE Work in progress, proof of concept, or on hold label Mar 15, 2018
@tobrun
Copy link
Member Author

tobrun commented Mar 15, 2018

PR'ed too soon, also hitting the following when compiling locally against NDK 17:

screen shot 2018-03-15 at 13 25 42

This error points to src/mbgl/renderer/buckets/fill_extrusion_bucket.cpp:105

Any ideas how to correctly resolve this issue?

@tobrun
Copy link
Member Author

tobrun commented Mar 15, 2018

Also hitting:

screen shot 2018-03-15 at 13 28 59

for bitmap.cpp:

screen shot 2018-03-15 at 13 29 40

@kkaefer
Copy link
Contributor

kkaefer commented Mar 15, 2018

Yeah, we should never throw in destructors; it's undefined behavior.

@jfirebaugh
Copy link
Contributor

The -Wtautological-constant-compare warning is a good catch: dist is int16_t, so this comparison is always false:

if (dist > std::numeric_limits<int16_t>::max()) {

@lbud do you recall what the function of this comparison is intended to be?

@tobrun
Copy link
Member Author

tobrun commented Mar 22, 2018

I'm putting this PR on hold til official release of NDK17 + CI image update mapbox/mbgl-ci-images#16.

@tobrun
Copy link
Member Author

tobrun commented May 11, 2018

Working back on this after updating the mbgl-ci-image, addressed previous comments but now hitting:

../../../../../../../mason_packages/headers/boost/1.65.1/include/boost/iostreams/seek.hpp:85:20: error: comparison 'boost::iostreams::stream_offset' (aka 'long') < -9223372036854775808 is always false [-Werror,-Wtautological-constant-compare]
( off < integer_traitsstd::streamoff::const_min ||
~~~ ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../../../../../../../mason_packages/headers/boost/1.65.1/include/boost/iostreams/seek.hpp:86:20: error: comparison 'boost::iostreams::stream_offset' (aka 'long') > 9223372036854775807 is always false [-Werror,-Wtautological-constant-compare]
off > integer_traitsstd::streamoff::const_max ) )
~~~ ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../../../../../../../mason_packages/headers/boost/1.65.1/include/boost/iostreams/seek.hpp:112:20: error: comparison 'boost::iostreams::stream_offset' (aka 'long') < -9223372036854775808 is always false [-Werror,-Wtautological-constant-compare]
( off < integer_traitsstd::streamoff::const_min ||
~~~ ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../../../../../../../mason_packages/headers/boost/1.65.1/include/boost/iostreams/seek.hpp:113:20: error: comparison 'boost::iostreams::stream_offset' (aka 'long') > 9223372036854775807 is always false [-Werror,-Wtautological-constant-compare]
off > integer_traitsstd::streamoff::const_max ) )
~~~ ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
4 errors generated.

These errors are similar to #11458 (comment) but are found in boost that we fetch from Mason. Any guidance how I can fix this?

@mb12
Copy link

mb12 commented May 11, 2018

@tobrun To find out if there are any other issues with the new NDK, you can remove -Werror from CMAKE_CXX_FLAGS in CMakeLists.txt. This may unblock you from making progress. Some mapbox projects like vtzero allow pasisng -DWERROR=OFF for precisely these kind of experiments. Eventually we should add something similar that we can use in MapboxGLAndroidSDK/build.gradle.

@kkaefer
Copy link
Contributor

kkaefer commented May 14, 2018

@tobrun we're using this pattern to silence the warnings from external libraries:

#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wno-tautological-constant-compare"
#include <boost/...>
#pragma GCC diagnostic pop

Technically, we should include them with -isystem instead of -I, but that is blocked by CMake's Xcode generator not supporting them yet.

if (result != ANDROID_BITMAP_RESULT_SUCCESS) {
throw std::runtime_error("bitmap decoding: could not unlock pixels");
}
AndroidBitmap_unlockPixels(&env, jni::Unwrap(*bitmap));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we replace this with a warning?

if (close(fds[PIPE_IN]) || close(fds[PIPE_OUT])) {
throw std::runtime_error("Failed to close file descriptor.");
}

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why are these calls no longer necessary?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

they still are, replaced the throw std::runtime_error(); with logging an error.

@@ -102,9 +102,6 @@ void FillExtrusionBucket::addFeature(const GeometryTileFeature& feature,

const Point<double> perp = util::unit(util::perp(d1 - d2));
const auto dist = util::dist<int16_t>(d1, d2);
if (dist > std::numeric_limits<int16_t>::max()) {
edgeDistance = 0;
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the compiler warned that this check was always false, didn't see an issue removing it.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm yeah, but I think this means that we should change the underlying code that leads to dist being a uint16_t, since the overflow will be hidden there.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Restored the check and added silenced the warning for now to make it compile:
56ff8b1#diff-f07899604a0493652b354b7d538040b1R107

How would you like to proceed? ticketing this in a follow up ticket or fixing it in this PR?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

followup ticket 👍

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@tobrun
Copy link
Member Author

tobrun commented May 15, 2018

@kkaefer this PR is ready for another round of 👀, follow up ticket in #11909.
@LukasPaczos would you be able to 👀 the android changes?

@tobrun tobrun requested a review from LukasPaczos May 15, 2018 07:30
@tobrun tobrun added ✓ ready for review and removed ⚠️ DO NOT MERGE Work in progress, proof of concept, or on hold labels May 15, 2018
compileSdkVersion: 25,
buildToolsVersion: '26.0.3'
targetSdkVersion : 26,
compileSdkVersion: 26,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we bump compileSdkVersion to the 27 while we are at it?

Copy link
Member

@LukasPaczos LukasPaczos left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good on my end 👍

[android] - bump CI image to NDK 17 compatible

[core] - remove setting edgeDistance to 0, comparison 'const short' > 32767 is always false

[android] - remove throwing in desructor, undefined behaviour

[android] - bump dependency versions of project
@Jose4gg
Copy link

Jose4gg commented May 22, 2018

Is there a way that I don't have to wait for this PR and still use NDK 17.x?

@tobrun
Copy link
Member Author

tobrun commented May 22, 2018

@Jose4gg not afaik, I hit the same issue after making this PR and was only able to compile the project again by downgrading my ndk. @kkaefer can I get a second pair of 👀on this?

@Jose4gg
Copy link

Jose4gg commented May 22, 2018

Is there an ETA for this PR?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Android Mapbox Maps SDK for Android
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants