Skip to content

Commit

Permalink
Merge #747
Browse files Browse the repository at this point in the history
747: Reduce Android image sizes. r=Emilgardis a=Alexhuszagh

Delete unused toolchains to save ~600MB in our total image sizes. This is done by removing the toolchains for other targets in `/android-ndk/sysroot/usr/lib/`.

Closes #739.

Co-authored-by: Alex Huszagh <ahuszagh@gmail.com>
  • Loading branch information
bors[bot] and Alexhuszagh authored Jun 3, 2022
2 parents a51135f + da9aa4e commit ee4df2b
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ This project adheres to [Semantic Versioning](http://semver.org/).

### Changed

- #747 - reduced android image sizes.
- #377 - update WINE versions to 7.0.
- #734 - patch `arm-unknown-linux-gnueabihf` to build for ARMv6, and add architecture for crosstool-ng-based images.
- #709 - Update Emscripten targets to `emcc` version 3.1.10
Expand Down
24 changes: 24 additions & 0 deletions docker/android-ndk.sh
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,30 @@ main() {
--arch "${arch}" \
--api "${api}"

# clean up unused toolchains to reduce image size
local triple
local triples
local triple_arch="${arch}"
case "${arch}" in
arm64)
triple_arch="aarch64"
;;
x86)
triple_arch="i686"
;;
esac
triples=(
"aarch64-linux-android"
"arm-linux-androideabi"
"i686-linux-android"
"x86_64-linux-android"
)
for triple in "${triples[@]}"; do
if ! [[ "${triple}" =~ ^"${triple_arch}".* ]]; then
rm -rf "/android-ndk/sysroot/usr/lib/${triple}"
fi
done

purge_packages

popd
Expand Down

0 comments on commit ee4df2b

Please sign in to comment.