Bug 1545209

Summary: ghc-lzma-conduit is using arch-dependent BuildRequires
Product: [Fedora] Fedora Reporter: Igor Gnatenko <ignatenko>
Component: ghc-lzma-conduitAssignee: David Shea <dshea>
Status: CLOSED RAWHIDE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: high    
Version: rawhideCC: dcantrell, dshea
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: ghc-lzma-conduit-1.1.3.3-4.fc28 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2018-02-16 03:33:53 UTC Type: ---
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:    
Bug Blocks: 1545161    

Description Igor Gnatenko 2018-02-14 12:06:26 UTC
ghc-lzma-conduit is using %{?_isa} in BuildRequires which is prohibited by Packaging Guidelines: https://fedoraproject.org/wiki/Packaging:Guidelines#BuildRequires_and_.25.7B_isa.7D. Please fix it ASAP.

Comment 1 David Shea 2018-02-14 16:18:22 UTC
But that would break the spec file. If I remove %{?_isa} and try to do rpmbuild --target i686 on the spec file, it will erroneously pass the buildrequires even if I don't have xz-devel(x86-32) installed.

SRPM installs don't check the SRPM requires, and the spec file contained in the SRPM doesn't have expanded macros. What's the motivation of this?

Comment 2 Igor Gnatenko 2018-02-14 16:22:44 UTC
(In reply to David Shea from comment #1)
> But that would break the spec file. If I remove %{?_isa} and try to do
> rpmbuild --target i686 on the spec file, it will erroneously pass the
> buildrequires even if I don't have xz-devel(x86-32) installed.

You are not supposed to do it this way, you are supposed to use mock to build 32bit package in 32bit environment.

> SRPM installs don't check the SRPM requires, and the spec file contained in
> the SRPM doesn't have expanded macros. What's the motivation of this?

rpmbuild --rebuild won't work. Also your package is not compliant with packaging guidelines. Please see link.

Comment 3 David Shea 2018-02-14 16:28:49 UTC
(In reply to Igor Gnatenko from comment #2)
> (In reply to David Shea from comment #1)
> > But that would break the spec file. If I remove %{?_isa} and try to do
> > rpmbuild --target i686 on the spec file, it will erroneously pass the
> > buildrequires even if I don't have xz-devel(x86-32) installed.
> 
> You are not supposed to do it this way, you are supposed to use mock to
> build 32bit package in 32bit environment.

Why not allow both?

> > SRPM installs don't check the SRPM requires, and the spec file contained in
> > the SRPM doesn't have expanded macros. What's the motivation of this?
> 
> rpmbuild --rebuild won't work. 

--rebuild works fine.

[dshea@localhost rpmbuild]$ uname -m
i686
[dshea@localhost rpmbuild]$ rpm -qp --requires SRPMS/ghc-lzma-0.0.0.3-1.fc27.src.rpm | grep 64
xz-devel(x86-64)
[dshea@localhost rpmbuild]$ rpmbuild --rebuild SRPMS/ghc-lzma-0.0.0.3-1.fc27.src.rpm >/dev/null 2>&1
[dshea@localhost rpmbuild]$ echo $?
0


> Also your package is not compliant with
> packaging guidelines. Please see link.

I did see the link, and I'm saying the packaging guidelines are wrong and are making things worse.

Comment 4 Igor Gnatenko 2018-02-14 16:38:47 UTC
> I did see the link, and I'm saying the packaging guidelines are wrong and are making things worse.

Then please work with Fedora Packaging Committee to fix this, but until it's resolved please fix package, it's breaking automated tools (in my case it is koschei).

https://pagure.io/packaging-committee

Comment 5 Igor Gnatenko 2018-02-14 16:46:15 UTC
⋊> ~/r/SPECS rpmbuild -bs ./hello.spec --target i686                                                                                                                                                       17:45:00
Building target platforms: i686
Building for target i686
Wrote: /home/brain/rpmbuild/SRPMS/hello-1-1.fc28.src.rpm

⋊> ~/r/SPECS sudo dnf builddep /home/brain/rpmbuild/SRPMS/hello-1-1.fc28.src.rpm --assumeno | grep gcc                                                                                                     17:45:38
 gcc                      i686        8.0.1-0.9.fc28         rawhide       21 M
 libgcc                   i686        8.0.1-0.9.fc28         rawhide       85 k
 gcc                      x86_64      8.0.1-0.9.fc28         rawhide       22 M
 gcc-c++                  x86_64      8.0.1-0.9.fc28         rawhide       12 M
 gcc-gdb-plugin           x86_64      8.0.1-0.9.fc28         rawhide      117 k
 libgcc                   x86_64      8.0.1-0.9.fc28         rawhide       77 k
Operation aborted.

And then this exact srpm ends up in repositories. So guidelines are 100% correct.

Comment 6 Jens Petersen 2018-02-15 04:01:03 UTC
The next cabal-rpm release should fix this for future btw.

Comment 7 Jens Petersen 2018-02-15 04:02:47 UTC
I am happy to fix since this was caused by cabal-rpm.