A barebone Kotlin Gradle project takes 3 minutes to build, with no apparent caching.
def get_test_container(self) -> Container:
"""
Gradle 8.7 crashes on ARM devices: https://github.com/gradle/gradle/issues/24875
To work around it we uninstall libstd++ and dependents as suggested in
https://github.com/gradle/gradle/issues/24875#issuecomment-1783751649
"""
build_cache = dag.cache_volume('build')
gradle_cache = dag.cache_volume('build')
return (
dag.container().from_(BUILD_IMAGE)
.with_mounted_cache(f"{GRADLE_PATH}/build", build_cache)
.with_mounted_cache(f"{GRADLE_PATH}/.gradle", gradle_cache)
.with_directory(GRADLE_PATH, self.src_dir, include=["src/", "*gradle*"],
exclude=["dagger/", "build/", ".gradle/"])
# .with_mounted_directory(GRADLE_PATH, self.src_dir, owner="gradle:gradle")
.with_workdir(GRADLE_PATH)
.with_exec(['apk', 'del', 'libstdc++', 'binutils', 'mercurial']) # workaround
.with_exec(['gradle', 'buildFatJar', '--no-daemon'])
)
What am I doing wrong? Is there an example to study? Any way I can troubleshoot on my own?