-
Notifications
You must be signed in to change notification settings - Fork 770
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
debug: opaque error message when "go.toolsEnvVars" are incompatible with host machine #114
Comments
Proposed solution after the discussion in microsoft/vscode-go#2696: Show a warning before even starting delve in such cases. We can have this warning include 2 buttons: This can be done in the |
The most recent message looks like so (still not immediately obvious what the issue is): |
I think ignoring them would lead users into thinking they are accomplishing something by setting GOOS/GOARCH. I think we should do what the user asks and fail, so that the user can better form a model of what delve does.
In any case where we don't call the compiler GOOS/GOARCH aren't used and therefore do not interfere, including core mode. I wouldn't call that "useful" |
This issue was filed because a user did cross-platform development and accidentally left the settings intended for gopls in the global configuration and forgot about them. Then later when they tried to launch-debug, the settings were applied and they got an error, but the message said nothing about the os/arch mismatch, so they were not sure what was going on and asked that we improve the error message. The conclusion a while back was that vscode-go extension could compare GOOS/GOARCH to that of the machine and if they did not match, offer warning and a prompt to ignore them or continue. But if these settings are never useful in any or all cases, then why do the check and offer a choice at all? That's what I am trying to determine: when are they useful? We don't have to silently ignore them when they are not. We can always print a warning and update documentation.
Ah, I see. I just assumed they are used somehow because I remember reading that you can debug core file from one platform while running dlv on another. |
All of this is also true for
|
In my opinion showing an error is a better user experience than silently ignoring the setting. If the user sees a prompt, "Hey you tried to debug using an incompatible GOOS/GOARCH," it's pretty obvious what happened. I can easily imagine a scenario where I'm running on Linux, working on There's a great book on human-interface usability called Don't Make Me Think. When designing UX, the less the user has to think the better their experience will be. If an error message pops up telling me "Hey you can't do that" I don't have to think. That's a much better UX than spending time trying to figure out why code isn't running. |
It would be nice if |
I think a big difference between this instance of
is that when you see a failure, you know exactly what to inspect for issues - your command-line. When it happens in vscode, the problem is buried deep in settings. You get a standard message to check I was assuming it was coming from some underlying dependencies, but I see now that it is defined in delve itself, so this seems like an easy fix. |
Not really, you could have the environment variable set somewhere else. |
Helps a lot, Previously I change GOOS=windwos for test in Linux machine and then when debug I got such error "dap Failed to launch: could not launch process: not an executable file" ,everything runs ok,the build out also appears and immediate deleted.with GOOS set correctly,debug works again if this can be detectd whit more detail error tips will be better,just point out some possible wrong config |
From microsoft/vscode-go#2696 by @firelizzard18:
Steps to Reproduce:
"go.toolsEnvVars"
and add"GOOS": "windows"
(or"GOOS": "linux"
if your OS is Windows)The error:
The issue is that it is not at all obvious why this is failing. Ideally,
vscode-go
would know that the debugger failed because of GOOS/GOARCH. But I don't know how it would do that, withoutdlv
providing a more meaningful error. Failing that, a warning would be nice. "By the way, we see you've changed GOOS/GOARCH such that the debugger will likely fail."The text was updated successfully, but these errors were encountered: