Mock build fails because of dependencies even though they were installed

General support questions
Post Reply
abdallasalmi
Posts: 2
Joined: 2021/07/06 10:46:46

Mock build fails because of dependencies even though they were installed

Post by abdallasalmi » 2021/07/06 10:56:02

Hi,

I'm trying to build an RPM for openresty with an additional module that is not available as part of the official repo.

I'm using Mock for that. However, I do get an error related to requirements:
Error: No Package found for openresty-openssl111-devel >= 1.1.1h-1
Error: No Package found for openresty-pcre-devel >= 8.44-1
Error: No Package found for openresty-zlib-devel >= 1.2.11-3
What I don't get is that I did install those packages and could confirm their existence using *sudo yum list | grep <package name>*. But I keep getting the error.

Why is Mock or Yum unable to *see* those packages?

I did all I could possibly do: sudo yum update, sign out/sign back in, restart VM..etc but no hope.

Any help or pointers will be appreciated.

User avatar
TrevorH
Site Admin
Posts: 33202
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: Mock build fails because of dependencies even though they were installed

Post by TrevorH » 2021/07/06 12:37:07

Because that's how mock works. It doesn't use the packages installed on your system, it sets up a chroot and installs a separate system inside that and then does the build inside the choot. The correct way to get it to pull in those packages is to add e.g. BuildRequires: openresty-zlib-devel to your rpm spec file and then it will install those named packages inside the chroot for you. Mock also uses its own list of yum repos so if your dependent packages reside in another repo other than the standard ones then you need to edit the /etc/mock config file in question and add a new repo to it that it can use to install them.
The future appears to be RHEL or Debian. I think I'm going Debian.
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are deadest, do not use them.
Use the FAQ Luke

abdallasalmi
Posts: 2
Joined: 2021/07/06 10:46:46

Re: Mock build fails because of dependencies even though they were installed

Post by abdallasalmi » 2021/07/06 13:45:16

Many thanks for taking the time to answer my question.

Now I understand the process.

However, the specfile has these build requirements:
BuildRequires: perl-File-Temp
BuildRequires: ccache, gcc, make, perl, systemtap-sdt-devel
BuildRequires: openresty-zlib-devel >= 1.2.11-3
BuildRequires: openresty-openssl111-devel >= 1.1.1h-1
BuildRequires: openresty-pcre-devel >= 8.44-1
Requires: openresty-zlib >= 1.2.11-3
Requires: openresty-openssl111 >= 1.1.1h-1
Requires: openresty-pcre >= 8.44-1
It seems that you noted that chroot isn't getting them (because they aren't in mock's repos) but it does get ccache, gcc, make and the first line.

I tried to find info about how to add repos to mock but I failed to find any. It seems that the config file e.g. centos-7-x86_64.cfg doesn't have what looks like a list of repos that can be edited.

User avatar
TrevorH
Site Admin
Posts: 33202
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: Mock build fails because of dependencies even though they were installed

Post by TrevorH » 2021/07/06 15:26:51

On el7 with mock-2.6-1.el7.noarch, you don't have an /etc/mock/default.cfg containing stuff like...

Code: Select all

# repos
[base]
...
?
The future appears to be RHEL or Debian. I think I'm going Debian.
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are deadest, do not use them.
Use the FAQ Luke

Post Reply