bazelbuild / intellij

IntelliJ plugin for Bazel projects
https://ij.bazel.build/
Apache License 2.0
760 stars 302 forks source link

Kotlin coroutines debugging feature breaks bazel cache #5812

Open ThomasCJY opened 9 months ago

ThomasCJY commented 9 months ago

Description of the bug:

In this change, kotlin coroutine debugging feature was enabled by default in the IDE. This introduced the extra --jvmopt=-javaagent: flag to all the test debug actions triggered inside IDE, no matter whether it's coroutine related. The extra flag will then invalidate all the cache entries triggered from other build actions.

Example: Step 1: Run Test1 inside IDE using IDE test run button Step 2: Debug Test1 inside IDE using IDE test debug button. The test target will be rebuilt because all the artifacts will be invalidated by the extra --jvmopt=-javaagent: flag.

What's the simplest, easiest way to reproduce this bug? Please provide a minimal example if possible.

No response

Which Intellij IDE are you using? Please provide the specific version.

AS 2022.3

What programming languages and tools are you using? Please provide specific versions.

kotlin

What Bazel plugin version are you using?

v2023.11.07

Have you found anything relevant by searching the web?

No response

Any other information, logs, or outputs that you want to share?

No response

idanakav commented 9 months ago

As opposed to enable it by default, we can try to add it only if coroutine is a runtime dep of the tested target, but idk if it's going to be easy to find out in the IDE given there is a single worksapce module.

tpasternak commented 9 months ago

oh, it's AS-related and came from Google branch, cc @mai93

mai93 commented 9 months ago

As opposed to enable it by default, we can try to add it only if coroutine is a runtime dep of the tested target, but idk if it's going to be easy to find out in the IDE given there is a single worksapce module.

I think that should be happening already, this method tries to find the coroutines dependency of the target to be debugged and it is used to populate the value checked here before adding the flag. Can you provide a simple project to reproduce it?