Skip to content

Conversation

@tkirshboim
Copy link
Member

@tkirshboim tkirshboim commented Aug 20, 2017

This pull request updates pd-for-android to the current libpd master branch which is based on PD 0.48.

The NDK build was initially failing for the following reasons which this PR solves:

The changes to Android.mk in the libpd repo should be merged first and then this PR could be updated to use the original libpd repo (instead of my own fork).

Pinging also @nettoyeurny : Perhaps you have a suggestion how raising the API level to 17 could be avoided?..

@tkirshboim
Copy link
Member Author

The Circle CI build is failing, however I think this is because I'm using my own fork for libpd.
Once libpd/libpd#183 is merged I could change this PR to use the original libpd repo.

Copy link

@rpattabi rpattabi left a comment

Choose a reason for hiding this comment

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

min sdk from 9 to 17 may be the only contention with this PR. Could we at least get it to 16? Jelly Bean is still alive unfortunately.

@joebowbeer
Copy link
Contributor

joebowbeer commented Sep 10, 2017

Regarding min version, building current master with NDK r15 emits a warning that our min version is effectively android-14:

:PdCore:buildNative
Android NDK: android-9 is unsupported. Using minimum supported version android-14.
Android NDK: WARNING: APP_PLATFORM android-14 is higher than android:minSdkVersion 1
in pd-for-android/PdCore/AndroidManifest.xml. NDK binaries will *not* be comptible with
devices older than android-14.

See https://android.googlesource.com/platform/ndk/+/master/docs/user/common_problems.md
for more information.

This change was introduced in NDK r15:

https://github.com/android-ndk/ndk/wiki/Changelog-r15

- Raises min API level to 17 to make NDK build work
NDK builds fail with API levels below 17. The reason is that https://github.com/pure-data/pure-data/blob/master/src/s_inter.c uses system calls 'munlockall' and 'mlockall' and these not defined for API levels 16 and below when building with NDK.
- Adds PD 0.48 objects to PdTest patch
@tkirshboim
Copy link
Member Author

I've updated this PR and it is now based on the latest pd-for-android and libpd master branches.

Regarding the issue of raising the minimum required Android SDK version from 14 to 17:
This is required if we build the current pure-data sources with NDK. As far as I understand the munlockall and mlockall functions were added to NDK from API level 17. This is visible when comparing NDK functions for API level 16 with NDK functions for API level 17.

As far as I understand, the options we have to avoid raising the min API level is to either:

  • Build pd-for-android using CMake (I don't know if this can actually solve this issue, this is just a guess). Or:
  • Suggest a change in the pure-data core source code.

I won't be able to explore these options, but if anyone else is interested please bring this up.

I'd like to add that Android versions 14-16 are currently under 3% of all active Android devices according to Google and that it will still be possible to support these versions with pd-for-android version 1.0.2.

pinging @joebowbeer for a second review and @nettoyeurny for any comments on the issue of raising the minimal Android API level.

@tkirshboim tkirshboim force-pushed the pd_0.48 branch 5 times, most recently from ea510a4 to 5a0dd9c Compare November 18, 2017 12:01
CircleCI NDK version is 10d. This change downloads NDK 15c and uses it instead
@tkirshboim tkirshboim changed the title WIP: Upgrade to PD 0.48 Upgrade to PD 0.48 Nov 18, 2017
Copy link
Contributor

@joebowbeer joebowbeer left a comment

Choose a reason for hiding this comment

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

I'm still hoping we can keep minSdkVersion at 14

circle.yml Outdated
@@ -5,7 +5,7 @@ machine:

# Add ANDROID_NDK_HOME until CircleCI implements this requested feature.
Copy link
Contributor

Choose a reason for hiding this comment

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

Remove obsolete comment

circle.yml Outdated
- echo y | android update sdk --no-ui --all --filter "tools"
- echo y | android update sdk --no-ui --all --filter "build-tools-26.0.2"
- yes | /usr/local/android-sdk-linux/tools/bin/sdkmanager --update --verbose
- wget https://dl.google.com/android/repository/android-ndk-r15c-linux-x86_64.zip; unzip android-ndk-r15c-linux-x86_64.zip:
Copy link
Contributor

Choose a reason for hiding this comment

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

As per discussion below, ndk installation can be performed by sdk-manager?

https://discuss.circleci.com/t/licences-for-android-build-tools-not-accepted/17285/22

Copy link
Member Author

@tkirshboim tkirshboim Jan 13, 2018

Choose a reason for hiding this comment

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

Yes, but then I assume we'll get the latest NDK version, not a specific one.
Since NDK builds are often sensitive to the NDK version that is used, perhaps it's better to keep this as it is right now?

Copy link
Contributor

Choose a reason for hiding this comment

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

With enough stars, perhaps CircleCI will provide this ready-made:

https://github.com/circleci/circleci-images/issues/73

@evabishchevich
Copy link

Does minSdk prevent this PR from being merged?

@tkirshboim
Copy link
Member Author

@joebowbeer latest commit also closes #78

@tkirshboim
Copy link
Member Author

Might also close #79 (needs to be tested)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants