#751 https://fedoraproject.org/wiki/Packaging:Guidelines#Noarch_with_Unported_Dependencies is outdated
Closed: accepted a year ago Opened a year ago by tibbs.

A while back, Koji was fixed to actually pay attention to ExcludeArch: and ExclusiveArch: when choosing the host to build a noarch package. This means that our guidance in https://fedoraproject.org/wiki/Packaging:Guidelines#Noarch_with_Unported_Dependencies is wrong.

Proposal:

Collapse the "Runtime Dependencies" and "Arch-Specific Build-Time Dependencies" sections into the following:

Arch-Specific Runtime and Build-Time Dependencies

You can limit both the architectures used to build a noarch package, and the repositories to which the built noarch package will be added, by using either the ExcludeArch: or ExclusiveArch: tags:

BuildArch: noarch
# List the arches that the dependent package builds on below
ExclusiveArch: %{ix86} %{arm} x86_64

Sometimes a language runtime you are packaging for will provide a macro for the arches it's available on, for instance, %{nodejs_arches}. If it does exist, then you can use something like ExclusiveArch:%{nodejs_arches} in your spec file. Take a look at the guidelines for the language to see if such a macro exists.

Now, one thing I've never understood is why the examples listed "noarch" in the ExclusiveArch: lines. The way koji currently works, I've removed them here because my understanding of the situation is that koji really does want to see a real list of architectures there, but we need to double check whether it's actually OK to remove them (or OK to leave them there).


We discussed this at this weeks meeting (http://meetbot.fedoraproject.org/fedora-meeting-2/2018-02-21/fpc.2018-02-21-18.00.txt):

  • x751 Packaging:Guidelines#Noarch_with_Unported... is outdated
    (geppetto, 18:38:20)
  • ACTION: Rathann Going to investigate koji noarch/exclusive arch
    bugfix is actually fixed. (geppetto, 18:53:40)

Now, one thing I've never understood is why the examples listed "noarch" in the ExclusiveArch: lines.

In 2012 (a year before that section of the Guidelines was written) I added ExclusiveArch: %{GNAT_arches} to fedora-gnat-project-common, and found that the build failed. Something thought that there was a contradiction between BuildArch and ExclusiveArch. I had to add noarch to get the package through the build system.

If you look at the test case, it actually uses BuildArch: noarch armv7hl, so I believe the noarch should be kept.

I tested this on currently running koji instance and it appears to work. I'm no longer receiving "broken dependencies" notifications about mnemosyne package.

We looked at this ticket this week (https://meetbot-raw.fedoraproject.org/fedora-meeting-1/2018-03-15/fpc.2018-03-15-16.00.txt):

  • x751 Packaging:Guidelines#Noarch_with_Unported... is outdated
    (geppetto, 16:18:26)
  • ACTION: 751 Packaging:Guidelines#Noarch_with_Unported_Dependencies
    is outdated (+1:5, 0:0, -1:0) (geppetto, 16:21:33)

Metadata Update from @james:
- Issue untagged with: meeting
- Issue tagged with: writeup

a year ago

How is this supposed to work?

I am trying to build rubygem-mongo, which is noarch package. However mongodb server used by its test suite is not available on i686. According to this proposal, I tried this change:

$ git diff
diff --git a/rubygem-mongo.spec b/rubygem-mongo.spec
index ac02998..7d2a8f1 100644
--- a/rubygem-mongo.spec
+++ b/rubygem-mongo.spec
@@ -18,6 +18,7 @@ BuildRequires: %{_bindir}/mongod
 BuildRequires: rubygem(bson) >= 4.3.0
 BuildRequires: rubygem(rspec)
 BuildArch: noarch
+ExclusiveArch: x86_64

 %description
 A Ruby driver for MongoDB.

But Koji still schedules (scratch) build to i686 builder and the build fails:

error: Architecture is not included: i386
Building target platforms: noarch
Building for target noarch

You'd be better off asking releng for exact details since we're just documenting something that they've told us works. But, what happens if you add noarch to your ExclusiveArch: line? If you look at the entire ticket instead of just the initial proposal, you'll see that in at least some cases that seems to be required.

I tried with and without noarch and I can't see any significant difference :/ @mohanboddu how is this supposed to work, please?

I've gone ahead and written this up because as this point it's what we're reflecting what the koji code currently production is supposed to support and it's worked for our testing as evidenced by comments above. If there are specific instances of it not working then tickets should probably be filed with releng or upstream koji. If it turns out that something is wrong in the guidelines as written then we can of course fix them.

Announcement text:

The guidelines section relating to architecture support has been updated to reflect the current state of koji's support of ExclusiveArch:/ExcludeArch: in noarch packages.

Metadata Update from @tibbs:
- Issue untagged with: writeup
- Issue tagged with: announce

a year ago

Metadata Update from @tibbs:
- Issue untagged with: announce
- Issue close_status updated to: accepted
- Issue status updated to: Closed (was: Open)

a year ago

I tried with and without noarch and I can't see any significant difference :/ @mohanboddu how is this supposed to work, please?

No response. I opened separate releng ticket:

https://pagure.io/releng/issue/7671

Login to comment on this ticket.

Metadata