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, Sep 28, 10:06 PM
Unknown Object (File)
Thu, Sep 26, 1:12 PM
Unknown Object (File)
Sun, Sep 22, 5:49 PM
Unknown Object (File)
Sat, Sep 14, 4:51 PM
Unknown Object (File)
Sep 2 2024, 3:53 PM
Unknown Object (File)
Aug 27 2024, 2:13 PM
Unknown Object (File)
Aug 26 2024, 2:56 PM
Unknown Object (File)
Aug 25 2024, 3:43 PM
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