From f972f3f28d3093e16df450a71da77bb6cd72369f Mon Sep 17 00:00:00 2001 From: Jonas Braathen Date: Fri, 30 Oct 2026 01:56:43 +0100 Subject: [PATCH] build: limit gradle to two workers on eas so android release builds fit in memory --- TODO.md | 18 +++++++++++++----- eas.json | 6 ++++-- 2 files changed, 17 insertions(+), 7 deletions(-) diff --git a/TODO.md b/TODO.md index be9073b..63c7cf2 100644 --- a/TODO.md +++ b/TODO.md @@ -2,11 +2,19 @@ Remove items from this list once they are done. -- check that release builds upload their source maps to Bugsink: on the next EAS build, the log - should show the Sentry plugin's `sentry-cli` sourcemaps upload, and an error thrown in that build - should show symbolicated frames in Bugsink's `cnapp` project. The setup is in place: - `SENTRY_AUTH_TOKEN` is a sensitive EAS variable for preview and production and authenticates - against Bugsink 2.6.1, and the plugin config in `app.json` matches the project +- check that Android release builds now fit on EAS's default worker (4 vCPUs, 15.6 GB): two builds + ran out of memory there, one stalling in the C++ step until EAS's 45-minute limit and the next + failing with "Gradle build daemon disappeared unexpectedly". Reproduced locally under the same + limits (`taskset -c 0-3` and a 15 GB, no-swap systemd scope): the build succeeds in 20 minutes + but peaks at 13.3 GB of anonymous memory while Skia, Reanimated/Worklets, Screens and Sentry + compile their C++ for four ABIs in parallel. Both build profiles in `eas.json` now set + `GRADLE_OPTS: "-Dorg.gradle.workers.max=2"` (Gradle uses 2 worker leases instead of one per CPU). + If that still fails or nears 45 minutes, try `"resourceClass": "large"` for Android (paid plan); + meanwhile `eas build -p android --profile production --local` works, with the .aab submitted + through `eas submit -p android --profile beta --path ` +- check that release builds' source maps make Bugsink's stack traces readable: the upload works + (build 31's log shows `Uploaded files to Sentry` once `SENTRY_URL` was set in `eas.json`), so + throw an error in a release build and check for symbolicated frames in Bugsink's `cnapp` project - consider turning on R8 for Android release builds (SDK 58 default, disabled via `android.enableMinifyInReleaseBuilds: false` in the `expo-build-properties` plugin config in `app.json`): smaller APK, but native Android stack traces get obfuscated unless the R8 mapping diff --git a/eas.json b/eas.json index f8bec1c..b21309d 100644 --- a/eas.json +++ b/eas.json @@ -8,7 +8,8 @@ "EXPO_PUBLIC_DUSKEN_FORGOT_PASSWORD_URL": "https://galtinn.neuf.no/auth/password_reset/", "EXPO_PUBLIC_DUSKEN_PRIVACY_POLICY_URL": "https://galtinn.neuf.no/nb/personvern/", "EXPO_PUBLIC_SENTRY_DSN": "https://af0b4ac4258049d9a21a615b9696190b@bugsink.neuf.no/2", - "SENTRY_URL": "https://bugsink.neuf.no/" + "SENTRY_URL": "https://bugsink.neuf.no/", + "GRADLE_OPTS": "-Dorg.gradle.workers.max=2" } }, "production": { @@ -19,7 +20,8 @@ "EXPO_PUBLIC_DUSKEN_FORGOT_PASSWORD_URL": "https://galtinn.neuf.no/auth/password_reset/", "EXPO_PUBLIC_DUSKEN_PRIVACY_POLICY_URL": "https://galtinn.neuf.no/nb/personvern/", "EXPO_PUBLIC_SENTRY_DSN": "https://af0b4ac4258049d9a21a615b9696190b@bugsink.neuf.no/2", - "SENTRY_URL": "https://bugsink.neuf.no/" + "SENTRY_URL": "https://bugsink.neuf.no/", + "GRADLE_OPTS": "-Dorg.gradle.workers.max=2" } } },