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

Clion: gdb report missing file for cc_test #6509

Closed
fzjalfred opened this issue Jun 24, 2024 · 3 comments
Closed

Clion: gdb report missing file for cc_test #6509

fzjalfred opened this issue Jun 24, 2024 · 3 comments
Assignees
Labels
awaiting-maintainer Awaiting review from Bazel team on issues lang: c++ C++ rules integration product: CLion CLion plugin type: bug

Comments

@fzjalfred
Copy link

fzjalfred commented Jun 24, 2024

Description of the bug:

run button for all the targets works well.
But gdb button works only for cc_binary.
cc_test will report a missing file issue, even for the path the binary of gdbserver exists.

Here are the clion cmds for both cc_binary debug and cc_test debug:

##cc_binary works well:
bazel run --tool_tag=ijwb:CLion --override_repository=intellij_aspect=/root/.local/share/JetBrains/CLion2024.1/clwb/aspect "--run_under='bash' '/root/.local/share/JetBrains/CLion2024.1/clwb/gdb/gdbserver' '/root/.cache/JetBrains/RemoteDev/dist/4c7a0de431e93_CLion-2024.1.4/bin/gdb/linux/x64/bin/gdbserver' --once localhost:5006 --target" --compilation_mode=dbg --strip=never --dynamic_mode=off --fission=yes --curses=no --color=yes --progress_in_terminal_title=no -- //demo:demo

##cc_test fail:
bazel test --tool_tag=ijwb:CLion --override_repository=intellij_aspect=/root/.local/share/JetBrains/CLion2024.1/clwb/aspect "--run_under='bash' '/root/.local/share/JetBrains/CLion2024.1/clwb/gdb/gdbserver' '/root/.cache/JetBrains/RemoteDev/dist/4c7a0de431e93_CLion-2024.1.4/bin/gdb/linux/x64/bin/gdbserver' --once localhost:5006 --target" --compilation_mode=dbg --strip=never --dynamic_mode=off --test_timeout=3600 --nocache_test_results --test_strategy=exclusive --test_sharding_strategy=disabled --fission=yes --curses=no --color=yes --progress_in_terminal_title=no --runs_per_test=1 --flaky_test_attempts=1 --build_event_binary_file=/tmp/intellij-bep-6c8e1be5-e99b-4784-8e3c-b1866455f6ad --nobuild_event_binary_file_path_conversion -- //demo:main_test

I am using remote development ssh connecting to a VM and install the bazel plugin.

Which category does this issue belong to?

No response

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

BUILD.bazel:

cc_binary(
    name = "demo",
    srcs = [
        "main.cpp",
    ],
    visibility = ["//visibility:public"],
    deps = [
    ],
)

cc_test(
    name = "main_test",
    srcs = [
        "main.cpp",
    ],
)

main.cpp:

#include <iostream>

int main() {
    std::cout<<"HelloWorld!"<<std::endl;
    return 0;
}

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

CLion 2024.1.4 Build #JBC-241.18034.45, built on June 18, 2024 Licensed to Huawei Technologies Co., Ltd. Runtime version: 17.0.11+1-b1207.24 amd64 VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o. Windows 11.0 Controller in Remote Development GC: G1 Young Generation, G1 Old Generation Memory: 2048M Cores: 16 Registry: debugger.attach.dialog.enabled=true run.processes.with.pty=TRUE ide.experimental.ui=true rdclient.backend.actionHandlers=false

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

c++14
bazel-6.1.0

What Bazel plugin version are you using?

Bazel for CLion 2024.06.04.0.2-api-version-241

Have you found anything relevant by searching the web?

No response

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

Running debug binary
Command: bazel test --tool_tag=ijwb:CLion --override_repository=intellij_aspect=/root/.local/share/JetBrains/CLion2024.1/clwb/aspect "--run_under='bash' '/root/.local/share/JetBrains/CLion2024.1/clwb/gdb/gdbserver' '/root/.cache/JetBrains/RemoteDev/dist/4c7a0de431e93_CLion-2024.1.4/bin/gdb/linux/x64/bin/gdbserver' --once localhost:5006 --target" --compilation_mode=dbg --strip=never --dynamic_mode=off --test_timeout=3600 --nocache_test_results --test_strategy=exclusive --test_sharding_strategy=disabled --fission=yes --curses=no --color=yes --progress_in_terminal_title=no --runs_per_test=1 --flaky_test_attempts=1 --build_event_binary_file=/tmp/intellij-bep-208fb490-ef51-42db-94e2-b3bc5d958bf0 --nobuild_event_binary_file_path_conversion -- //demo:main_test

FAIL: //demo:main_test (see /data/.cache/fa4dd86d997067b45e4b2569754c7bfa/execroot/_main/bazel-out/k8-dbg/testlogs/demo/main_test/test.log)
Target //demo:main_test up-to-date:
  bazel-bin/demo/main_test
INFO: Elapsed time: 0.463s, Critical Path: 0.27s
INFO: 2 processes: 2 remote.
INFO: Build completed, 1 test FAILED, 2 total actions
//demo:main_test                                                         FAILED in 0.0s
  /data/.cache/fa4dd86d997067b45e4b2569754c7bfa/execroot/_main/bazel-out/k8-dbg/testlogs/demo/main_test/test.log

Executed 1 out of 1 test: 1 fails remotely.
INFO: Build Event Protocol files produced successfully.

Process finished with exit code 3

exited with error code 127

Generated test.log (if the file is not UTF-8, then this may be unreadable):
exec ${PAGER:-/usr/bin/less} "$0" || exit 1
Executing tests from //demo:main_test
-----------------------------------------------------------------------------
bash: /root/.local/share/JetBrains/CLion2024.1/clwb/gdb/gdbserver: No such file or directory
@fzjalfred fzjalfred added awaiting-maintainer Awaiting review from Bazel team on issues type: bug labels Jun 24, 2024
@sgowroji sgowroji added product: CLion CLion plugin lang: c++ C++ rules integration labels Jun 25, 2024
@LeFrosch
Copy link
Collaborator

LeFrosch commented Dec 2, 2024

Hi, sorry for the late followup. However, I was not able to reproduce this issue. Are you still facing this problem and if so do you if it is specific to remote development?

@fzjalfred
Copy link
Author

fzjalfred commented Dec 3, 2024 via email

@LeFrosch
Copy link
Collaborator

LeFrosch commented Dec 3, 2024

Hi, glad to hear the problem was resolved. I am going to close this issue. Feel free to reopen it if you encounter this issue again.

@LeFrosch LeFrosch closed this as completed Dec 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
awaiting-maintainer Awaiting review from Bazel team on issues lang: c++ C++ rules integration product: CLion CLion plugin type: bug
Projects
None yet
Development

No branches or pull requests

7 participants