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

Android builds use excessively huge ndk archive and takes very long to upload cached dependencies. #583

Open
mgautierfr opened this issue Mar 29, 2023 · 0 comments

Comments

@mgautierfr
Copy link
Member

mgautierfr commented Mar 29, 2023

Android's ndk use zip archive format and all symlink files are replaced with plain file at cost of content duplication.
(It seems that it is a known and partly fixed problem on android side android/ndk#1275)

In each of our android variant of our CI, we download the ndk, install it and included the installed ndk in our dependency caches archives. The installed ndk is included in base_deps2_bionic_android_*.tar.xz, deps_bionic_android_*_libzim.tar.xz and deps_bionic_android_*_libkiwix.tar.xz [1]. Each archive is around 500Mb (compressed) and so at each run, we have to:

  • Download base_deps2_bionic_android_*.tar.xz.
  • Uncompress it
  • Build dependencies for libzim
  • Compress and upload deps_bionic_android_*_libzim.tar.xz
  • Build dependencies for libkiwix
  • Compress and upload deps_bionic_android_*_libkiwix.tar.xz

So our android build in the CI takes around 1h30 to run even if we are compiling almost nothing.

Possible solution:

  • Move to a more recent ndk : It seems that last version of the ndk has fixed the issue : ndk r25c is about 500MB when r21e (which we use) is around 1GB. (https://developer.android.com/ndk/downloads) So we can expect the installed ndk to also be smaller. But as Identical files should be replaced with symlinks android/ndk#1275 states it, a lot of saved space is about removed tools, I don't know what would be the installed size. And changing the ndk version may have impact on our build system and generated binary.
  • Create our own version of the ndk by identifying duplicate content and replace them with symlink manually.
  • Use other archive format which do de-duplication (personal advertisement: arx could be a good candidate)

[1] Without speaking about the versioning taking even more space on our server (but we simply have to clean them manually)

@mgautierfr mgautierfr changed the title Android builds use excessively huge ndk archive and takes very long to upload cached depeendencies. Android builds use excessively huge ndk archive and takes very long to upload cached dependencies. Mar 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants