Skip to content

Build fails with JDK21 #1295

@ianbotsf

Description

@ianbotsf

Describe the bug

Attempting to build the smithy-kotlin repo with a default JDK version of 21 causes the build to fail the apiCheck step due to the presence of new JVM stdlib APIs:

Task :runtime:runtime-core:jvmApiCheck FAILED

[Incubating] Problems report is available at: file:///Users/yizhouwu/ghworkplace/smithy-kotlin/build/reports/problems/problems-report.html

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':runtime:runtime-core:jvmApiCheck'.
> API check failed for project runtime-core.
  --- /Users/yizhouwu/ghworkplace/smithy-kotlin/runtime/runtime-core/api/runtime-core.api
  +++ /Users/yizhouwu/ghworkplace/smithy-kotlin/runtime/runtime-core/build/api/runtime-core.api
  @@ -513,6 +513,10 @@
        public synthetic fun add (Ljava/lang/Object;)Z
        public fun addAll (ILjava/util/Collection;)Z
        public fun addAll (Ljava/util/Collection;)Z
  +     public fun addFirst (Laws/smithy/kotlin/runtime/content/Document;)V
  +     public synthetic fun addFirst (Ljava/lang/Object;)V
  +     public fun addLast (Laws/smithy/kotlin/runtime/content/Document;)V
  +     public synthetic fun addLast (Ljava/lang/Object;)V
        public fun clear ()V
        public final fun component1 ()Ljava/util/List;
        public fun contains (Laws/smithy/kotlin/runtime/content/Document;)Z
  @@ -538,6 +542,10 @@
        public synthetic fun remove (I)Ljava/lang/Object;
        public fun remove (Ljava/lang/Object;)Z
        public fun removeAll (Ljava/util/Collection;)Z
  +     public fun removeFirst ()Laws/smithy/kotlin/runtime/content/Document;
  +     public synthetic fun removeFirst ()Ljava/lang/Object;
  +     public fun removeLast ()Laws/smithy/kotlin/runtime/content/Document;
  +     public synthetic fun removeLast ()Ljava/lang/Object;
        public fun replaceAll (Ljava/util/function/UnaryOperator;)V
        public fun retainAll (Ljava/util/Collection;)Z
        public fun set (ILaws/smithy/kotlin/runtime/content/Document;)Laws/smithy/kotlin/runtime/content/Document;
  
  You can run :runtime-core:apiDump task to overwrite API declarations

* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.
> Get more help at https://help.gradle.org/.

Deprecated Gradle features were used in this build, making it incompatible with Gradle 9.0.

You can use '--warning-mode all' to show the individual deprecation warnings and determine if they come from your own scripts or plugins.

For more on this, please refer to https://docs.gradle.org/8.13/userguide/command_line_interface.html#sec:command_line_warnings in the Gradle documentation.

BUILD FAILED in 39s
213 actionable tasks: 122 executed, 91 up-to-date

Regression Issue

  • Select this option if this issue appears to be a regression.

Expected behavior

The project should build for any JDK version 17 or later.

Current behavior

(see above)

Steps to Reproduce

Install JDK21 as the default JDK and attempt to build smithy-kotlin.

Possible Solution

No response

Context

No response

Smithy-Kotlin version

(any)

Platform (JVM/JS/Native)

JVM21+

Operating system and version

(any)

Metadata

Metadata

Assignees

Labels

bugThis issue is a bug.needs-triageThis issue or PR still needs to be triaged.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions