Diffusion Comm 2f41fe68f27b

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


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

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.

Reviewers: atul, marcin, varun, jon

Reviewed By: atul

Subscribers: tomek

Differential Revision: https://phab.comm.dev/D9196


ashoatAuthored on Wed, Sep 13, 2:10 PM
Differential Revision
D9196: [native] Clean up after each Android Rust build in CI
rCOMMdf8e1881cd14: [native] use stringForUserExplicit function to determine username text for…