Closed Enrico2 closed 1 year ago
I am seeing the exact same issue as #319 with CLion 2021.2.3 (Build #CL-212.5457.51, built on October 14, 2021)
This is not exactly the same issue as #319. #319 was about debugging in C++. What you're describing is for Go debugging.
For Go debugging, there are two code paths. The default one uses a script file generated by Bazel. That code path uses the workspace directory as working directory.
An alternative code path directly runs the test. That code path sets the working directory to the 'runfiles' directory. This alternative code path doesn't support args, though, and hence isn't used by default.
Before we update the working directory for the script file version, we'd need to figure out what would be the right working directory for that case. In the meantime, you can use a workaround to enable the alternative code path. Do so by creating ~/.intellij-experiments
(if that file doesn't exist for you) and specify blaze.go.script.path.enabled.2=false
.
@alice-ks, your workaround isn't working for me. I'm using GoLand 2022.1.4 on macOS with the latest bazel plugin. Is there somewhere I can put this setting in a project file that I could check-in instead (so I don't have to ask everyone on my team to make a change)?
@JamesRTaylor I'm not working on the project anymore.
@mai93 FYI.
@mai93 - would it be possible to switch the default to use the alternate code path so that the debugger and runtime use the same current working directory, essentially change the default value of this variable to false?
Hello @JamesRTaylor, Thank you for sharing the above details. Would you be interested in sharing the above changes in a PR. I Could arrange a review from google team.
Hi @sgowroji - here you go: https://github.com/bazelbuild/intellij/pull/4043
I had same issue, Please change go.mod location
As @alice-ks said, I don't think flipping the experiment flag default is a good idea, for the reasons outlined in https://github.com/bazelbuild/intellij/pull/4043#issuecomment-1516042850.
We could instead:
I don't have time to implement either (hence the P3 tag), but I'd love to review PRs for it.
Thank you for contributing to the IntelliJ repository! This issue has been marked as stale since it has not had any activity in the last 6 months. It will be closed in the next 14 days unless any other activity occurs or one of the following labels is added: "not stale", "awaiting-maintainer". Please reach out to the triage team (@bazelbuild/triage
) if you think this issue is still relevant or you are interested in getting the issue resolved.
This issue has been automatically closed due to inactivity. If you're still interested in pursuing this, please reach out to the triage team (@bazelbuild/triage
). Thanks!
This issue was reported here a while ago: https://github.com/bazelbuild/intellij/issues/319 I'm seeing the exact behavior again, in IntelliJ ultimate, with Golang.
bazel: 2021.11.09.0.2-api-version-212
Specifically, when using "Run" on a go_binary target I see
But when using "Debug" I see