fix(fdroid): cap Gradle heap + drop daemons so the build survives host RAM pressure
The reproducible build OOM-killed the Gradle daemon ('daemon disappeared
unexpectedly') mid flutter-build-apk on the shared runner. The app's
gradle.properties reserves -Xmx8G+4G metaspace (~12G), and the fdroid
build also compiles tesseract4android from source first (its daemon
lingers), so combined peak RAM trips the OS OOM-killer under contention
(the same build succeeded on a quieter host earlier). Scope the fix to
the fdroid build (don't touch the committed 8G the play/local builds
rely on): run tesseract's gradle with --no-daemon so it frees memory
before the app build, and append a lower -Xmx4g + org.gradle.daemon=false
override to gradle.properties in prebuild (last-key-wins; F-Droid runs
the same steps and memory settings don't change output bytes, so it stays
reproducible).
This commit is contained in:
parent
08459ad29d
commit
e4c62f2b56
1 changed files with 9 additions and 3 deletions
|
|
@ -41,6 +41,8 @@ Builds:
|
|||
- $$flutter$$/bin/flutter config --no-analytics
|
||||
- $$flutter$$/bin/flutter pub get --enforce-lockfile
|
||||
- "sed -i '/^buildscript {/,/^}/d' $PUB_CACHE/hosted/pub.dev/flutter_tesseract_ocr-*/android/build.gradle"
|
||||
- 'echo "org.gradle.jvmargs=-Xmx4g -XX:MaxMetaspaceSize=1g" >> apps/app_seeds/android/gradle.properties'
|
||||
- 'echo "org.gradle.daemon=false" >> apps/app_seeds/android/gradle.properties'
|
||||
- cd apps/app_seeds
|
||||
- $$flutter$$/bin/dart run slang
|
||||
- $$flutter$$/bin/dart run build_runner build --delete-conflicting-outputs
|
||||
|
|
@ -49,7 +51,7 @@ Builds:
|
|||
build:
|
||||
- export PUB_CACHE=$(cd ../.. && pwd)/.pub-cache
|
||||
- pushd $$tesseract4android$$/tesseract4android
|
||||
- gradle assembleStandardRelease
|
||||
- gradle --no-daemon assembleStandardRelease
|
||||
- popd
|
||||
- cp
|
||||
$$tesseract4android$$/tesseract4android/build/outputs/aar/tesseract4android-standard-release.aar
|
||||
|
|
@ -75,6 +77,8 @@ Builds:
|
|||
- $$flutter$$/bin/flutter config --no-analytics
|
||||
- $$flutter$$/bin/flutter pub get --enforce-lockfile
|
||||
- "sed -i '/^buildscript {/,/^}/d' $PUB_CACHE/hosted/pub.dev/flutter_tesseract_ocr-*/android/build.gradle"
|
||||
- 'echo "org.gradle.jvmargs=-Xmx4g -XX:MaxMetaspaceSize=1g" >> apps/app_seeds/android/gradle.properties'
|
||||
- 'echo "org.gradle.daemon=false" >> apps/app_seeds/android/gradle.properties'
|
||||
- cd apps/app_seeds
|
||||
- $$flutter$$/bin/dart run slang
|
||||
- $$flutter$$/bin/dart run build_runner build --delete-conflicting-outputs
|
||||
|
|
@ -83,7 +87,7 @@ Builds:
|
|||
build:
|
||||
- export PUB_CACHE=$(cd ../.. && pwd)/.pub-cache
|
||||
- pushd $$tesseract4android$$/tesseract4android
|
||||
- gradle assembleStandardRelease
|
||||
- gradle --no-daemon assembleStandardRelease
|
||||
- popd
|
||||
- cp
|
||||
$$tesseract4android$$/tesseract4android/build/outputs/aar/tesseract4android-standard-release.aar
|
||||
|
|
@ -109,6 +113,8 @@ Builds:
|
|||
- $$flutter$$/bin/flutter config --no-analytics
|
||||
- $$flutter$$/bin/flutter pub get --enforce-lockfile
|
||||
- "sed -i '/^buildscript {/,/^}/d' $PUB_CACHE/hosted/pub.dev/flutter_tesseract_ocr-*/android/build.gradle"
|
||||
- 'echo "org.gradle.jvmargs=-Xmx4g -XX:MaxMetaspaceSize=1g" >> apps/app_seeds/android/gradle.properties'
|
||||
- 'echo "org.gradle.daemon=false" >> apps/app_seeds/android/gradle.properties'
|
||||
- cd apps/app_seeds
|
||||
- $$flutter$$/bin/dart run slang
|
||||
- $$flutter$$/bin/dart run build_runner build --delete-conflicting-outputs
|
||||
|
|
@ -117,7 +123,7 @@ Builds:
|
|||
build:
|
||||
- export PUB_CACHE=$(cd ../.. && pwd)/.pub-cache
|
||||
- pushd $$tesseract4android$$/tesseract4android
|
||||
- gradle assembleStandardRelease
|
||||
- gradle --no-daemon assembleStandardRelease
|
||||
- popd
|
||||
- cp
|
||||
$$tesseract4android$$/tesseract4android/build/outputs/aar/tesseract4android-standard-release.aar
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue