tstellar opened a new pull-request against the project: `go-rpm-macros` that you are following: `` Fix build failures due to https://fedoraproject.org/wiki/Changes/SetBuildFlagsBuildCheck ``
To reply, visit the link below or just reply to this email https://pagure.io/go-rpm-macros/pull-request/38
eclipseo commented on the pull-request: `Fix build failures due to https://fedoraproject.org/wiki/Changes/SetBuildFlagsBuildCheck%60 that you are following: `` This is hackish.
Please also modify the gotest line ``` -%gotest() %{?gomodulesmode} go test %{gotestflags} -ldflags "${LDFLAGS:-} %{?currentgoldflags} -extldflags '%{gotestextldflags}'" %{?**}; +%gotest() %{?gomodulesmode} go test %{gotestflags} -ldflags "%{golang_filter_ldflags} %{?currentgoldflags} -extldflags '%{gotestextldflags}'" %{?**}; ```
I can't do it myself cause your fork seems locked for edit. ``
To reply, visit the link below or just reply to this email https://pagure.io/go-rpm-macros/pull-request/38
tstellar commented on the pull-request: `Fix build failures due to https://fedoraproject.org/wiki/Changes/SetBuildFlagsBuildCheck%60 that you are following: `` @eclipseo Ok, I've update gotest as well. What do you think about removing the escape characters from the quotations? I couldn't get the current master branch to work without doing that, but I assume it must be like that for some reason? ``
To reply, visit the link below or just reply to this email https://pagure.io/go-rpm-macros/pull-request/38
eclipseo commented on the pull-request: `Fix build failures due to https://fedoraproject.org/wiki/Changes/SetBuildFlagsBuildCheck%60 that you are following: `` Thank you kindly! ``
To reply, visit the link below or just reply to this email https://pagure.io/go-rpm-macros/pull-request/38
eclipseo commented on the pull-request: `Fix build failures due to https://fedoraproject.org/wiki/Changes/SetBuildFlagsBuildCheck%60 that you are following: `` We may have a problem on some packages. For some of them we redefine LDFLAGS: https://sourcegraph.com/search?q=context:global+r:src.fedoraproject.org+file...
This is because our LDFLAGS here should not contains the %optflags but only flags destined to the Go compiler. It is a bug in the macros that should have been solved. It has been question of fixing this by prefixing it by GOLDFLAGS, but there was problem to sync it with c9 stream.
If I do that change, this will require patching several go packages. ``
To reply, visit the link below or just reply to this email https://pagure.io/go-rpm-macros/pull-request/38
tstellar commented on the pull-request: `Fix build failures due to https://fedoraproject.org/wiki/Changes/SetBuildFlagsBuildCheck%60 that you are following: `` I would expect that packages which redefine LDFLAGS are unaffected by the SetBuildFlagsBuildCheck change. What problems is it causing with those packages? ``
To reply, visit the link below or just reply to this email https://pagure.io/go-rpm-macros/pull-request/38
eclipseo commented on the pull-request: `Fix build failures due to https://fedoraproject.org/wiki/Changes/SetBuildFlagsBuildCheck%60 that you are following: `` There is no problem with your patch. I will push it.
I'll try fixing our LDFLAGS problem later, ``
To reply, visit the link below or just reply to this email https://pagure.io/go-rpm-macros/pull-request/38
eclipseo merged a pull-request against the project: `go-rpm-macros` that you are following.
Merged pull-request:
`` Fix build failures due to https://fedoraproject.org/wiki/Changes/SetBuildFlagsBuildCheck ``
gotmax23 commented on the pull-request: `Fix build failures due to https://fedoraproject.org/wiki/Changes/SetBuildFlagsBuildCheck%60 that you are following: `` It looks like this change did not work as expected. `%{golang_filter_ldflags}` seems to expand to an empty string. ``
To reply, visit the link below or just reply to this email https://pagure.io/go-rpm-macros/pull-request/38
gotmax23 commented on the pull-request: `Fix build failures due to https://fedoraproject.org/wiki/Changes/SetBuildFlagsBuildCheck%60 that you are following: ``
It looks like this change did not work as expected. `%{golang_filter_ldflags}` seems to expand to an empty string.
Rpm `%()` command substitution does not inherit environment variables. ``
To reply, visit the link below or just reply to this email https://pagure.io/go-rpm-macros/pull-request/38
tstellar commented on the pull-request: `Fix build failures due to https://fedoraproject.org/wiki/Changes/SetBuildFlagsBuildCheck%60 that you are following: `` @gota Do you have an example of a build where this fails? It was working for me when I tested it in mock. ``
To reply, visit the link below or just reply to this email https://pagure.io/go-rpm-macros/pull-request/38
eclipseo commented on the pull-request: `Fix build failures due to https://fedoraproject.org/wiki/Changes/SetBuildFlagsBuildCheck%60 that you are following: ``
It looks like this change did not work as expected. `%{golang_filter_ldflags}` seems to expand to an empty string.
Rpm `%()` command substitution does not inherit environment variables.
What package? It does not really matter because we shouldn't pass ldflags here. ``
To reply, visit the link below or just reply to this email https://pagure.io/go-rpm-macros/pull-request/38
gotmax23 commented on the pull-request: `Fix build failures due to https://fedoraproject.org/wiki/Changes/SetBuildFlagsBuildCheck%60 that you are following: `` No builds are completely broken, but redefining LDFLAGS doesn't work. Instead of filtering out `-Wl,-z,relro` and keeping the rest of the LDFLAGS, `%{golang_filter_ldflags}` expands to nothing. ``
To reply, visit the link below or just reply to this email https://pagure.io/go-rpm-macros/pull-request/38
tstellar commented on the pull-request: `Fix build failures due to https://fedoraproject.org/wiki/Changes/SetBuildFlagsBuildCheck%60 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. ``
To reply, visit the link below or just reply to this email https://pagure.io/go-rpm-macros/pull-request/38
gotmax23 commented on the pull-request: `Fix build failures due to https://fedoraproject.org/wiki/Changes/SetBuildFlagsBuildCheck%60 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
tstellar commented on the pull-request: `Fix build failures due to https://fedoraproject.org/wiki/Changes/SetBuildFlagsBuildCheck%60 that you are following: `` @gotmax23 This pull request should fix it: https://pagure.io/go-rpm-macros/pull-request/40 ``
To reply, visit the link below or just reply to this email https://pagure.io/go-rpm-macros/pull-request/38
golang@lists.fedoraproject.org