common/build-style/go.sh: error if -s/-w in go_ldflags

-s   Omit the symbol table and debug information.
    -w   Omit the DWARF symbol table.

both are not necessary because xbps-src should strip binaries itself

this does not fit in an xlint because of multiline-string handling woes
This commit is contained in:
classabbyamp 2022-08-10 03:18:17 -04:00 committed by classabbyamp
parent 18418f0548
commit fc49c6e396
1 changed files with 7 additions and 0 deletions

View File

@ -22,6 +22,13 @@ do_configure() {
}
do_build() {
# remove -s and -w from go_ldflags, we should let xbps-src strip binaries itself
for wd in $go_ldflags; do
if [ "$wd" == "-s" ] || [ "$wd" == "-w" ]; then
msg_error "$pkgname: remove -s and -w from go_ldflags\n"
fi
done
go_package=${go_package:-$go_import_path}
# Build using Go modules if there's a go.mod file
if [ "${go_mod_mode}" != "off" ] && [ -f go.mod ]; then