Good day everybody. As some from #fedora-golang channel may know, Fabian Affolter and I, we are releasing for the first time Bettercap to Fedora repository. By the way we are getting this build error and we have no idea about how to fix it FAILED: BuildError: The following noarch package built differently on different architectures: golang-github-bettercap-devel-2.28-4.fc34.noarch.rpm Since the problem seemed to be s390x architecture, we tried using "ExcludeArch: s390x" but it did not work. What should we do? If you want, feel free to use your proven packager super powers to fix it Thank you for your time
Germano Massullo germano.massullo@gmail.com 于2020年9月1日周二 上午7:04写道:
Good day everybody. As some from #fedora-golang channel may know, Fabian Affolter and I, we are releasing for the first time Bettercap to Fedora repository. By the way we are getting this build error and we have no idea about how to fix it FAILED: BuildError: The following noarch package built differently on different architectures: golang-github-bettercap-devel-2.28-4.fc34.noarch.rpm Since the problem seemed to be s390x architecture, we tried using "ExcludeArch: s390x" but it did not work.
Did you use %{?isa} in noarch package? This will definitely lead to noarch_rpmdiff error.
Anyway, can you provide a link to koji build or spec file?
What should we do? If you want, feel free to use your proven packager super powers to fix it Thank you for your time
golang mailing list -- golang@lists.fedoraproject.org To unsubscribe send an email to golang-leave@lists.fedoraproject.org Fedora Code of Conduct: https://docs.fedoraproject.org/en-US/project/code-of-conduct/ List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines List Archives: https://lists.fedoraproject.org/archives/list/golang@lists.fedoraproject.org
On Tuesday, 1 September 2020 01:03:57 CEST Germano Massullo wrote:
Good day everybody. As some from #fedora-golang channel may know, Fabian Affolter and I, we are releasing for the first time Bettercap to Fedora repository. By the way we are getting this build error and we have no idea about how to fix it FAILED: BuildError: The following noarch package built differently on different architectures: golang-github-bettercap-devel-2.28-4.fc34.noarch.rpm Since the problem seemed to be s390x architecture, we tried using "ExcludeArch: s390x" but it did not work. What should we do? If you want, feel free to use your proven packager super powers to fix it Thank you for your time
It's caused by a specific Requirement in an amd64 only file:
rg "github.com/chifflier/nfqueue-go/nfqueue" modules/packet_proxy/packet_proxy_linux_amd64.go 14: "github.com/chifflier/nfqueue-go/nfqueue"
Check out how I deal with it in golang-x-crypto: https://src.fedoraproject.org/rpms/golang-x-crypto/blob/master/f/golang-x-cr...
Although this might not work for you. In the case of crypto I can safely remove golang.org/x/sys/cpu because the package is added through another import path (golang.org/x/sys/unix). In your case you might need to add a Requires: golang(github.com/chifflier/nfqueue-go/nfqueue) to godevelheader so it has the same deps on all packages and keep amd64 working.
So you need to use both workaround. First exclude github.com/chifflier/nfqueue- go/nfqueue from automatic requires:
# Avoid noarch package built differently on different architectures %global __requires_exclude %{?__requires_exclude:%{__requires_exclude}|}^golang\(github.com/chifflier/nfqueue-go/nfqueue\)$
Then re-add it through godevelheader for all arches:
%global godevelheader %{expand: Requires: pkgconfig(libnetfilter_queue) Requires: golang(github.com/chifflier/nfqueue-go/nfqueue) }
And voilà: https://koji.fedoraproject.org/koji/taskinfo?taskID=50547046 F33: https://koji.fedoraproject.org/koji/taskinfo?taskID=50547130
If you want other branches, just git merge master in the one you want.
Best Regards,
Robert-André
Hi Robert-André, thank you so much for your precious help!
Le 2020-09-01 10:56, Robert-André Mauchin a écrit :
It's caused by a specific Requirement in an amd64 only file:
Since it is hard to make sure every project is perfectly arch-agnostic, I lean towards making go modules archful and forget about this class of problems. Way too late to fix gopath devel packages, unfortunately
Regards,
golang@lists.fedoraproject.org