On 2018-11-08, Jeff Kowalczyk
The Packaging Go page in the Wiki [1] recommends to use the %{go_nostrip} macro to prevent issues with Go tooling. However, it is unclear to me whether this recommendation should also be followed for application binaries. After all, the page mostly focuses on the, now deprecated, development packages. For these I fully see the purpose of unstripped binaries. However, for normal applications it seems to me stripping would make sense, as it reduces binary size and it is unlikely people will run tooling on those.
So what's the best practice regarding stripping application binaries?
Hello Matthias,
Many users do strip binaries, and it is generally considered safe: https://dominik.honnef.co/posts/2016/10/go-and-strip/ (2016)
Hmmm, I hadn't seen this blog post. The author is correct that the official Go compiler has fewer problems, but there definitely is evidence from less than 5 years ago that strip will break stack traces -- we disabled OBS stripping specifically because gcc-go stack traces were broken on s390x and ppc64le (back before Go supported them in their main compiler). Still, using "-s" is stripping just as well as GNU strip and is actually part of the Go toolchain (and is what we use), so I don't think we need to remove the nostrip stuff... -- Aleksa Sarai Senior Software Engineer (Containers) SUSE Linux GmbH https://www.cyphar.com/