Page MenuHomePhabricator

[native] Clean up after each Android Rust build in CI
ClosedPublic

Authored by ashoat on Sep 13 2023, 2:11 PM.
Tags
None
Referenced Files
Unknown Object (File)
Sat, Nov 30, 7:37 PM
Unknown Object (File)
Sat, Nov 16, 9:40 PM
Unknown Object (File)
Sat, Nov 16, 9:40 PM
Unknown Object (File)
Sat, Nov 16, 9:40 PM
Unknown Object (File)
Sat, Nov 16, 9:40 PM
Unknown Object (File)
Oct 15 2024, 6:00 AM
Unknown Object (File)
Oct 15 2024, 6:00 AM
Unknown Object (File)
Oct 15 2024, 5:59 AM
Subscribers

Details

Summary

Our GitHub Android workflows are once again running out of disk space. This diff modifies the Android CMake build to clear out build artifacts immediately after each of the three Rust builds (one for each build variant).

Test Plan

I tested 7 different workflows in my local environment. All builds were successful. After each build, I measured the size of the native/android/app/.cxx folder, and then deleted that folder before running the next test. Here are the results:

testcommanddisk utilization of native/android/app/.cxx
CI releaseCI=true yarn react-native run-android --variant=release1019 MiB
non-CI releaseyarn react-native run-android --variant=release2801 MiB
CI debugCI=true yarn react-native run-android1214 MiB
non-CI debugyarn react-native run-android5160 MiB
CI bundleReleaseCI=true ./gradlew bundleRelease1069 MiB
non-CI bundleRelease./gradlew bundleRelease2802 MiB
CI other variantCI=true yarn react-native run-android # with CMAKE_BUILD_TYPE forced to unsupported value5159 MiB

Based on the above data, this diff should reduce disk usage by 3.85 GiB on the GitHub Android CI, and by 1.69 GiB on the GitHub Android release workflow.

It’s possible that the environmental variables propagate differently in the actual CI environment, but I’m expecting this to work. It’s also possible that this diff doesn’t reduce disk usage enough, but I’m hoping it will.

Diff Detail

Repository
rCOMM Comm
Lint
Lint Not Applicable
Unit
Tests Not Applicable