From 899ada61e47b5377c4bf896e2b72c2f10555546b Mon Sep 17 00:00:00 2001 From: Claude Date: Mon, 13 Jul 2026 18:00:28 +0000 Subject: [PATCH] fix(ci): apply the :amethyst Kotlin compile limiter only on CI The daemon OOM needs a cache-cold compile of several :amethyst variants in one invocation, which only CI's combined test/lint/assembleBenchmark run produces; local builds are incremental and usually build a single variant, and have never shown the problem. Gate the maxParallelUsages=1 service on the CI env var (always set on GitHub Actions) so local multi-variant builds keep their parallelism. Co-Authored-By: Claude Fable 5 Claude-Session: https://claude.ai/code/session_018ifbUGCADckUb3zaox9wBo --- amethyst/build.gradle.kts | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/amethyst/build.gradle.kts b/amethyst/build.gradle.kts index 730f044c4e..63cf319a46 100644 --- a/amethyst/build.gradle.kts +++ b/amethyst/build.gradle.kts @@ -353,15 +353,20 @@ kotlin { // daemon. This no-op shared build service with maxParallelUsages = 1 tells the // scheduler to run this module's Kotlin compile tasks one at a time; other // projects' tasks (JVM tests, lint analysis, packaging) still run in parallel. +// +// CI-only: the OOM needs a cache-cold compile of several variants at once, +// which local builds (incremental, usually one variant) don't produce. abstract class AmethystKotlinCompileLimiter : BuildService -val kotlinCompileLimiter = - gradle.sharedServices.registerIfAbsent("amethystKotlinCompileLimiter", AmethystKotlinCompileLimiter::class) { - maxParallelUsages.set(1) - } +if (System.getenv("CI") != null) { + val kotlinCompileLimiter = + gradle.sharedServices.registerIfAbsent("amethystKotlinCompileLimiter", AmethystKotlinCompileLimiter::class) { + maxParallelUsages.set(1) + } -tasks.withType().configureEach { - usesService(kotlinCompileLimiter) + tasks.withType().configureEach { + usesService(kotlinCompileLimiter) + } } composeCompiler {