From 1c0f229b1e2517ee8e6b980d70ff3d051c6ee8e8 Mon Sep 17 00:00:00 2001 From: Yilong Li Date: Tue, 25 Oct 2022 21:51:44 +0800 Subject: [PATCH] feat: enable convenient vscode debugging Signed-off-by: Yilong Li --- .gitignore | 1 + .vscode/launch.json | 16 ++++++++++++++++ Makefile | 2 +- 3 files changed, 18 insertions(+), 1 deletion(-) create mode 100644 .vscode/launch.json diff --git a/.gitignore b/.gitignore index 4707afc86..82056c4d9 100644 --- a/.gitignore +++ b/.gitignore @@ -22,6 +22,7 @@ vendor/ go.work .vscode/* +!.vscode/launch.json .idea # Local History for Visual Studio Code diff --git a/.vscode/launch.json b/.vscode/launch.json new file mode 100644 index 000000000..d20601107 --- /dev/null +++ b/.vscode/launch.json @@ -0,0 +1,16 @@ +{ + "version": "0.2.0", + "configurations": [ + { + "name": "envd up", + "type": "go", + "request": "launch", + "mode": "exec", + "program": "${workspaceFolder}/debug-bin/envd", + "cwd": "directory containing build.envd", + "args": [ + "up" + ] + } + ] +} \ No newline at end of file diff --git a/Makefile b/Makefile index adf78a14c..ae0d6603d 100644 --- a/Makefile +++ b/Makefile @@ -157,7 +157,7 @@ generate: mockgen-install ## Generate mocks # It is used by vscode to attach into the process. debug-local: @for target in $(TARGETS); do \ - CGO_ENABLED=$(CGO_ENABLED) go build -trimpath \ + CGO_ENABLED=$(CGO_ENABLED) go build \ -v -o $(DEBUG_DIR)/$${target} \ -gcflags='all=-N -l' \ $(CMD_DIR)/$${target}; \