Skip to content

VS Code Go debugging: breakpoints never bind when the workspace is opened through a symlinked path (e.g. macOS /tmp) #22359

Open

Description

Is there an existing issue for this?

  • I have searched the existing issues

Describe the bug

Go source breakpoints never bind when the VS Code workspace is opened through a symlinked path. On macOS that includes /tmp → /private/tmp and /var → /private/var. A symlinked project directory on any OS has the same problem.

The breakpoint stays hollow (unverified). Hovering it shows:

could not find file /tmp/avm/DbgTest/goapi/main.go

The resource keeps serving requests, but the breakpoint is never hit. This affects both Go debugging entry points in the VS Code extension:

.NET resource breakpoints work in the same workspace.

Root cause

  1. The CLI and hosting canonicalize the AppHost path, so DCP runs the Go resource (go run) with working directory /private/tmp/avm/DbgTest/goapi.
  2. The Go compiler records that path in the binary's DWARF. Reading the running resource binary shows /private/tmp/avm/DbgTest/goapi/main.go.
  3. VS Code sends breakpoints using the workspace path as opened: /tmp/avm/DbgTest/goapi/main.go.
  4. Neither Go debug configuration maps one path to the other. Delve compares the paths literally and doesn't find the file.
    • Attach: extension/src/debugger/languages/go.ts, createGoAttachDebugConfiguration. It sets type: go, request: attach, mode: local, debugAdapter: dlv-dap and processId, but no substitutePath.
    • F5 launch: createDebugSessionConfigurationCallback. It sets program and cwd to the canonical AppHost-relative path, but no substitutePath.

Standalone Delve repro with a binary built from /private/tmp/avsym (/tmp/avsym is the same directory through the symlink):

(dlv) break /tmp/avsym/main.go:6
Command failed: location "/tmp/avsym/main.go:6" not found
(dlv) break /private/tmp/avsym/main.go:6
Breakpoint 1 set at 0x100ab7fc8 for main.main() ./main.go:6

After config substitute-path /private/tmp/avsym /tmp/avsym, the /tmp/avsym/main.go:6 breakpoint is set and hit.

Why tests don't catch it: extension/scripts/run-e2e.js resolves the E2E temp root with fs.realpathSync.native (line 92), so E2E workspaces never go through a symlink. Linux CI has no /tmp symlink.

Expected Behavior

Go breakpoints bind and are hit no matter which path to the workspace folder VS Code used, with both Attach debugger and F5, like .NET breakpoints already do.

Possible fix: when a workspace folder's path differs from its real path, add substitutePath entries { from: <workspace path>, to: <real path> } to the Go launch and attach debug configurations. Alternatively, avoid canonicalizing the paths passed to the Go toolchain. Add an E2E case that opens the workspace through a symlink.

Steps To Reproduce

On macOS, with the Aspire VS Code extension, the Go extension (golang.go) and Delve installed:

  1. Create an Aspire app under /tmp, for example aspire new aspire-starter -o /tmp/avm/DbgTest.
  2. Add a Go resource: aspire add go. Then add builder.AddGoApp("goapi", "../goapi").WithHttpEndpoint(env: "PORT"); with a minimal net/http server in /tmp/avm/DbgTest/goapi.
  3. Open the folder through the symlinked path: code /tmp/avm/DbgTest.
  4. Set a breakpoint inside the Go HTTP handler.
  5. Either:
    • Aspire view → Run AppHost, then right-click the Go resource → Attach debugger; or
    • Debug AppHost (F5).
  6. Request the Go endpoint. The breakpoint stays hollow, shows "could not find file /tmp/…/main.go", and isn't hit.
  7. Open the same folder as code /private/tmp/avm/DbgTest and repeat. The breakpoint binds and is hit.

Workaround: open the workspace by its real path.

Exceptions (if any)

None. Delve reports could not find file /tmp/avm/DbgTest/goapi/main.go on the unverified breakpoint.

Aspire doctor output

N/A. The root cause is the Go debug configuration path mapping in the VS Code extension and isn't environment-specific.

Anything else?

  • macOS: 27.2.1, arm64.
  • VS Code: 1.146.0.
  • Aspire extension: v1.26.0, a VSIX built from main @ e870a4c.
  • Other extensions: Go 0.58.0, C# 2.160.4, C# Dev Kit 3.40.215.
  • Aspire CLI and packages: staging 17.0.0+148071e (release/17.0).
  • Go toolchain: Go 1.27.4, Delve 1.27.2.

Found while testing #18602 and #19414. Related docs issue: microsoft/aspire.dev#2187.

Activity

  1. joperezr commented on Nov 17, 2026

    @joperezr
    Member
    🤖 Aspire triage pass — 2026-11-17 06:19 UTC

    Area: area-vscode-extension
    Kind: bug
    Repro: partial — see lines 31–40 and 50–64 of the issue body; detailed steps and a debugger transcript are provided, but no complete minimal app is attached and this pass did not reproduce the behavior
    Affected version(s): extension 1.26.0, CLI/packages staging 17.0.0+148071e — reported in lines 78–83; last working: unknown; latest stable: 13.6.5 per the repository releases API
    Severity: S3 — Go debugging reportedly fails for symlink-opened workspaces; opening the canonical workspace path is a reported workaround (lines 54–64)

    Urgency: ⚪ backlog — no milestone
    Reason: no verified regression baseline or servicing case; the configured active-release target is unavailable, so no replacement milestone is selected

    Suggested owner(s): pending human availability check; evidence leader is davidfowl (score 54), not a confirmed owner
    Evidence:

    Confidence: medium
    Needs human?: yes — expected milestone 13.6 is not open; the configured 13.5.x/13.6 release context is stale relative to the reported build; confirm the target release and owner availability

  2. added
    triage:bot-seen
    triage:needs-human
    on Nov 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area-vscodearea-vscode-extensiontriage:bot-seentriage:needs-human

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions