intellij icon indicating copy to clipboard operation
intellij copied to clipboard

Python debugger shows a wrong file when stopped at a breakpoint

Open odisseus opened this issue 1 year ago • 2 comments

Description of the bug:

No response

Which category does this issue belong to?

Intellij, CLion

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

  1. Clone a Python project that has tests, for example https://github.com/christianfds/article-simple-bazel
  2. Import it into IntelliJ with the following project view file:
directories:
  .

derive_targets_from_directories: true

targets:

additional_languages:
  python
  1. Open a file with tests, e. g. libs/complex_calculations/tests/test.py
  2. Follow the IntelliJ prompts to set up a Python venv and install the project requirements.
  3. Run any test case in the file to make sure that the project is set up correctly.
  4. Place a breakpoint inside the test case, and launch it with debugging.

Expected behaviour: The execution is suspended, and the line with the breakpoint is highlighted

Actual behaviour: A new file tab is opened, which is located somewhere in the Bazel execroot, e. g. /private/var/tmp/_bazel_foo/4cd9340ff2eef52aa6659fe37648ff08/execroot/simple-bazel/bazel-out/darwin-fastbuild/bin/libs/complex_calculations/test.runfiles/simple-bazel/libs/complex_calculations/tests/test.py. This is actually a symlink pointing to the original source file. The execution is suspended and the line that corresponds to the breakpoint is highlighted, but this happens in the wrong tab.

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

Idea IC-243.23654.153, also reproducible in Clion

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

Python 3

What Bazel plugin version are you using?

Locally built, commit f1b2c7d94d6c58f715a10512f2bed4e80f9d35a1

Have you found anything relevant by searching the web?

This problem seems to be related to #319, #3097, #3823, #4151.

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

No response

odisseus avatar Mar 12 '24 00:03 odisseus

What needs to happen before this fix can be applied, I've been waiting for this to be fixed.

andersdyhrnorlov avatar Sep 27 '24 09:09 andersdyhrnorlov

@odisseus are you interested in having this done?

tpasternak avatar Oct 10 '24 14:10 tpasternak