From 2986c93b0d7616c6f0ed54760b33477ba02991f7 Mon Sep 17 00:00:00 2001 From: John DiSanti Date: Wed, 8 Jun 2022 13:40:55 -0700 Subject: [PATCH] Configure Gradle parallelism and Kotlin compiler in `sdk-sync` (#1448) --- tools/sdk-sync/src/sync/gen.rs | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/tools/sdk-sync/src/sync/gen.rs b/tools/sdk-sync/src/sync/gen.rs index ee374db01..bab5bb81a 100644 --- a/tools/sdk-sync/src/sync/gen.rs +++ b/tools/sdk-sync/src/sync/gen.rs @@ -114,15 +114,36 @@ impl DefaultSdkGenerator { #[instrument(skip(self))] fn aws_sdk_assemble(&self) -> Result<()> { info!("Generating the SDK..."); + let mut command = Command::new("./gradlew"); command.arg("--no-daemon"); // Don't let Gradle continue running after the build + command.arg("--no-parallel"); // Disable Gradle parallelism + command.arg("--max-workers=1"); // Cap the Gradle workers at 1 command.arg("--info"); // Increase logging verbosity for failure debugging + // Customize the Gradle daemon JVM args (these are required even with `--no-daemon` + // since Gradle still forks out a daemon process that gets terminated at the end) + command.arg(format!( + "-Dorg.gradle.jvmargs={}", + [ + // Retain default Gradle JVM args + "-Xmx512m", + "-XX:MaxMetaspaceSize=256m", + // Disable incremental compilation and caching since we're compiling exactly once per commit + "-Dkotlin.incremental=false", + "-Dkotlin.caching.enabled=false", + // Run the compiler in the gradle daemon process to avoid more forking thrash + "-Dkotlin.compiler.execution.strategy=in-process" + ] + .join(" ") + )); + // Disable Smithy's codegen parallelism in favor of sdk-sync parallelism command.arg(format!( "-Djava.util.concurrent.ForkJoinPool.common.parallelism={}", self.smithy_parallelism )); + command.arg("-Paws.fullsdk=true"); command.arg(format!( "-Paws.sdk.previous.release.versions.manifest={}", -- GitLab