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

A preview of the STL refactor for testing purposes #1973

Closed
wants to merge 21 commits into from

Conversation

opacam
Copy link
Member

@opacam opacam commented Aug 26, 2019

This is not intended to be reviewed nor merged, of course commented, but mostly it's for testing purposes. Each change in the code comes from one of the following PRs, merged in top of develop branch (be8566d):

Why this?

  • Because it's hard to test most of the PRs mentioned, since all of them depends on the first one
  • we may not be able to get all of that merged soon, there are some quite of lines in there
  • because I may forgot some recipe STL lib dependent, so we can put in this PR
  • because we may receive complains about non working recipes (all recipes touched in the PRs above I think that are broken right now). Here an alphabetically sorted list, for reference:
    • boost
    • icu
    • leveldb
    • libgeos
    • libtorrent
    • libzmq
    • protobuf_cpp
    • pyicu
    • pyleveldb
    • shapely
    • snappy

So, I encourage any problem related to mentioned recipes to test this PR.

A quick buildozer instructions to test this PR

An buildozer user could test this preview work following the next steps:

pip3 install --user --upgrade https://github.com/kivy/buildozer/archive/master.zip
  • Edit/add buildozer.spec file with:
p4a.fork = opacam
p4a.branch = feature-stl-preview
  • check that you have the right android's NDK at buildozer.spec file (19b since we have 3887d2b merged in develop branch):
android.ndk = 19b
  • delete the .buildozer directory within your app directory
  • trigger the build as usual...but remember to undo the edited buildozer.spec file values once you are done, you don't want to get trapped in the fork's version 😉

To allow us to refactor some common operations that we use in our recipes that depends on android's STL library.

Note: This commit will allow us to begin the migration to `c++_shared`. This is a must when we move to android's NDK r19+, because as for android NDK >= 18 is the only one supported STL library.
Also done here:
  - Remove hardcoded version in url
  - Disable versioned shared libraries
  - Make it to be build as a shared libraries (instead of static)
  - Disable the build of static libraries (because we build them as shared ones, so we avoid to link with them without our consents)
  - Shorten long lines to be pep8's friendly
  - Remove icu from ci/constants
  - Remove `RuntimeError` about the need to use NDK api <= 19 (because that is not the case anymore)
  - consider host's number of cpu to perform the build
Also done here:
  - Remove icu.patch because now we don't have the version in our icu libraries
  - Shorten long lines to be pep8's friendly
make it work with the reworked snappy recipe
which:
  - fix build for android's NDK r19+
  - allow us to build `boost+libtorrent` for any arch
  - Update boost to version `1.69.0`
  - update libtorrent to version `1.2.1`

The build method needs to be changed because one of the scripts used in `boost+libtorrent` build (make-standalone-toolchain.sh), has been removed from android's NDK. [This is because](https://developer.android.com/ndk/guides/standalone_toolchain):

`As of r19, the NDK's default toolchains are standalone toolchains, which renders this process unnecessary.`

Note: since 3887d2b, `python-for-android` uses android's NDK r19 as the minimum supported and also changed the build method used by p4a as [described in here](https://developer.android.com/ndk/guides/other_build_systems)
In here we do:
  - inherit from CppCompiledComponentsPythonRecipe Because depends on android's STL library
  - make use of the base class methods for library recipes
  - Split build_arch into proper methods
  - Shorten some long lines (to be PEP8 friendly)
  - make generated library shared
  - remove recipe from CI/constants
@opacam opacam added the ndk-r19+ pull requests or issues related with android ndk-r19 label Aug 26, 2019
@opacam opacam changed the title [WIP] A preview of the STL refactor for testing purposes A preview of the STL refactor for testing purposes Aug 27, 2019
@opacam
Copy link
Member Author

opacam commented Aug 30, 2019

Closing this because now it's useless.
All the PRs we wished to test were merged in develop branch except one (#1969) which I just rebased into top of develop branch, so there is no need for this 😉

@opacam opacam closed this Aug 30, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ndk-r19+ pull requests or issues related with android ndk-r19
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant