You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
cmd/link, cmd/go: make DWARF on darwin disabled by default #82729
#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.
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.)
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.
Activity
cherrymui commentedon Nov 3, 2026
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 buildalready 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.