Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

What does ExclusiveArch and ExcludeArch do for sub-packages? #43

Open
FrostyX opened this issue Jul 17, 2023 · 1 comment
Open

What does ExclusiveArch and ExcludeArch do for sub-packages? #43

FrostyX opened this issue Jul 17, 2023 · 1 comment
Labels

Comments

@FrostyX
Copy link
Member

FrostyX commented Jul 17, 2023

I recently worked on a feature for Copr where we wanted to skip builds on architectures based on ExclusiveArch and ExcludeArch.

The descriptions of those macros tags are quite clear.
https://rpm-software-management.github.io/rpm/manual/tags.html

Tag Name Value Type Description
Excludearch 1059 string array If present, limits the architectures on which the package is buildable by excluding those specified.
Exclusivearch 1061 string array If present, limits the architectures on which the package is buildable exclusively to those specified.

However, I was surprised that those macros tags can be used not only for packages but also for sub-packages. For example procyon or binutils does this.

Can you please document that these macros tags (or possibly some other surprising ones) can be used for sub-packages as well and what does it mean when they are used for sub-packages?

@dmnks
Copy link
Contributor

dmnks commented Mar 20, 2024

Actually, these two tags only pertain to the SRPM itself (thus being listed under the "Source packages" heading on that page.) In other words, to the SPEC parser, these two tags are not %package specific so wherever they're used, they will simply append the given value(s) to the respective top-level tag.

This can be seen e.g. with the binutils package:

$ fedpkg clone binutils
$ fedpkg srpm --define 'with_crossbuilds 1'
$ rpm -q --json /path/to/binutils-2.42.50-6.fc41.src.rpm | jq '.Excludearch'
[
  "aarch64-linux-gnu",
  "aarch64-redhat-linux",
  "ppc64le-linux-gnu",
  "ppc64le-redhat-linux",
  "s390x-linux-gnu",
  "s390x-redhat-linux",
  "x86_64-linux-gnu",
  "x86_64-redhat-linux",
  "i686-linux-gnu",
  "i686-redhat-linux"
]

I don't think the above is what was intended by the packagers, it's most likely just them having misunderstood the purpose of these tags. After all, one can't blame them - it's not entirely obvious from our docs, regardless of the heading. Some clarification is in order so I'll move this ticket into our TODO queue.

There's also the question of whether we shouldn't actually make this into a per-package tag. If we did, however, that would effectively mean package-level exclusion support, something touched upon in rpm-software-management/rpm#2795.

Thanks for the report!

@dmnks dmnks added the bug label Mar 20, 2024
@dmnks dmnks removed their assignment Mar 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: Todo
Development

No branches or pull requests

2 participants