Skip to content

Commit

Permalink
Go VS Code debug fix (#694)
Browse files Browse the repository at this point in the history
Closes #677

Co-authored-by: Aviram Hassan <[email protected]>
Co-authored-by: Eyal Bukchin <[email protected]>
  • Loading branch information
3 people committed Nov 6, 2022
1 parent 65a9760 commit 6bc20f9
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 deletions.
7 changes: 5 additions & 2 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -209,13 +209,15 @@ jobs:
cd vscode-ext
npm install
tsc && vsce package -o /tmp/vscode-ext/vscode-ext-linux-aarch64 --target linux-arm64
- name: Publish linux-xarm64
- name: Publish linux-arm64
if: github.event_name != 'workflow_dispatch'
env:
VSCE_PAT: ${{ secrets.VSCE_PAT }}
run: cd vscode-ext && vsce publish ${{ steps.version.outputs.version }} --target linux-arm64
- run: rm vscode-ext/libmirrord_layer.so
- run: cp /tmp/artifacts/universal-apple-darwin/libmirrord_layer.dylib vscode-ext/
# Package a patched Delve with our VS Code extension. The patched version bypasses an issue where we can't be injected into platform binaries.
- run: wget https://github.com/metalbear-co/delve/releases/download/1.9.1/delve_darwin_amd64 -O vscode-ext/dlv && chmod +x vscode-ext/dlv
# Same binary for darwin
- run: |
cd vscode-ext
Expand All @@ -226,10 +228,11 @@ jobs:
env:
VSCE_PAT: ${{ secrets.VSCE_PAT }}
run: cd vscode-ext && vsce publish ${{ steps.version.outputs.version }} --target darwin-x64
- run: wget https://github.com/metalbear-co/delve/releases/download/1.9.1/delve_darwin_arm64 -O vscode-ext/dlv && chmod +x vscode-ext/dlv
- run: |
cd vscode-ext
npm install
tsc && vsce package -o /tmp/vscode-ext/vscode-ext-darwin-x64 --target darwin-x64
tsc && vsce package -o /tmp/vscode-ext/vscode-ext-darwin-arm64 --target darwin-arm64
- name: Publish darwin-arm64
if: github.event_name != 'workflow_dispatch'
env:
Expand Down
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Check [Keep a Changelog](http://keepachangelog.com/) for recommendations on how

### Fixed
- using gcloud auth for kubernetes. (mistakenly loaded layer into it)

- debugging Go on VSCode. We patch to use our own delivered delve.

## 3.7.0

Expand Down
4 changes: 4 additions & 0 deletions vscode-ext/src/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -249,6 +249,10 @@ class ConfigurationProvider implements vscode.DebugConfigurationProvider {

if (config.type === "go") {
config.env["MIRRORD_SKIP_PROCESSES"] = "dlv;debugserver;compile;go;asm;cgo;link";
// use our custom delve to fix being loaded into debugserver
if (os.platform() === "darwin") {
config.dlvToolPath = path.join(globalContext.extensionPath, "dlv");
}
}

return resolve(config);
Expand Down

0 comments on commit 6bc20f9

Please sign in to comment.