-
Notifications
You must be signed in to change notification settings - Fork 149
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Simplify Android build and bring up to date #273
Conversation
…ndroid gradle plugin 3.0.1
Otherwise, builds are failing with oom
Circle CI fails with out of memory. To reduce memory usage we will compile Themis before starting the emulator. This should also fail the build early if there are any issues with Android build without having to wait for emulator to boot (which takes a while).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
awesome, good job.it's great if after these changes tests will not down on android tests)
@@ -39,15 +46,21 @@ dependencies: | |||
- sudo make rubythemis_install | |||
- sudo make phpthemis_install | |||
- if [ ! -d $BORINGSSL_PATH ]; then cd $HOME && git clone https://boringssl.googlesource.com/boringssl && cd boringssl && git checkout chromium-stable && mkdir build && cd build && cmake .. && make && cp decrepit/libdecrepit.a crypto/; fi | |||
- if [ ! -d $BORINGSSL_PATH/build-armeabi-v7a ]; then cd $BORINGSSL_PATH && mkdir build-armeabi-v7a && cd build-armeabi-v7a && cmake -DANDROID_ABI=armeabi-v7a -DCMAKE_TOOLCHAIN_FILE=../third_party/android-cmake/android.toolchain.cmake -DANDROID_NATIVE_API_LEVEL=16 -GNinja .. && ninja -j 20; fi |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
as I understand here run tests with different android abi. we don't need it more?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The tests used to run (and still are running) with only one ABI. The ABI depends on emulator we start in the CI (which is arm 32 bit ATM). The compilation is done for all ABIs however.
as I see now tests running ~50 minutes and gradlew download dependencies before building ( |
Most of the time is taken not by downloading dependencies, but building |
Thank you @secumod! These changes are great and very welcomed! However, could you please help me building Android tests on macOS? I've pulled your branch to init dependences, installed SDK Platform-Tools 27, SDK Build Tools 27 and CMake using Android Studio. When executing command
This corresponds to the following line in CMakeLists.txt inside BoringSSL repo. I found one Stack Overflow issue with similar question, but I don't think we were supposed to build BoringSSL for mips64, were we? As far as I can say, there is no such line in CircleCI build output, I don't think that CircleCI was compiling BoringSSL for mips64. Moreover, I've noticed that submodule is linked to |
I've specified ABI version adding the following line to the
This fixed compiling mips64 problem, but I can't push to your branch. Is it a good fix? |
Circle CI is not building The fact that your environment tries to build As for branches, I noticed we used to use |
Right, in my case I get
How to explicitly set boringssl architecture omitting mips64? Should I have several cmake statements for each architecture?
|
I would prefer to rely on defaults - as I mentioned above, check your build environment why is it building See https://developer.android.com/ndk/guides/abis.html |
Thank you, currently I'm waiting untill local build finishes, then I'll try to update NDK. According to the documentation:
|
That variable is set by Android gradle build system (depending on the project config), so no need to specify it manually. |
I've updated NDK, it helped to solve the issue with building on mips64, however, I still see various error while building. I'll clean environment, themis folder and put here error log. |
Good news, I've built .aar archives successfully. I'll run tests using |
@secumod can you please review build instructions on wiki page? I'm planning to add requirements (like installing SDK Platform-Tools 27, SDK Build Tools 27, downloading cmake via Android Studio) and short note about using submodules (like Please add notes about building What else you would add? |
merged. @secumod please update docs |
@secumod if I understand correctly, we run tests on Android 22. However latest version is Android 27. Test case are written using Trying to run tests on emulator 24+, I constantly receive error:
I believe we should update Android Tests to target to the latest Android version. What do you think? |
This PR improves Themis Android build:
x86_64
build architecture (now the default for Android native code builds)The PR also includes days of messing with Circle CI to ensure it does not OOM with the new build system.
Relates to #235