-
Notifications
You must be signed in to change notification settings - Fork 215
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
KSP subplugin conflicts with guava in @com_github_jetbrains_kotlin//lib/kotlin-compiler.jar #1168
Labels
dependencies
Pull requests that update a dependency file
Comments
this still repros in the rules_kotlin example app for KSP that uses dagger on
with this patch applied to use the latest rules diff --git a/examples/ksp/WORKSPACE b/examples/ksp/WORKSPACE
index a728fb17..d6aa2795 100644
--- a/examples/ksp/WORKSPACE
+++ b/examples/ksp/WORKSPACE
@@ -4,8 +4,8 @@ load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
http_archive(
name = "rules_kotlin",
- sha256 = "34e8c0351764b71d78f76c8746e98063979ce08dcf1a91666f3f3bc2949a533d",
- url = "https://github.com/bazelbuild/rules_kotlin/releases/download/v1.9.5/rules_kotlin-v1.9.5.tar.gz",
+ sha256 = "d89723cc9ebbb7bdb2ebaca1af7d2383e074615643cf97a366b758a76b7dc443",
+ url = "https://github.com/bazelbuild/rules_kotlin/releases/download/v2.0.0/rules_kotlin-v2.0.0.tar.gz",
)
load("@rules_kotlin//kotlin:repositories.bzl", "kotlin_repositories")
diff --git a/examples/ksp/third_party/BUILD.bazel b/examples/ksp/third_party/BUILD.bazel
index 4af98cda..c6786fed 100644
--- a/examples/ksp/third_party/BUILD.bazel
+++ b/examples/ksp/third_party/BUILD.bazel
@@ -72,9 +72,7 @@ kt_ksp_plugin(
kt_ksp_plugin(
name = "dagger_ksp_plugin",
- generates_java = True,
processor_class = "dagger.internal.codegen.KspComponentProcessor",
- target_embedded_compiler = True,
visibility = ["//visibility:public"],
deps = ["@maven//:com_google_dagger_dagger_compiler"],
) |
Closed
oliviernotteghem
added a commit
to uber-common/rules_kotlin
that referenced
this issue
Dec 9, 2024
oliviernotteghem
added a commit
to uber-common/rules_kotlin
that referenced
this issue
Jan 22, 2025
oliviernotteghem
added a commit
to uber-common/rules_kotlin
that referenced
this issue
Jan 22, 2025
oliviernotteghem
added a commit
to uber-common/rules_kotlin
that referenced
this issue
Jan 22, 2025
oliviernotteghem
added a commit
to uber-common/rules_kotlin
that referenced
this issue
Jan 23, 2025
oliviernotteghem
added a commit
to uber-common/rules_kotlin
that referenced
this issue
Jan 24, 2025
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Description:
There are some guava classes in Kotlin-compiler, such as com.google .common.graph, if guava is also used in the subplugin of ksp, then because the parent delegation model of java will go to the father, that is, the guava in MemoryBasedClassLoader, which will lead to
The same error occurs with compile ksp in cli mode
Workaround:
Essentially, Kotlinc should solve the problem of isolation from the KSP environment, but considering that rules_kotlin builders currently have a relatively complete guava, I filtered out guava in the MemoryBasedClassLoader load condition, but this solution does not look elegant, and I would like to discuss how to deal with it.
The text was updated successfully, but these errors were encountered: