Bug 2079705

Summary: go-rpm-macros: incorrect installation of macro
Product: [Fedora] Fedora Reporter: Mikhail Novosyolov <m.novosyolov>
Component: go-rpm-macrosAssignee: Alejandro Sáez Morollón <asm>
Status: CLOSED CURRENTRELEASE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 37CC: asm, go-sig, jcajka, quantum.analyst, tommi.t.rantala, zebob.m
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2023-09-19 13:10:57 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Mikhail Novosyolov 2022-04-28 06:59:07 UTC
Hello. Spec file go-rpm-macros.spec has the following:

%install
<...>
install -m 0644 -vp   rpm/macros.d/macros.go-* \
                      %{buildroot}%{rpmmacrodir}
<...>
%ifarch %{golang_arches}
install -m 0644 -vp   rpm/macros.d/macros.go-compilers-golang \
                      %{buildroot}%{_rpmconfigdir}/macros.d/macros.go-compiler-golang
%endif

%ifarch %{gccgo_arches}
install -m 0644 -vp   rpm/macros.d/macros.go-compilers-gcc \
                      %{buildroot}%{_rpmconfigdir}/macros.d/macros.go-compiler-gcc
%endif
<...>

First all files are copied and then only a part of them is copied, but, if the architectire is inside %gccgo_arches, macros.go-compilers-golang* are still installed.

rpm/macros.d/macros.go-compilers-golang-pie and rpm/macros.d/macros.go-compilers-golang-nopie are also installeed, I'm not sure that the author's idea was to install them.

Comment 1 Mikhail Novosyolov 2022-04-28 07:01:18 UTC
golang* files are alphabetically loaded later than gccgo* and overwrite values from them.

Comment 3 Ben Cotton 2022-08-09 13:15:10 UTC
This bug appears to have been reported against 'rawhide' during the Fedora Linux 37 development cycle.
Changing version to 37.

Comment 4 Alejandro Sáez Morollón 2023-09-19 13:10:57 UTC
Thanks for the patch. I was checking the current go-rpm-macro and a similar fix was merged recently, so I'll close the bug.
Feel free to open it again if the fix doesn't cover it. 

For the record, the solution was added with the 8b2cbc54 commit.