Bug 1536797

Summary: (Epel7) mock fails for builds for fedora 26 and higher
Product: [Fedora] Fedora EPEL Reporter: Rolf Fokkens <rolf>
Component: mockAssignee: Miroslav Suchý <msuchy>
Status: CLOSED NOTABUG QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: epel7CC: bart, fweimer, jdisnard, jkeating, mebrown, msimacek, msuchy, praiskup, t.h.amundsen, williams
Target Milestone: ---Keywords: Reopened
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2018-01-22 15:21:36 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Rolf Fokkens 2018-01-21 10:51:28 UTC
Description of problem:
mock fails when using mock on CentOS 7 to build a package for Fedora 26 and higher. It is caused by new Fedora packages cmake-rpm-macros, cmake and cmake-data that now include boolean dependencies.

Version-Release number of selected component (if applicable):
mock-1.4.7-2.el7.noarch
cmake-rpm-macros-3.10.1-11.fc26
cmake-3.10.1-11.fc26
cmake-data-3.10.1-11.fc26

How reproducible:
100%

Steps to Reproduce:
1. mock -r fedora-26-x86_64 (whatever src.rpm)

Actual results:
mock -r fedora-26-x86_64 --resultdir=/tmp/gone ...
INFO: mock.py version 1.4.7 starting (python version = 2.7.5)...
Start: init plugins
...
--> Finished Dependency Resolution
Error: Package: cmake-rpm-macros-3.10.1-11.fc26.noarch (updates)
           Requires: (cmake = 3.10.1-11.fc26 if cmake < 3.10.1-11.fc26)
Error: Package: cmake-rpm-macros-3.10.1-11.fc26.noarch (updates)
           Requires: (cmake-data = 3.10.1-11.fc26 if cmake-data < 3.10.1-11.fc26)
 You could try using --skip-broken to work around the problem
 You could try running: rpm -Va --nofiles --nodigest


Expected results:
successful mock completion

Additional info:
http://rpm.org/user_doc/boolean_dependencies.html

Comment 1 Miroslav Suchý 2018-01-22 13:02:33 UTC
This works for me:
  mock -r fedora-26-x86_64 --install cmake-rpm-macros cmake

I am aware that previous week there were problems with some proxies in Fedora infrastructure which lead that you can get some packages in older version.

If this happen again to you, please raise fedora-infra ticket.

Comment 2 Rolf Fokkens 2018-01-22 14:46:51 UTC
I don't think this is related to Fedora infrastructure, it's alle running on my local system. And the problem still exists:

[rolf.fokkens@th-dev02 ~]$ cat /etc/system-release
CentOS Linux release 7.4.1708 (Core) 
[rolf.fokkens@th-dev02 ~]$ yum list mock
Loaded plugins: fastestmirror, post-transaction-actions, verify
Skipping unreadable repository '/etc/yum.repos.d/netuitive.repo'
Loading mirror speeds from cached hostfile
 * base: mirror.ams1.nl.leaseweb.net
 * epel: ftp.nluug.nl
 * extras: mirror.nforce.com
 * tgho: repo.tgho.nl
 * tgho-python34: repo.tgho.nl
 * tgho-python34-testing-enabled: repo.tgho.nl
 * updates: ftp.tudelft.nl
Installed Packages
mock.noarch                                                                                            1.4.8-1.el7                                                                                            @epel
[rolf.fokkens@th-dev02 ~]$ mock -r fedora-26-x86_64 --resultdir=/tmp/gone --install cmake-rpm-macros cmake
INFO: mock.py version 1.4.8 starting (python version = 2.7.5)...
Start: init plugins
INFO: selinux disabled
Finish: init plugins
Start: run
Start: chroot init
INFO: calling preinit hooks
INFO: enabled root cache
INFO: enabled dnf cache
Start: cleaning dnf metadata
Finish: cleaning dnf metadata
INFO: enabled HW Info plugin
Mock Version: 1.4.8
INFO: Mock Version: 1.4.8
Start: yum install
Failed to set locale, defaulting to C
fedora/26/x86_64/metalink                                                                                                                                                                   |  22 kB  00:00:00     
updates/26/x86_64/metalink                                                                                                                                                                  |  21 kB  00:00:00     
Resolving Dependencies
--> Running transaction check
---> Package bash.x86_64 0:4.4.12-7.fc26 will be installed
--> Processing Dependency: filesystem >= 3 for package: bash-4.4.12-7.fc26.x86_64
...
---> Package keyutils-libs.x86_64 0:1.5.10-1.fc26 will be installed
---> Package libverto.x86_64 0:0.2.6-7.fc26 will be installed
---> Package publicsuffix-list-dafsa.noarch 0:20171028-1.fc26 will be installed
--> Finished Dependency Resolution
Error: Package: cmake-rpm-macros-3.10.1-11.fc26.noarch (updates)
           Requires: (cmake = 3.10.1-11.fc26 if cmake < 3.10.1-11.fc26)
Error: Package: cmake-rpm-macros-3.10.1-11.fc26.noarch (updates)
           Requires: (cmake-data = 3.10.1-11.fc26 if cmake-data < 3.10.1-11.fc26)
 You could try using --skip-broken to work around the problem
 You could try running: rpm -Va --nofiles --nodigest

[rolf.fokkens@th-dev02 ~]$

Comment 3 Rolf Fokkens 2018-01-22 14:53:53 UTC
Oh, btw this issue no longer affects me, because I now use mock on Fedora 27. But this me be of interrest to other mock users and developers anyway.

Comment 4 Miroslav Suchý 2018-01-22 15:21:36 UTC
This happens to you, but those packages are fetched from Fedora repositories.
And both packages (cmake-rpm-macros and cmake) are present in fedora repository. E.g., check this mirror:
http://ftp.fi.muni.cz/pub/linux/fedora/linux/updates/26/x86_64/Packages/c/
And check your local mirror.

Comment 5 Rolf Fokkens 2018-01-27 17:48:05 UTC
Assuming in time all repos should be in sync, i checked again. The problem is still there.

Have you REALLY verified this on CentOS7? Becaus running (EPEL7) mock on CentOS7  causes the problems. I still have the same problem (ON CENTOS7/EPEL7).

But let's have a look:

I downloaded the cmake-rpm-macros package from: http://ftp.fi.muni.cz/pub/linux/fedora/linux/updates/26/x86_64/Packages/c/cmake-rpm-macros-3.10.1-11.fc26.noarch.rpm

Then I did this (on CentOS7/EPEL7):

[rolf.fokkens@th-dev01 ~]$ rpm -q -R -p cmake-rpm-macros-3.10.1-11.fc26.noarch.rpm 
warning: cmake-rpm-macros-3.10.1-11.fc26.noarch.rpm: Header V3 RSA/SHA256 Signature, key ID 64dab85d: NOKEY
(cmake = 3.10.1-11.fc26 if cmake < 3.10.1-11.fc26)
(cmake-data = 3.10.1-11.fc26 if cmake-data < 3.10.1-11.fc26)
/usr/bin/python3
rpm
rpmlib(CompressedFileNames) <= 3.0.4-1
rpmlib(FileDigests) <= 4.6.0-1
rpmlib(PayloadFilesHavePrefix) <= 4.0-1
rpmlib(PayloadIsXz) <= 5.2-1
rpmlib(RichDependencies) <= 4.12.0-1
[rolf.fokkens@th-dev01 ~]$ 

And there you have it: the first two deps are "Boolean Dependencies", which are supported since RPM 4.13 (http://rpm.org/user_doc/boolean_dependencies.html). And RPM on CentOS7 is rpm-4.11.3-25.el7.x86_64.

So RPM on CentOS7/EPEL7 does not onderstand it. Unless mock brings its own rpm 4.13 version (on CentOS7) it makes sense to me that this will not work.

But if you still claim this is "Fedora Infrastructure" problem, than I don't understand at all. But I 'm using mock on Fedora 26 new, so the problem is no longer there for me.

Comment 6 Trond H. Amundsen 2018-01-30 11:32:29 UTC
I've hit this problem also. Our local Koji infrastructure uses RHEL7 buildhosts, so this affects us. But I believe this bug should be filed against cmake, not mock.

Comment 7 Rolf Fokkens 2018-01-31 09:08:42 UTC
I don't think it is a cmake problem: the cmake version relies on an RPM feature that is present in F26, which is OK because it is a F25 cmake package.

Comment 8 Rolf Fokkens 2018-01-31 09:25:08 UTC
Correction: ... which is OK because it is a F26 cmake package.

Comment 9 Trond H. Amundsen 2018-01-31 10:20:32 UTC
My point was that since cmake-rpm-macros is used in default mock buildroots (required by redhat-rpm-macros), it shouldn't utilize RPM features that aren't available on all supported rhel/fedora versions. I don't think mock is to blame here.

Comment 10 Miroslav Suchý 2018-01-31 12:03:53 UTC
@Rolf You are right, I have mistaken this issue with another similar one.

As you stated the problem is that EL7 rpm does not understand rich dependencies, which are allowed in F26+.

So this is still NOTABUG from mock POV.

What you can do is to use new bootstrap feature:
  --bootstrap-chroot
or
  config_opts['use_bootstrap_container'] = True

This is by default False, because there are several known issues, which still need to be addressed. Feel free to try it.

This feature create boostrap chroot, where is installed only dnf and rpm and then mock call dnf in that boostrap chroot and install all required packages in the final chroot.

Comment 11 Rolf Fokkens 2018-01-31 13:32:48 UTC
Ah, thx! The --bootstrap-chroot option is magical! Problem solved indeed!