-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
vscode remote container - dlv test: could not launch process: not an executable file #2986
Comments
You are trying to debug an executable built for macOS inside a linux container, or vice versa an executable built for linux outside of the linux container. |
Thanks @aarzilli I am confused though how running
|
If this was actually just about running |
@websi96 If you are indeed seeing
|
I am using VSCode Dev Containers: https://code.visualstudio.com/docs/remote/containers So I am building an executable for linux on linux because my container runs inside a VM with qemu - see: rancherdesktop and Lima VM
I did not change I think running just the command Maybe the issue is more related to the VSCode Go Extension then? The Debugger there gives me the MacOs PopUp. |
Althoug.. if I use
Here is the output of
|
From what @websi96 shared (thanks!), I think the target os/arch are set correctly, and the problem is reproducible with the command line @aarzilli Is there a known issue with linux/arm64, qemu, Lima VM?
|
I think qemu doesn't implement ptrace, but it would look different. Is it possible to see the executable file written by |
Yes, this produces a binary of my test. |
If you are interested in that particular binary. |
Looks fine, what happens if you do |
This looks promising! running it compiled with without |
Ok, post the executable produced by |
I just discoverd that this could also just be a file permission issue.. Maybe the way the volume is mounted inside the container interferes with the auto generated binary of Binary with |
The executable is fine, if the permissions are wrong then it's definitely the permissions: delve/service/debugger/debugger_unix.go Line 27 in 5d37d82
Closing since it's a problem with lima-vm. |
Thank you anyway for the great support! <3 |
Here is a hacky workaround inotifywait script for quickly testing my hypothesis - turns out it's the permissions.. By changing the execution bit on every new file containing debug it works now. #!/bin/bash
inotifywait -r -m /workspace -e create |
while read dir action file; do
echo "The file '$file' appeared in directory '$dir' via '$action'"
if [[ "$file" == *"debug"* ]]; then
chmod +x $dir$file
fi
done |
Hi :)
Calling
dlv test
inside a devcontainer gives me the following output:It does not happen outside the devcontainer..
dlv version
)?go version
)?Host => MacOS M1 - darwin/arm64:
Remote Container => lima VM with docker linux/arm64:
I tried to debug my tests for a k8s operator created with the operator-sdk in vscode inside a devcontainer.
I clicked the
debug test
button over the test functionI expected to see the debugger attach to my test session.
A MacOS PopUp showing:
Like in this issue: golang/vscode-go#114 (comment)
(I already looked for misconfigured GOOS/GOARCH settings)
The text was updated successfully, but these errors were encountered: