[opensuse-go] Added new macro to disable binary stripping within golang packages
Hi,
I just want to inform you that I have created a new macro named
go_nostrip at https://github.com/openSUSE/golang-packaging/pull/3.
This macro should be used within the packages which use golang-packaging
to disable the stripping of golang binaries to avoid issues related to
that. Beside that it disables also useless debug sub-packages.
So if you create a package for some golang related tool please use this
macro. Under the hood it just calls one undefine and one define:
%undefine _build_create_debug
%define __arch_install_post export NO_BRP_STRIP_DEBUG=true
If you want to know more about those options read
https://en.opensuse.org/openSUSE:Packaging_guidelines#Debuginfo and
https://github.com/golang/go/issues/1242.
Best,
Thomas Boerger
--
Thomas Boerger
On Tue, 21 Jun 2016, Thomas Boerger wrote:
Hi,
I just want to inform you that I have created a new macro named go_nostrip at https://github.com/openSUSE/golang-packaging/pull/3.
This macro should be used within the packages which use golang-packaging to disable the stripping of golang binaries to avoid issues related to that. Beside that it disables also useless debug sub-packages.
So if you create a package for some golang related tool please use this macro. Under the hood it just calls one undefine and one define:
%undefine _build_create_debug %define __arch_install_post export NO_BRP_STRIP_DEBUG=true
If you want to know more about those options read https://en.opensuse.org/openSUSE:Packaging_guidelines#Debuginfo and https://github.com/golang/go/issues/1242.
Unfortunately it is impossible to use this from the gcc6 package to
disable debug stripping just for libgo (I remember a working hack
was to remove the executable bits from it, rpm will add it back
at packaging time and due to a implementation detail debug-stripping
will not be applied). You still get -debuginfo packages IIRC
and you _do_ want to have -debugsource packages (I hope you preserve
those as well?).
Thus, an exclude pattern would have been more useful, like
BRP_STRIP_DEBUG_EXCLUDE=libgo*.so*
Thanks,
Richard.
--
Richard Biener
Thus, an exclude pattern would have been more useful, like
BRP_STRIP_DEBUG_EXCLUDE=libgo*.so*
Thing is, we also want to not strip any Go binary as well. If you strip a Go binary then odd things happen. If the binary was compiled with gcc-go for example, you lose all useful information in stack traces (this has bit us multiple times at SUSE with supporting Docker on non-gc systems). -- Aleksa Sarai Software Engineer (Containers) SUSE Linux GmbH https://www.cyphar.com/ -- To unsubscribe, e-mail: opensuse-go+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-go+owner@opensuse.org
participants (3)
-
Aleksa Sarai
-
Richard Biener
-
Thomas Boerger