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

Dagger 2.53 causes unstable transitive dependency kotlin-stdlib #4525

Closed
G00fY2 opened this issue Dec 3, 2024 · 4 comments · Fixed by #4527
Closed

Dagger 2.53 causes unstable transitive dependency kotlin-stdlib #4525

G00fY2 opened this issue Dec 3, 2024 · 4 comments · Fixed by #4527

Comments

@G00fY2
Copy link

G00fY2 commented Dec 3, 2024

Dagger 2.53 bumped org.jetbrains.kotlin:kotlin-metadata-jvm to 2.0.0-Beta5 (9a94d19). Since kotlin-metadata-jvm depends on kotlin-stdlib this will also affect stdlib version used at the pre compile task.

We have a check in our Gradle setup which fails the build if a dependency was selected by conflict resolution and the new version is not stable (https://gist.github.com/G00fY2/c852322a18b187f40bb884a85065c57f).

Would be nice if dagger ships only stable dependencies.

I know that this will not affect runtime classpath, but still wanted to raise this "issue".

@hnljp
Copy link

hnljp commented Dec 3, 2024

org.jetbrains.kotlin:kotlin-metadata-jvm should now follow the Kotlin version.
I guess that it is a mistake that it is not simply using the already defined KOTLIN_VERSION.

Looks like dagger is still using Kotlin 1.9.24

@bcorso
Copy link

bcorso commented Dec 3, 2024

Hmm, yeah Dagger explicitly depends on "org.jetbrains.kotlin:kotlin-stdlib:1.9.24", but since "org.jetbrains.kotlin:kotlin-metadata-jvm:2.0.0-Beta5" also depends on kotlin-stdlib dependency resolution takes the newer version.

I think the easiest way to fix this is to try to bump to "org.jetbrains.kotlin:kotlin-metadata-jvm:2.0.0" (i.e. non-beta version). I initially tried that but there were some breaking API changes, so I'll need to fix those as well.

I'll try to get this out in the 2.53.1 release.

copybara-service bot pushed a commit that referenced this issue Dec 4, 2024
This CL also updates kotlin-metadata-jvm to 2.0.21 which requires migrating, since all of the deprecated methods Dagger/Hilt previously referenced were removed in v2.0.0.

Fixes #4525

RELNOTES=Fixes #4525: Update kotlin-jvm-metadata to 2.0.21 to remove dependency on Beta version.
PiperOrigin-RevId: 702486745
copybara-service bot pushed a commit that referenced this issue Dec 5, 2024
This CL:

  * Updates Kotlin to 2.0.21
  * Updates KSP to 2.0.21-1.0.28
  * Updates kotlin-metadata-jvm to 2.0.21
  * Migrates kotlin-metadata-jvm usages to the new API (the pre-2.0.0 APIs are deprecated).
  * Updates XProcessing and XProcessing Testing jars
  * Adds flags to fall back to Kotlin 1.9 for compiler tests (Working on getting these tests working with K2/KSP2 is in progress).
  * Updated all of our artifact tests to use the same Kotlin and KSP versions.

Fixes #4525

RELNOTES=Fixes #4525: Update kotlin-jvm-metadata to 2.0.21 to remove dependency on Beta version.
PiperOrigin-RevId: 702486745
copybara-service bot pushed a commit that referenced this issue Dec 5, 2024
This CL:

  * Updates Kotlin to 2.0.21
  * Updates KSP to 2.0.21-1.0.28
  * Updates kotlin-metadata-jvm to 2.0.21
  * Migrates kotlin-metadata-jvm usages to the new API (the pre-2.0.0 APIs are deprecated).
  * Updates XProcessing and XProcessing Testing jars
  * Adds flags to fall back to Kotlin 1.9 for compiler tests (Working on getting these tests working with K2/KSP2 is in progress).
  * Updated all of our artifact tests to use the same Kotlin and KSP versions.
  * Added `compat_kt_jvm_library` to alias output jars to the expected locations.

Fixes #4525

RELNOTES=Fixes #4525: Update kotlin-jvm-metadata to 2.0.21 to remove dependency on Beta version.
PiperOrigin-RevId: 702486745
copybara-service bot pushed a commit that referenced this issue Dec 5, 2024
This CL:

  * Updates Kotlin to 2.0.21
  * Updates KSP to 2.0.21-1.0.28
  * Updates kotlin-metadata-jvm to 2.0.21
  * Migrates kotlin-metadata-jvm usages to the new API (the pre-2.0.0 APIs are deprecated).
  * Updates XProcessing and XProcessing Testing jars
  * Adds flags to fall back to Kotlin 1.9 for compiler tests (Working on getting these tests working with K2/KSP2 is in progress).
  * Updated all of our artifact tests to use the same Kotlin and KSP versions.
  * Added `compat_kt_jvm_library` to alias output jars to the expected locations.

Fixes #4525

RELNOTES=Fixes #4525: Update kotlin-jvm-metadata to 2.0.21 to remove dependency on Beta version.
PiperOrigin-RevId: 702486745
copybara-service bot pushed a commit that referenced this issue Dec 5, 2024
This CL:

  * Updates Kotlin to 2.0.21
  * Updates KSP to 2.0.21-1.0.28
  * Updates kotlin-metadata-jvm to 2.0.21
  * Migrates kotlin-metadata-jvm usages to the new API (the pre-2.0.0 APIs are deprecated).
  * Updates XProcessing and XProcessing Testing jars
  * Adds flags to fall back to Kotlin 1.9 for compiler tests (Working on getting these tests working with K2/KSP2 is in progress).
  * Updated all of our artifact tests to use the same Kotlin and KSP versions.
  * Added `compat_kt_jvm_library` to alias output jars to the expected locations.

Fixes #4525

RELNOTES=Fixes #4525: Update kotlin-jvm-metadata to 2.0.21 to remove dependency on Beta version.
PiperOrigin-RevId: 702486745
copybara-service bot pushed a commit that referenced this issue Dec 5, 2024
This CL:

  * Updates Kotlin to 2.0.21
  * Updates KSP to 2.0.21-1.0.28
  * Updates kotlin-metadata-jvm to 2.0.21
  * Migrates kotlin-metadata-jvm usages to the new API (the pre-2.0.0 APIs are deprecated).
  * Updates XProcessing and XProcessing Testing jars
  * Adds flags to fall back to Kotlin 1.9 for compiler tests (Working on getting these tests working with K2/KSP2 is in progress).
  * Updated all of our artifact tests to use the same Kotlin and KSP versions.
  * Added `compat_kt_jvm_library` to alias output jars to the expected locations.

Fixes #4525

RELNOTES=Fixes #4525: Update kotlin-jvm-metadata to 2.0.21 to remove dependency on Beta version.
PiperOrigin-RevId: 702486745
copybara-service bot pushed a commit that referenced this issue Dec 5, 2024
This CL:

  * Updates Kotlin to 2.0.21
  * Updates KSP to 2.0.21-1.0.28
  * Updates kotlin-metadata-jvm to 2.0.21
  * Migrates kotlin-metadata-jvm usages to the new API (the pre-2.0.0 APIs are deprecated).
  * Updates XProcessing and XProcessing Testing jars
  * Adds flags to fall back to Kotlin 1.9 for compiler tests (Working on getting these tests working with K2/KSP2 is in progress).
  * Updated all of our artifact tests to use the same Kotlin and KSP versions.
  * Added `compat_kt_jvm_library` to alias output jars to the expected locations.

Fixes #4525

RELNOTES=Fixes #4525: Update kotlin-jvm-metadata to 2.0.21 to remove dependency on Beta version.
PiperOrigin-RevId: 702486745
copybara-service bot pushed a commit that referenced this issue Dec 5, 2024
This CL:

  * Updates Kotlin to 2.0.21
  * Updates KSP to 2.0.21-1.0.28
  * Updates kotlin-metadata-jvm to 2.0.21
  * Migrates kotlin-metadata-jvm usages to the new API (the pre-2.0.0 APIs are deprecated).
  * Updates XProcessing and XProcessing Testing jars
  * Adds flags to fall back to Kotlin 1.9 for compiler tests (Working on getting these tests working with K2/KSP2 is in progress).
  * Updated all of our artifact tests to use the same Kotlin and KSP versions.
  * Added `compat_kt_jvm_library` to alias output jars to the expected locations.

Fixes #4525

RELNOTES=Fixes #4525: Update kotlin-jvm-metadata to 2.0.21 to remove dependency on Beta version.
PiperOrigin-RevId: 702486745
copybara-service bot pushed a commit that referenced this issue Dec 5, 2024
This CL:

  * Updates Kotlin to 2.0.21
  * Updates KSP to 2.0.21-1.0.28
  * Updates kotlin-metadata-jvm to 2.0.21
  * Migrates kotlin-metadata-jvm usages to the new API (the pre-2.0.0 APIs are deprecated).
  * Updates XProcessing and XProcessing Testing jars
  * Adds flags to fall back to Kotlin 1.9 for compiler tests (Working on getting these tests working with K2/KSP2 is in progress).
  * Updated all of our artifact tests to use the same Kotlin and KSP versions.
  * Added `compat_kt_jvm_library` to alias output jars to the expected locations.

Fixes #4525

RELNOTES=Fixes #4525: Update kotlin-jvm-metadata to 2.0.21 to remove dependency on Beta version.
PiperOrigin-RevId: 702486745
copybara-service bot pushed a commit that referenced this issue Dec 5, 2024
This CL:

  * Updates Kotlin to 2.0.21
  * Updates KSP to 2.0.21-1.0.28
  * Updates kotlin-metadata-jvm to 2.0.21
  * Migrates kotlin-metadata-jvm usages to the new API (the pre-2.0.0 APIs are deprecated).
  * Updates XProcessing and XProcessing Testing jars
  * Adds flags to fall back to Kotlin 1.9 for compiler tests (Working on getting these tests working with K2/KSP2 is in progress).
  * Updated all of our artifact tests to use the same Kotlin and KSP versions.
  * Added `compat_kt_jvm_library` to alias output jars to the expected locations.

Fixes #4525

RELNOTES=Fixes #4525: Update kotlin-jvm-metadata to 2.0.21 to remove dependency on Beta version.
PiperOrigin-RevId: 702486745
copybara-service bot pushed a commit that referenced this issue Dec 6, 2024
This CL:

  * Updates Kotlin to 2.0.21
  * Updates KSP to 2.0.21-1.0.28
  * Updates kotlin-metadata-jvm to 2.0.21
  * Migrates kotlin-metadata-jvm usages to the new API (the pre-2.0.0 APIs are deprecated).
  * Updates XProcessing and XProcessing Testing jars
  * Adds flags to fall back to Kotlin 1.9 for compiler tests (Working on getting these tests working with K2/KSP2 is in progress).
  * Updated all of our artifact tests to use the same Kotlin and KSP versions.
  * Added `compat_kt_jvm_library` to alias output jars to the expected locations.

Fixes #4525

RELNOTES=Fixes #4525: Update kotlin-jvm-metadata to 2.0.21 to remove dependency on Beta version.
PiperOrigin-RevId: 702486745
copybara-service bot pushed a commit that referenced this issue Dec 6, 2024
This CL:

  * Updates Kotlin to 2.0.21
  * Updates KSP to 2.0.21-1.0.28
  * Updates kotlin-metadata-jvm to 2.0.21
  * Migrates kotlin-metadata-jvm usages to the new API (the pre-2.0.0 APIs are deprecated).
  * Updates XProcessing and XProcessing Testing jars
  * Adds flags to fall back to Kotlin 1.9 for compiler tests (Working on getting these tests working with K2/KSP2 is in progress).
  * Updated all of our artifact tests to use the same Kotlin and KSP versions.
  * Added `compat_kt_jvm_library` to alias output jars to the expected locations.

Fixes #4525

RELNOTES=Fixes #4525: Update kotlin-jvm-metadata to 2.0.21 to remove dependency on Beta version.
PiperOrigin-RevId: 702486745
@Ufkoku
Copy link

Ufkoku commented Dec 6, 2024

I think it can be a cause of this issue .
Using dagger/hilt 2.53 with kotlin 2.1.0 and view models injection fails during compilation with meta data error on windows machines.

@bcorso
Copy link

bcorso commented Dec 6, 2024

The issue itself is pretty simple, we just need to upgrade our kotlin-metadata-jvm dependency past v2.0.0-Beta5.

However, the main blocker for this is that Dagger currently depends on deprecated kotlin metadata v1.0 APIs that are removed in kotlin metadata v2.0.0+.

I should have a fix out today and then will try to get the 2.53.1 release either today or early next week.

copybara-service bot pushed a commit that referenced this issue Dec 6, 2024
This CL:

  * Updates KSP to 2.0.21-1.0.28
  * Updates kotlin-metadata-jvm to 2.0.21
  * Note: due to bazelbuild/rules_kotlin#1176 we can't actually update Kotlin itself to 2.0.21, but somehow that doesn't seem to cause an issue
  * Migrates kotlin-metadata-jvm usages to the new API (the pre-2.0.0 APIs are deprecated).
  * Updates XProcessing and XProcessing Testing jars
  * Adds flags to fall back to Kotlin 1.9 for compiler tests (Working on getting these tests working with K2/KSP2 is in progress).
  * Updated all of our artifact tests to use the same Kotlin and KSP versions.
  * Added `compat_kt_jvm_library` to alias output jars to the expected locations.

Fixes #4525

RELNOTES=Fixes #4525: Update kotlin-jvm-metadata to 2.0.21 to remove dependency on Beta version.
PiperOrigin-RevId: 702486745
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 a pull request may close this issue.

4 participants