-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
Automatic recompilation for Kotlin sources on quarkusDev
does not work with Quarkus 2.0.0.CR3 (with gradle)
#18166
Comments
/cc @evanchooly, @glefloch, @quarkusio/devtools |
Can you please trying using |
I tested it with It works. I thinks this argument is not a valid compiler args. |
Well, it is for Java. Maybe the problem is that we pass it to Kotlin directly and we shouldn't? Given the initial build works, I think there's something fishy with what we do in dev mode. |
Yes, I don't think we differentiate compiler arguments, all arguments are put together and set in the devmode context. should we introduce a separate list of argument depending on the compiler ? |
So, I also do have that problem in another project that does not set this parameter. I can't share the whole thing publicly, sadly, and am unsure where it comes from exactly. I think I'd need more time to boil it down to the exact thing, but it feels a bit shady. The parameter that is problematic for me in the other project is
I'm not really knowingly playing around with compiler options there. But the param seems also to be one that should be passed to a java compiler, not kotlin. |
Does not make any difference. |
Soo, this issue really is quite annoying. I can workaround, but it basically removes one of the most interesting features of the whole stack - the "write code"-"rerun request"-cycle. I always need to manually recompile now, and this is one of the things why I left other ecosystems. It also does not support the "continuous testing"-features anymore this way. I retried on 2.1.3.Final and it still is an issue. Any chance to get this fixed? I know Kotlin support is experimental, as well as gradle support, but still it would be really nice to get things going over here, as it worked in the past. I sadly don't have any clue where to look for this, otherwise I'd try whether I can make a fix somewhere :). |
@lenalebt have you tried to comment this line/block (https://github.com/lenalebt/quarkus-ticket-18033-reproducer/blob/kotlin/build.gradle.kts#L60) ? This is a configuration for the java compiler which interfere with the quarkus kotlin compiler configuration. As you don't have java main sources, this shouldn't be needed. |
Well, that's interesting. That makes that minimal example work. But I don't have that setting anywhere in all the other projects I'm using internally. It still fails though. I don't set any java compiler settings directly - although I don't know whether one of the other plugins will do that. I'll try to re-cycle through them and see what I can throw out 🤔 |
Can you create a reproducer? |
@glefloch how can a setting totally unrelated to Kotlin (and a setting we recommend btw) interfere with the Kotlin compiler? |
@gsmet when building the |
Okay, I think I now know where it's coming from: I'm using kotlin annotation processing (kapt), and that seems to set compiler arguments for the java compiler. In my case, it's I don't know exactly where it's coming from in kapt, but this is some things I could find: https://github.com/JetBrains/kotlin/blob/92d200e093c693b3c06e53a39e0b0973b84c7ec5/compiler/javac-wrapper/src/org/jetbrains/kotlin/javac/JavacWrapper.kt#L108 This describes very roughly how it seems to work: facebook/buck#956 (comment) It may be different now, that was for an older kotlin version, but it seems like being something from over there. EDIT: Found a link to kapt source performing this thing: https://github.com/JetBrains/kotlin/blob/06903f803bb9ef9c2f8f625e428e8dcedf4cd3f9/libraries/tools/kotlin-gradle-plugin/src/main/kotlin/org/jetbrains/kotlin/gradle/internal/Kapt3KotlinGradleSubplugin.kt#L360-L373 |
I updated the reproducer. It shows exactly the issue that I do have in my private repositories, see https://github.com/lenalebt/quarkus-ticket-18033-reproducer/tree/kotlin and follow instructions in #18166 (comment) "To Reproduce". |
Thanks @lenalebt I will have a look |
Now it fails with this stacktrace:
|
Describe the bug
When using Kotlin (1.4.32) with Quarkus 2.0.0.CR3 with a gradle build, running
./gradlew quarkusDev
builds & starts the application. When making a change to the code and accessing the application again, I expect it to recompile and restart. JVM mode here, of course.Expected behavior
Recompilation and restart. Works with Quarkus 1.13.7.Final. (you can adjust the version in the reproducer - btw, colors don't work as well with 2.0.0.CR3 in the console in the reproducer, just a side note).
Actual behavior
Recompilation fails with the following http response:
To Reproduce
I created a reproducer by just converting the reproducer for #18033 to Kotlin: https://github.com/lenalebt/quarkus-ticket-18033-reproducer/tree/kotlin
Sorry, I don't know if this is gradle-specific at all.
docker-compose up
in the root directory of the reproducer./gradlew quarkusDev
in the application root.curl http://localhost:8080/hello-resteasy
GreetingResource.kt
(for example, add.take(1)
in line 20 at the end of the line)curl http://localhost:8080/hello-resteasy
- it fails compilation.I can easily kill the run and restart, then it works. It's just very annoying :-/.
Environment:
Output of
uname -a
orver
Linux lena-pc 5.11.0-18-generic #19-Ubuntu SMP Fri May 7 14:22:03 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux
Output of
java -version
openjdk version "11.0.10" 2021-01-19
OpenJDK Runtime Environment GraalVM CE 21.0.0.2 (build 11.0.10+8-jvmci-21.0-b06)
OpenJDK 64-Bit Server VM GraalVM CE 21.0.0.2 (build 11.0.10+8-jvmci-21.0-b06, mixed mode, sharing)
Quarkus version or git rev
2.0.0-CR3
Build tool (ie. output of
mvnw --version
orgradlew --version
)Gradle 7.0
Build time: 2021-04-09 22:27:31 UTC
Revision: d5661e3f0e07a8caff705f1badf79fb5df8022c4
Kotlin: 1.4.31
Groovy: 3.0.7
Ant: Apache Ant(TM) version 1.10.9 compiled on September 27 2020
JVM: 11.0.10 (GraalVM Community 11.0.10+8-jvmci-21.0-b06)
OS: Linux 5.11.0-18-generic amd64
Additional context
(Add any other context about the problem here.)
The text was updated successfully, but these errors were encountered: