Skip to content
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

Build fails on master #2663

Closed
timmc opened this issue May 5, 2024 · 5 comments
Closed

Build fails on master #2663

timmc opened this issue May 5, 2024 · 5 comments

Comments

@timmc
Copy link
Contributor

timmc commented May 5, 2024

Describe the bug

Running the documented ./gradlew build on master fails. (However, ./gradlew jvmTest succeeds.)

To Reproduce

  1. Checked out master branch (currently e6fb4402da80)
  2. Ran ./gradlew build

Two JS-related targets fail to compile:

> Task :kotlinx-serialization-core:compileKotlinJs
e: Could not load module <org.jetbrains.kotlinx:kotlinx-serialization-core> in an attempt to find deserializer for symbol kotlinx.serialization.internal/createSimpleEnumSerializer|createSimpleEnumSerializer(kotlin.String;kotlin.Array<0:0>){0§<kotlin.Enum<0:0>>}[0].

> Task :kotlinx-serialization-core:compileKotlinJs FAILED

> Task :kotlinx-serialization-core:compileKotlinWasmJs
e: Could not load module <org.jetbrains.kotlinx:kotlinx-serialization-core> in an attempt to find deserializer for symbol kotlinx.serialization.internal/createSimpleEnumSerializer|createSimpleEnumSerializer(kotlin.String;kotlin.Array<0:0>){0§<kotlin.Enum<0:0>>}[0].

> Task :kotlinx-serialization-core:compileKotlinWasmJs FAILED

Full output: gradle.log

Expected behavior

Project should build.

Environment

  • Kotlin version: 1.9.22 (compiler version indicated in Gradle output)
  • Library version: master, e6fb4402da8 (v1.6.3 + a few commits)
  • Kotlin platforms: All
  • Gradle version: 7.6.1
  • IDE version: N/A
  • Other relevant context: Debian Linux 12 (bookworm) x86-64; OpenJDK 17
@timmc
Copy link
Contributor Author

timmc commented May 5, 2024

Shutting down IntelliJ IDEA first and running ./gradlew clean build gives a different error (also present on v1.6.3):

> Task :guide:test

example.test.SerializersTest > testExampleSerializer18 FAILED
    java.lang.Exception at SerializersTest.kt:129

120 tests completed, 1 failed

So the first one I saw may have been spurious, but there's still a build failure here.

@sandwwraith
Copy link
Member

The compileKotlinJs fail is a known flaky issue of incremental compilation. It usually pops out when you switch branches that were too far apart. :kotlinx-serialization-core:clean usually makes the problem go away

@sandwwraith
Copy link
Member

sandwwraith commented May 6, 2024

For ./gradlew :guide:test — I've tested both master and v.1.6.3, and they're passing fine (CI also shows the same: https://teamcity.jetbrains.com/buildConfiguration/KotlinTools_KotlinxSerialization_RuntimeLibraryBuildAggregated?branch=%3Cdefault%3E&buildTypeTab=overview&mode=builds).

However, given that this test is related to the date formatting, maybe there's an issue connected with the default locale on your machine. Can you please send a full exception text so I can check it?

@timmc
Copy link
Contributor Author

timmc commented May 6, 2024

Oh yes, that's definitely a locale issue!

java.lang.Exception: Output is not the same as expected, difference is
-------------------------------------------
1c1
< {"stableReleaseDate":"2016-02-15","lastReleaseTimestamp":1657152000000}
---
> {"stableReleaseDate":"2016-02-14","lastReleaseTimestamp":1657152000000}
-------------------------------------------
	at kotlinx.knit.test.KnitTestKt.verifyOutputLines(KnitTest.kt:60)
	at example.test.SerializersTest.testExampleSerializer18(SerializersTest.kt:129)

format.parse("2016-02-15+00") gives Sun Feb 14 19:00:00 EST 2016 on my machine, and yes, I'm in the US Eastern locale. The example code should probably be updated to ensure a specific locale is used for serialization—I'd be happy to put in a PR that just sets the time zone to UTC on the formatter.

@timmc
Copy link
Contributor Author

timmc commented May 6, 2024

I've filed #2664 for the date formatting issue. With that fixed, I can complete the build!

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

No branches or pull requests

2 participants