-
-
Notifications
You must be signed in to change notification settings - Fork 5.8k
Cannot debug gitea in vscodium + default vscode-go 0.30.0 config #18394
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
Comments
This seems to be a issue with the stable version of vscode-go, I don't encounter such issue with the preview version of vscode-go, Could you try go nightly? |
I suspect that the new configuration does not set the correct working directory. I think this might be indicating a bug though - I suspect that: gitea/modules/templates/base.go Line 87 in 9837773
Should actually be: Directory: path.Join(setting.AppWorkPath, "/templates"), |
@zeripath Applied the patch - same error. |
add |
and the patch |
Same error, different values:
|
this works for me: {
"name": "Launch",
"type": "go",
"request": "launch",
"mode": "debug",
"buildFlags": "",
"program": "${workspaceRoot}/main.go",
"env": {
"GITEA_WORK_DIR": "${workspaceRoot}",
},
"args": ["web"],
"cwd": "${workspaceRoot}",
"showLog": true
}, There was change that resulting executable binary is now located in temp directory so gitea AppPath and so also AppWorkDir is temp directory. Setting environment variable |
I think the |
|
so: {
"name": "Launch",
"type": "go",
"request": "launch",
"mode": "debug",
"buildFlags": "-tags='sqlite sqlite_unlock_notify'",
"program": "${workspaceRoot}/main.go",
"env": {
"GITEA_WORK_DIR": "${workspaceRoot}",
},
"args": ["web"],
"cwd": "${workspaceRoot}",
"showLog": true
}, is now working for me. |
just tested it works also without |
interesting - now why doesn't -w do the same thing |
Gitea Version
1.16
Git Version
No response
Operating System
No response
How are you running Gitea?
Compilation from source.
Database
No response
Can you reproduce the bug on the Gitea demo site?
No
Log Gist
No response
Description
When you try to compile gitea in vscodium with current vscode-go extension version 0.30.0 using instructions from
https://github.com/go-gitea/gitea/blob/main/contrib/ide/README.md
debug binary will be build in /tmp not in ${workspaceRoot} and page http://127.0.0.1:3000/ will display only
Unable to find status/500 template
and debug console will contain errors like
Problem is caused probably by new debugger mode used in vscode-go extension (dlv-dap).
Workaround that seems to work is to turn on legacy mode by adding
to settings.json.
Screenshots
No response
The text was updated successfully, but these errors were encountered: