On 06. 01. 21 18:45, Tristan Cacqueray wrote:
On Wed, Jan 06, 2021 at 16:44 Pierre-Yves Chibon wrote:
On Wed, Jan 06, 2021 at 04:31:47PM +0100, Miro Hrončok wrote:
On 06. 01. 21 16:17, Tristan Cacqueray wrote:
The problem now is that you need to opt in for this and it does not know how to recognize a noarch package yet. So if we enable this for all packages, we would waste resources (I mean, it is certainly a good idea to verify a noarch package builds on all architectures, but not sure if all the time).
It seems like we could add a `check-for-arches` parent job, similarly to the `check-for-tests`, to selectively enable the extra arches job when the spec doesn't set the noarch.
Is there a cannonical command to run on a spec file to know if it is a noarch package?
I don't know.
This could be a way:
$ rpm --specfile python-six.spec python-six-1.15.0-3.fc33.noarch python2-six-1.15.0-3.fc33.noarch python3-six-1.15.0-3.fc33.noarch
$ rpm --specfile python-six.spec | rev | cut -d'.' -f 1 | rev noarch noarch noarch
If all lines say noarch, it is noarch.
But there are also excludearch statements etc. I wonder how Koji tells.
I don't know the logic koji uses per say but it works from the srpm not the spec file so there may be difference then.
Alright, so we proposed a new job to define when to run the per-arch koji build here: https://pagure.io/fedora-zuul-jobs-config/blob/master/f/playbooks/rpm/check-...
Careful with the exit code of grep -v:
$ echo -e 'x86_64\nnoarch' | grep -v noarch x86_64 $ echo $? 0
And here is the PR (and it's depends-on) to enable this for the build template: https://pagure.io/fedora-zuul-jobs/pull-request/89