-
Notifications
You must be signed in to change notification settings - Fork 1.7k
[JAVA] [GRADLE] OOM Issue with GitHub Autobuilder for Kotlin #19374
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
👋 @JLLeitschuh I'm sorry to hear you had problems with setting up CodeQL for your kotlin project. I don't think this should happen with autobuild in your case. As far as I could test moving to a manual build was successful, so I opened JLLeitschuh/ktlint-gradle#865 with the proposed changes:
In any case I will reach out with this to our internal team, as this might be an autobuild bug. |
The concern I have with this solution is that the This was the contents of that init script as of back in May of 2024: allprojects {
try {
tasks.withType(JavaCompile).configureEach {
outputs.doNotCacheIf("CodeQL analysis", {true})
}
tasks.withType(ScalaCompile).configureEach {
outputs.doNotCacheIf("CodeQL analysis", {true})
}
tasks.withType(GroovyCompile).configureEach {
outputs.doNotCacheIf("CodeQL analysis", {true})
}
}
catch(e) {
println e
println "Warning: CodeQL: configureEach not supported on this Gradle version. Using fallback instead."
tasks.withType(JavaCompile) {
try {
outputs.cacheIf({false})
}
catch(e2) {
println e2
println "Warning: CodeQL: cacheIf not supported on this Gradle version."
}
}
tasks.withType(ScalaCompile) {
try {
outputs.cacheIf({false})
}
catch(e2) {
println e2
println "Warning: CodeQL: cacheIf not supported on this Gradle version."
}
}
tasks.withType(GroovyCompile) {
try {
outputs.cacheIf({false})
}
catch(e2) {
println e2
println "Warning: CodeQL: cacheIf not supported on this Gradle version."
}
}
}
// KotlinCompile comes from a plugin which the build may or may not
// use, so we can't use it here. We therefore check task names
// instead.
try {
tasks.matching { task -> task.name.equals( 'compileKotlin' ) }.configureEach {
try {
outputs.doNotCacheIf("CodeQL analysis", {true})
}
catch(e) {
println e
println "Warning: CodeQL: Failed to disable cache for Kotlin."
}
}
}
catch(e) {
try {
tasks.matching { task -> task.name.equals( 'compileKotlin' ) }.all {
try {
outputs.cacheIf({false})
}
catch(e2) {
println e2
println "Warning: CodeQL: Fallback failed to disable cache for Kotlin."
}
}
}
catch(e2) {
println e
println e2
println "Warning: CodeQL: Failed to configure cache disabled for Kotlin."
}
}
} |
The downside of using the |
I see, let me pull in someone who can help out here. |
Description of the issue
Currently getting an OOM error with the CodeQL Autobuilder when attempting to compile Kotlin.
https://github.com/JLLeitschuh/ktlint-gradle/actions/runs/14649396135/job/41111305233?pr=861#step:5:121
JLLeitschuh/ktlint-gradle#861
Build Scan: https://scans.gradle.com/s/mfzgqpzmjgq6q
The stack trace error is too long for a GitHub issue, so I've attached it here. It looks like the code injected inside the compiler is leading to an OOM in the JetBrains Kotlin compiler
logs_37644012249.zip
The text was updated successfully, but these errors were encountered: