Skip to content

Commit 7dc764f

Browse files
committed
ScipBuildTool: only treat ERROR/EXCEPTION as kotlinc failures
Kotlin 2.2.0's K2JVMCompiler emits LOGGING messages on startup (e.g. about the missing scripting plugin and Kotlin home directory). The MessageCollector previously pushed *every* report() severity onto the errors list, so hasErrors() returned true and the compiler returned COMPILATION_ERROR even when nothing was actually wrong. The LibrarySnapshotSuite consequently failed indexing 'org.jetbrains.exposed:exposed-core:1.0.0-beta-4' on CI without any real diagnostic surfaced. Only push to errors when severity.isError so hasErrors stays honest.
1 parent d2c36e0 commit 7dc764f

1 file changed

Lines changed: 9 additions & 1 deletion

File tree

scip-java/src/main/scala/com/sourcegraph/scip_java/buildtools/ScipBuildTool.scala

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -343,7 +343,15 @@ class ScipBuildTool(index: IndexCommand) extends BuildTool("SCIP", index) {
343343
.PLAIN_FULL_PATHS
344344
.render(compilerMessageSeverity, s, compilerMessageSourceLocation)
345345
index.app.reporter.debug(msg)
346-
errors.push(msg)
346+
// Only treat ERROR / EXCEPTION as failures. Kotlin 2.2.0's
347+
// K2JVMCompiler emits LOGGING messages at startup (e.g. about the
348+
// missing scripting plugin) and INFO/WARNING messages during
349+
// normal compilation; pushing those onto `errors` would cause
350+
// hasErrors to return true, which makes the compiler return
351+
// COMPILATION_ERROR even when nothing is actually wrong.
352+
if (compilerMessageSeverity.isError) {
353+
errors.push(msg)
354+
}
347355
}
348356
},
349357
Services.EMPTY,

0 commit comments

Comments
 (0)