gotmax23 commented on the pull-request: `Fix build failures due to
https://fedoraproject.org/wiki/Changes/SetBuildFlagsBuildCheck` that you are following:
``
@gotmax23 OK, can you show me an example build where
%{golang_filter_ldflags} expands to nothing? I would like to try to figure out what is
going on.
You can look at `gh` as an example. The specfile contains
```
export LDFLAGS="-X
github.com/cli/cli/v2/internal/build.Version=%{version}-Fedora
\
-X
github.com/cli/cli/v2/internal/build.Date=$(date -d
"@${SOURCE_DATE_EPOCH}" +%Y-%m-%d)"
```
See below for the output of `%gobuild -o %{gobuilddir}/bin/gh %{goipath}/cmd/gh` before
and after the `%set_build_flags` change and this patch.
``` diff
--- before 2022-01-27 10:23:37.043713622 -0600
+++ after 2022-01-27 10:23:43.049679273 -0600
@@ -1 +1 @@
-go build -buildmode pie -compiler gc '-tags=rpm_crashtraceback ' -ldflags '-X
github.com/cli/cli/v2/internal/build.Version=2.4.0-Fedora -X
github.com/cli/cli/v2/internal/build.Date=2022-01-12 -X
github.com/cli/cli/v2/version=2.4.0 -B 0x3fc7a0d2a6e88d144a2e228cf80e9a7873f5f977
-compressdwarf=false -extldflags '\''-Wl,-z,relro -Wl,--as-needed -Wl,-z,now
-specs=/usr/lib/rpm/redhat/redhat-hardened-ld
-specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -Wl,--build-id=sha1 '\'''
-a -v -x -o /builddir/build/BUILD/cli-2.4.0/_build/bin/gh
github.com/cli/cli/v2/cmd/gh
+go build -buildmode pie -compiler gc '-tags=rpm_crashtraceback ' -ldflags '
-X
github.com/cli/cli/v2/version=2.4.0 -B 0xb50933f80a9206aaf2a818ea51c909c379380ae9
-compressdwarf=false -extldflags '\''-Wl,-z,relro -Wl,--as-needed -Wl,-z,now
-specs=/usr/lib/rpm/redhat/redhat-hardened-ld
-specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -Wl,--build-id=sha1
-Wl,-dT,/builddir/build/BUILD/cli-2.4.0/.package_note-gh-2.4.0-6.fc36.x86_64.ld
'\''' -a -v -x -o /builddir/build/BUILD/cli-2.4.0/_build/bin/gh
github.com/cli/cli/v2/cmd/gh
```
You can reproduce this issue by running `echo %golang_filter_ldflags` in any specfile.
``
To reply, visit the link below or just reply to this email
https://pagure.io/go-rpm-macros/pull-request/38