Github messages for voidlinux
 help / color / mirror / Atom feed
From: classabbyamp <classabbyamp@users.noreply.github.com>
To: ml@inbox.vuxu.org
Subject: Re: [PR PATCH] [Updated] [RFC] various: remove -w -s from go_ldflags
Date: Wed, 10 Aug 2022 09:34:03 +0200	[thread overview]
Message-ID: <20220810073403.DhC3g9d_vPfwAGu8gjHBBx08jcG4cF0A5eGwh06kIEo@z> (raw)
In-Reply-To: <gh-mailinglist-notifications-41a7ca26-5023-4802-975b-f1789d68868e-void-packages-38538@inbox.vuxu.org>

[-- Attachment #1: Type: text/plain, Size: 1327 bytes --]

There is an updated pull request by classabbyamp against master on the void-packages repository

https://github.com/classabbyamp/void-packages fix/remove-strip-go
https://github.com/void-linux/void-packages/pull/38538

[RFC] various: remove -w -s from go_ldflags
- aws-vault: remove -w -s from go_ldflags
    - added in #21634
- circleci-cli: remove -w -s from go_ldflags
    - added in #25101
- coredns: remove -w -s from go_ldflags
    - added in #23578
- gotify-cli: remove -w -s from go_ldflags
    - added in #34653
- gotify-server: remove -w -s from go_ldflags
    - added in #34653
- v2ray: remove -w -s from go_ldflags
    - added in #31653
    - not revbumping because of build issues with `quic-go` (see below)
- common/build-style/go.sh: error if -s/-w in go_ldflags
    - this does not fit in an xlint because of multiline-string handling woes

These [go linker flags](https://pkg.go.dev/cmd/link) are:

        -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

#### Testing the changes
- I tested the changes in this PR: **briefly**
  - all still build except for `v2ray`

[ci skip]

A patch file from https://github.com/void-linux/void-packages/pull/38538.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-fix/remove-strip-go-38538.patch --]
[-- Type: text/x-diff, Size: 7460 bytes --]

From fef91e0328f606d039a978d49e75613d275df0b5 Mon Sep 17 00:00:00 2001
From: classabbyamp <void@placeviolette.net>
Date: Mon, 8 Aug 2022 12:21:20 -0400
Subject: [PATCH 1/7] aws-vault: remove -w -s from go_ldflags

---
 srcpkgs/aws-vault/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/aws-vault/template b/srcpkgs/aws-vault/template
index a3f6d60583c6..ce7b0be3307a 100644
--- a/srcpkgs/aws-vault/template
+++ b/srcpkgs/aws-vault/template
@@ -1,10 +1,10 @@
 # Template file for 'aws-vault'
 pkgname=aws-vault
 version=6.3.1
-revision=1
+revision=2
 build_style=go
 go_import_path=github.com/99designs/aws-vault/v6
-go_ldflags="-X \"main.Version=${version}\" -s -w"
+go_ldflags="-X main.Version=${version}"
 short_desc="Vault for securely storing and accessing AWS credentials"
 maintainer="klardotsh <josh@klar.sh>"
 license="MIT"

From 3bc0ec0660137be1bb2c8c0d1c854d7dc8bd1dd2 Mon Sep 17 00:00:00 2001
From: classabbyamp <void@placeviolette.net>
Date: Mon, 8 Aug 2022 12:21:25 -0400
Subject: [PATCH 2/7] circleci-cli: remove -w -s from go_ldflags

---
 srcpkgs/circleci-cli/template | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/circleci-cli/template b/srcpkgs/circleci-cli/template
index 61978ffded01..6c04611c72ee 100644
--- a/srcpkgs/circleci-cli/template
+++ b/srcpkgs/circleci-cli/template
@@ -1,12 +1,11 @@
 # Template file for 'circleci-cli'
 pkgname=circleci-cli
 version=0.1.15224
-revision=1
+revision=2
 build_style=go
 build_helper=qemu
 go_import_path=github.com/CircleCI-Public/${pkgname}
-go_ldflags="-s -w
- -X github.com/CircleCI-Public/${pkgname}/version.Version=${version}
+go_ldflags="-X github.com/CircleCI-Public/${pkgname}/version.Version=${version}
  -X github.com/CircleCI-Public/${pkgname}/version.packageManager=xbps"
 hostmakedepends="packr2"
 short_desc="Use CircleCI from the command line"

From f7d0939190d3927c3f0353eb61c6c1b5ccfb2e90 Mon Sep 17 00:00:00 2001
From: classabbyamp <void@placeviolette.net>
Date: Mon, 8 Aug 2022 12:21:25 -0400
Subject: [PATCH 3/7] coredns: remove -w -s from go_ldflags

---
 srcpkgs/coredns/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/coredns/template b/srcpkgs/coredns/template
index fe48c2347f91..263df82c6476 100644
--- a/srcpkgs/coredns/template
+++ b/srcpkgs/coredns/template
@@ -1,7 +1,7 @@
 # Template file for 'coredns'
 pkgname=coredns
 version=1.8.6
-revision=1
+revision=2
 build_style=go
 go_import_path=github.com/coredns/coredns
 hostmakedepends="git make mmark"
@@ -14,7 +14,7 @@ checksum=cbe3764afe2148b8047ea7e5cbba5108c298dee3a9a0391028e2980e35beaa2b
 make_dirs="/etc/coredns 0750 root root"
 
 _git_commit=f59c03d09c3a3a12f571ad1087b979325f3dae30
-go_ldflags+=" -s -w -X github.com/coredns/coredns/coremain.GitCommit=${_git_commit}"
+go_ldflags+="-X github.com/coredns/coredns/coremain.GitCommit=${_git_commit}"
 
 post_build() {
 	make -f Makefile.doc MMARK="$(command -v mmark) -man" man/coredns.1 man/corefile.5 plugins

From 4e8689882f91c5a32e91b061f4f0dfe6e3fc555e Mon Sep 17 00:00:00 2001
From: classabbyamp <void@placeviolette.net>
Date: Mon, 8 Aug 2022 12:21:26 -0400
Subject: [PATCH 4/7] gotify-cli: remove -w -s from go_ldflags

---
 srcpkgs/gotify-cli/template | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/gotify-cli/template b/srcpkgs/gotify-cli/template
index 91fea40fca9d..d52b7a8cd37a 100644
--- a/srcpkgs/gotify-cli/template
+++ b/srcpkgs/gotify-cli/template
@@ -1,12 +1,11 @@
 # Template file for 'gotify-cli'
 pkgname=gotify-cli
 version=2.2.2
-revision=1
+revision=2
 wrksrc="cli-$version"
 build_style=go
 go_import_path="github.com/gotify/cli/v2"
-go_ldflags="-w -s -X main.Version=${version} \
- -X main.BuildDate=${SOURCE_DATE_EPOCH} \
+go_ldflags="-X main.Version=${version} -X main.BuildDate=${SOURCE_DATE_EPOCH}
  -X main.Mode=prod"
 short_desc="Command line interface for pushing messages to a Gotify server"
 maintainer="Joel Beckmeyer <joel@beckmeyer.us>"

From 28b90723cdd14aba7aba3206ba86165950052208 Mon Sep 17 00:00:00 2001
From: classabbyamp <void@placeviolette.net>
Date: Mon, 8 Aug 2022 12:21:27 -0400
Subject: [PATCH 5/7] gotify-server: remove -w -s from go_ldflags

---
 srcpkgs/gotify-server/template | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/srcpkgs/gotify-server/template b/srcpkgs/gotify-server/template
index e306deef9220..d48b32a2a843 100644
--- a/srcpkgs/gotify-server/template
+++ b/srcpkgs/gotify-server/template
@@ -1,14 +1,12 @@
 # Template file for 'gotify-server'
 pkgname=gotify-server
 version=2.1.5
-revision=1
+revision=2
 wrksrc="server-$version"
 build_style=go
 go_import_path="github.com/gotify/server/v2"
-go_ldflags="-w -s -extldflags=-fuse-ld=bfd \
- -X main.Version=${version} \
- -X main.BuildDate=${SOURCE_DATE_EPOCH} \
- -X main.Mode=prod"
+go_ldflags="-extldflags=-fuse-ld=bfd -X main.Version=${version}
+ -X main.BuildDate=${SOURCE_DATE_EPOCH} -X main.Mode=prod"
 hostmakedepends="yarn packr2"
 short_desc="Simple server for sending and receiving messages"
 maintainer="Joel Beckmeyer <joel@beckmeyer.us>"

From bca7616d23368919c97dc9ac9e8068503cd52f24 Mon Sep 17 00:00:00 2001
From: classabbyamp <void@placeviolette.net>
Date: Mon, 8 Aug 2022 12:21:27 -0400
Subject: [PATCH 6/7] v2ray: remove -w -s from go_ldflags

don't revbump because it's currently broken due to quic-go
---
 srcpkgs/v2ray/template | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/srcpkgs/v2ray/template b/srcpkgs/v2ray/template
index cf6cd28a534a..f1a46054c205 100644
--- a/srcpkgs/v2ray/template
+++ b/srcpkgs/v2ray/template
@@ -5,7 +5,9 @@ revision=1
 wrksrc=${pkgname}-core-${version}
 build_style=go
 go_import_path="github.com/v2fly/v2ray-core/v4"
-go_ldflags="-X github.com/v2fly/v2ray-core/v4.codename=$pkgname -X github.com/v2fly/v2ray-core/v4.version=$version -X github.com/v2fly/v2ray-core/v4.build=$SOURCE_DATE_EPOCH -s -w -buildid="
+go_ldflags="-X github.com/v2fly/v2ray-core/v4.codename=$pkgname
+ -X github.com/v2fly/v2ray-core/v4.version=$version
+ -X github.com/v2fly/v2ray-core/v4.build=$SOURCE_DATE_EPOCH -buildid="
 short_desc="Platform for building proxies to bypass network restrictions"
 maintainer="ipkalm <ipkalm@outlook.com>"
 license="MIT"

From 0e6c4b1167826cd26e2a8689b712c89feead6e96 Mon Sep 17 00:00:00 2001
From: classabbyamp <void@placeviolette.net>
Date: Wed, 10 Aug 2022 03:18:17 -0400
Subject: [PATCH 7/7] 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
---
 common/build-style/go.sh | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/common/build-style/go.sh b/common/build-style/go.sh
index d18116ee9633..9093527860f6 100644
--- a/common/build-style/go.sh
+++ b/common/build-style/go.sh
@@ -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

  parent reply	other threads:[~2022-08-10  7:34 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-08-08 17:44 [PR PATCH] " classabbyamp
2022-08-09  0:22 ` classabbyamp
2022-08-09  0:26 ` classabbyamp
2022-08-09  8:48 ` ketlrznt
2022-08-09  8:48 ` ketlrznt
2022-08-09  8:49 ` ketlrznt
2022-08-09 10:22 ` ketlrznt
2022-08-09 10:23 ` ketlrznt
2022-08-09 13:54 ` ketlrznt
2022-08-09 13:54 ` classabbyamp
2022-08-09 13:54 ` classabbyamp
2022-08-10  7:21 ` [PR PATCH] [Updated] " classabbyamp
2022-08-10  7:34 ` classabbyamp [this message]
2022-08-10 17:01 ` [RFC] various: remove -s/-w " the-maldridge
2022-08-10 17:24 ` classabbyamp
2022-08-10 17:25 ` the-maldridge
2022-08-10 19:01 ` [PR PATCH] [Merged]: " classabbyamp

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220810073403.DhC3g9d_vPfwAGu8gjHBBx08jcG4cF0A5eGwh06kIEo@z \
    --to=classabbyamp@users.noreply.github.com \
    --cc=ml@inbox.vuxu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).