Skip to content

Conversation

@agluszak
Copy link
Contributor

Kotlin 2.2 removed trove4j and android-extensions jars from the distribution. This change introduces version-specific artifact definitions (artifacts_2.1.bzl and artifacts_2.2.bzl) to handle these differences, with automatic selection based on Kotlin version. Updates default Kotlin version to 2.2.

Changes:

  • Created WriteKotlinArtifacts tool to generate artifact definitions
  • Added artifacts_2.1.bzl (includes trove4j) and artifacts_2.2.bzl
  • Updated compiler.bzl to use KOTLIN_STDLIBS from artifacts
  • Updated default Kotlin version to 2.2.21
  • Added custom_compiler_version example to test backward compatibility
  • Updated jdeps plugin imports to use K2 FIR APIs

Fixes #1373

Kotlin 2.2 removed trove4j and android-extensions jars from the distribution.
This change introduces version-specific artifact definitions (artifacts_2.1.bzl
and artifacts_2.2.bzl) to handle these differences, with automatic selection
based on Kotlin version. Updates default Kotlin version to 2.2.

Changes:
- Created WriteKotlinArtifacts tool to generate artifact definitions
- Added artifacts_2.1.bzl (includes trove4j) and artifacts_2.2.bzl
- Updated compiler.bzl to use KOTLIN_STDLIBS from artifacts
- Updated default Kotlin version to 2.2.21
- Added custom_compiler_version example to test backward compatibility
- Updated jdeps plugin imports to use K2 FIR APIs

Fixes bazelbuild#1373
@restingbull
Copy link
Collaborator

restingbull commented Oct 24, 2025

I think something is slightly off with the stdlib:

java.lang.NoSuchMethodError: 'kotlin.sequences.Sequence kotlin.sequences.SequencesKt.sequenceOf(java.lang.Object)'

and possible the plugin:

 java.lang.AbstractMethodError: Missing implementation of resolved method 'abstract void check(org.jetbrains.kotlin.fir.analysis.checkers.context.CheckerContext, org.jetbrains.kotlin.diagnostics.DiagnosticReporter, org.jetbrains.kotlin.fir.declarations.FirDeclaration)' of abstract class org.jetbrains.kotlin.fir.analysis.checkers.declaration.FirDeclarationChecker.
	at org.jetbrains.kotlin.fir.analysis.checkers.declaration.DeclarationCheckersDiagnosticComponent.visitConstructor(DeclarationCheckersDiagnosticComponent.kt:302)

How about we break this up into versioning artifacts and updating to 2.2+? I can't quite figure out which is breaking the integration tests.

@agluszak
Copy link
Contributor Author

So it looks like it's about a stdlib version mismatch. kotlin.sequences.SequencesKt.sequenceOf(java.lang.Object) was only introduced in 2.2

@agluszak
Copy link
Contributor Author

So I'm not sure if this versioning thingy is going to work because of bootstrapping :/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Kotlin 2.2 compiler release isn't yet supported

2 participants