Open Spikhalskiy opened 2 years ago
Unfortunately, Kotlin 1.4
has been deprecated in the absence of the maintainer.
Therefore, we do not plan to make any modifications to support Kotlin 1.4
.
We also plan to modify the documentation in the near future. #632
In order to avoid similar problems, our policy will be to use the most recent patch version within the smallest minor version that has not been deprecated.
@k163377 the issues with Kotlin 1.4 was actually resolved in https://github.com/FasterXML/jackson-module-kotlin/pull/557 And the current state is fully compatible with Kotlin 1.4, we run Kotlin 1.4 pipelines with the new releases of Jackson as a part of Temporal CI/CD.
Unfortunately, Kotlin 1.4 has been deprecated in the absence of the maintainer.
I did take care of Kotlin 1.4 and can do it for some time.
In order to avoid similar problems, our policy will be to use the most recent patch version within the smallest minor version that has not been deprecated.
I personally don't think it's a very user-friendly version. Even JetBrains officially update and support the last three minor Kotlin releases.
We also plan to modify the documentation in the near future.
Not just the documentation, but the target will need to change. If Kotlin 1.4 is officially not supported, there should be no binary compatibility with Kotlin 1.4 (not being able to run at all is better that running incorrectly)
@Spikhalskiy I am reading and writing English by machine translation, so please forgive me if I may have misunderstood or misrepresented something.
I personally don't think it's a very user-friendly version. Even JetBrains officially update and support the last three minor Kotlin releases.
For example, we currently use within Kotlin 1.5
and intend to use Kotlin 1.6
when Kotlin 1.5
is deprecated (i.e. Kotlin 1.9
is released).
Is this policy not user-friendly?
Not just the documentation, but the target will need to change. If Kotlin 1.4 is officially not supported, there should be no binary compatibility with Kotlin 1.4 (not being able to run at all is better that running incorrectly)
To be precise, we were going to update the documentation and remove the tests in CI
regarding Kotlin 1.4
.
Are you saying that this work is not enough?
I noticed that it would be preferable to also remove the code for compatibility with Kotlin 1.4
, is this what you are referring to?
https://github.com/FasterXML/jackson-module-kotlin/blob/7493f7d3d4fc9ea52b1dfc2adc781f4465ab4fdc/src/main/kotlin/com/fasterxml/ jackson/module/kotlin/KotlinAnnotationIntrospector.kt#L68
For example, we currently use within Kotlin 1.5 and intend to use Kotlin 1.6 when Kotlin 1.5 is deprecated (i.e. Kotlin 1.9 is released). Is this policy not user-friendly?
This sounds good. Supporting [1.5,) when 1.8 is the latest released version is good enough!
To be precise, we were going to update the documentation and remove the tests in CI regarding Kotlin 1.4. Are you saying that this work is not enough?
Correct. I think we should make jackson-module-kotlin
BINARY incompatible with Kotlin 1.4. So users get a build-time error if they try to use jackson-module-kotlin + Kotlin 1.4.
This can be achieved by building against Kotlin 1.6. Because Kotlin supports binary compatibility with one minor version down. So building against Kotlin 1.6 brings compatibility with 1.5, but not 1.4. Reference: https://kotlinlang.org/docs/kotlin-evolution.html#evolving-the-binary-format
Preferably (but we can't guarantee it), the binary format is mostly forwards compatible with the next feature release, but not later ones (in the cases when new features are not used, e.g. 1.3 can understand most binaries from 1.4, but not 1.5).
This specific issue should be solved by declaring kotlin-reflect
dependency as optional. Deprecation of Kotlin 1.4 will not solve it. Imagine the user having Kotlin 1.8 stdlib and jackson-module-kotlin
bringing kotlin-reflect
1.5 in.
I will submit a PR for it later.
See how a similar situation with kotlin-reflect solved in micrometer: https://github.com/micrometer-metrics/micrometer/blob/main/micrometer-core/build.gradle#L86
Hey @Spikhalskiy -- have you had a chance to try this yet?
This specific issue should be solved by declaring
kotlin-reflect
dependency as optional. Deprecation of Kotlin 1.4 will not solve it. Imagine the user having Kotlin 1.8 stdlib andjackson-module-kotlin
bringingkotlin-reflect
1.5 in. I will submit a PR for it later.
I encountered the same issue and imagined the same solution. If you're busy, I can try it myself, but if you already tried it and learned something, can you share?
Describe the bug Currently, when I build my project with Kotlin 1.4 and using this module, I get errors and warnings which are caused by this module bringing kotlin-reflect 1.5 as a transitive dependency into Kotlin 1.4 classpath and runtime:
It's caused by the following descriptor:
kotlin-stdlib
is correctly defined asprovided
, butkotlin-reflect
for some reason is defined ascompile
explicitly, which is weird. This was introduced in the commit: https://github.com/FasterXML/jackson-module-kotlin/commit/eedfb16233ddaca7d2ad1798bc9b1bfbd9da7a9a#diff-9c5fb3d1b7e3b0f54bc5c4182965c4fe1f9023d449017cece3005d3f90e8e4d8R89 before this dependency was scoped asprovided
.It forces us to have the following configuration in our project:
Expected behavior This module should
provided
dependency