Bug 2142334

Summary: `ExclusiveArch: %{zig_arches}` causes build failure in Fedora koji
Product: [Fedora] Fedora Reporter: Aleksei Bavshin <alebastr89>
Component: zigAssignee: Jan Drögehoff <sentrycraft123>
Status: CLOSED EOL QA Contact:
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 38CC: code, sentrycraft123
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: 2024-05-21 14:21:15 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:
Bug Depends On: 2142363    
Bug Blocks:    

Description Aleksei Bavshin 2022-11-13 06:11:07 UTC
Description of problem:
`ExclusiveArch: %{zig_arches}` causes build failure in Fedora koji.

This happens because koji srpm buildroot is populated with packages from @srpm-build group only (and that does not include zig-rpm-macros). In absense of the macros.zig, rpm will fail to resolve the `%zig_arches` macro and include it in the ExclusiveArch tag literally instead.
On the next step, koji would attempt to extract the list of architectures from the srpm and fail to do find any supported.

Example failed task: https://koji.fedoraproject.org/koji/taskinfo?taskID=92342564, which I worked around by inlining the %zig_arches definition in my spec file.

---

The common solution is to split out a macro file with a single definition (`%zig_arches ...`) into a separate `zig-srpm-macros` package and add it to the list of dependencies for redhat-rpm-config:
https://src.fedoraproject.org/rpms/redhat-rpm-config/blob/rawhide/f/redhat-rpm-config.spec#_109

You may notice that some of the *-srpm-macros are split from the language source packages (https://src.fedoraproject.org/rpms/{rust,fpc,nim}-srpm-macros are good examples). The reason is simple: any problem with a direct dependency of redhat-rpm-macros or an entry in @srpm-build will break the srpm buildroot. Separate source package ensures that a potential issue with the language package, including retirement or disappearance from the build tag, does not break everything.

tl;dr: we need a new source package `zig-srpm-macros` with a single file `/usr/lib/rpm/macros.d/macros.zig-srpm` containing a single line `%zig_arches ...`, which then should be added to redhat-rpm-config dependencies.

Comment 1 Ben Cotton 2023-02-07 15:11:12 UTC
This bug appears to have been reported against 'rawhide' during the Fedora Linux 38 development cycle.
Changing version to 38.

Comment 2 Aleksei Bavshin 2023-12-28 19:26:22 UTC
I can see `zig-srpm-macros` being pulled into the buildroot for recent rebuildSRPM tasks, so it should be fixed on rawhide.

Jan, are you planning to add the macros for stable releases?

Comment 3 Jan Drögehoff 2023-12-29 19:17:32 UTC
I thought about it, but I think its best to get 0.11 into Rawhide first.

I'm open to add it to Fedora 39 later.

Comment 4 Aoife Moloney 2024-05-07 15:52:15 UTC
This message is a reminder that Fedora Linux 38 is nearing its end of life.
Fedora will stop maintaining and issuing updates for Fedora Linux 38 on 2024-05-21.
It is Fedora's policy to close all bug reports from releases that are no longer
maintained. At that time this bug will be closed as EOL if it remains open with a
'version' of '38'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, change the 'version' 
to a later Fedora Linux version. Note that the version field may be hidden.
Click the "Show advanced fields" button if you do not see it.

Thank you for reporting this issue and we are sorry that we were not 
able to fix it before Fedora Linux 38 is end of life. If you would still like 
to see this bug fixed and are able to reproduce it against a later version 
of Fedora Linux, you are encouraged to change the 'version' to a later version
prior to this bug being closed.

Comment 5 Aoife Moloney 2024-05-21 14:21:15 UTC
Fedora Linux 38 entered end-of-life (EOL) status on 2024-05-21.

Fedora Linux 38 is no longer maintained, which means that it
will not receive any further security or bug fix updates. As a result we
are closing this bug.

If you can reproduce this bug against a currently maintained version of Fedora Linux
please feel free to reopen this bug against that version. Note that the version
field may be hidden. Click the "Show advanced fields" button if you do not see
the version field.

If you are unable to reopen this bug, please file a new report against an
active release.

Thank you for reporting this bug and we are sorry it could not be fixed.