Skip to content

cmd/link, cmd/go: make DWARF on darwin disabled by default #82729

Open

Description

@FiloSottile

#62577 makes go build produce a .dSYM directory next to binaries on macOS.

I understand this is forced by the platform, but it will churn many many thousand cleanup scripts and targets, and feels extremely un-Go-like. go build ./foo; ./foo; rm ./foo leaving detritus that needs rm -r to remove is very surprising to me.

It's already churning internal tooling.

The age release process will silently start including the directory in the release tarballs (that people have downstream scripts for).

The mkcert release process will fail halfway through and leave behind a partially-uploaded release.

These are the first two release scripts I checked.

I'm afraid switching DWARF on macOS to be off by default might be the least disruptive option. It will break some debugger workflows, but those are a lot less common than "I just want to build and release a binary."

(Marking release-blocker because we should decide one way or another before Go 1.28.)

/cc @golang/go-command

Activity

  1. added this to the Go1.28 milestone on Oct 30, 2026
  2. added
    NeedsDecisionFeedback is required from experts, contributors, and/or the community before a change can be made.
    on Oct 30, 2026
  3. cherrymui commented on Nov 3, 2026

    @cherrymui
    Member

    There is a middle ground.

    It is true that all #62577 is that we are pushed by the platform. As of macOS 27, for c-shared libraries and plugins, the system dynamic loader rejects it if we have DWARF combined. However, at least for now, executables are still fine. We can run executables with combined DWARF. So split DWARF is required for c-shared libraries and plugins, but it is more of future looking for executables.

    So the middle ground is that we enable split DWARF by default for c-shared and plugins, but keep it off by default for executables. Executables still have combined DWARF, so debugging still works.

    For c-shared and plugins, it is less of a problem: they are non-default, relatively rare, and for c-shared, go build already emits multiple files (the library and the header).

    Maybe one day we'll be forced by the platform to not combine DWARF for executables. So perhaps tooling can be made more compatible wit that.

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

    GoCommandcmd/goNeedsDecisionFeedback is required from experts, contributors, and/or the community before a change can be made.compiler/runtimeIssues related to the Go compiler and/or runtime.release-blocker

    Type

    No type

    Projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions