Start: Waiting for yumcache lock

Have you ever tried to build a package under Fedora (or RHEL)? Did you used “mock” for it? If you answered “yes” to both questions I have a task for you: do 2 or 3 builds at SAME time…

Curses, curses and other ugly words will start in your mind. I have no idea why in days of multiple cpu cores and gigabytes of memory “mock” tool forces users to do one build at time. Sure, there are ways to make several builds at same time but all sucks. And I am going to write why and compare it to “pbuilder” from Debian world.

Ok, so what “mock” is? It is a tool which do some tasks in defined order:

So where the problem is? First thing: there are multiple problems ;(

First issue: mock assumes that there will be one run at time and does it in /var/lib/mock/TARGET/ (where TARGET is ‘fedora-rawhide-aarch64’ for example). This can be solved with “—uniqueext=packagename” argument.

Second issue: there is ONE yum! Instead of using yum inside of chroot mock is using system one. So if you run few mocks at time (remember: cpu time and memory are cheap) you will see “Start: Waiting for yumcache lock” message for most of time (twice per build).

Why it drives me mad? Because “pbuilder” in Debian did not have such silly issues. Each build was done in “mktemp” named directory and APT was used inside of chroot. Sure, that could mean more fetching of packages but I had local APT proxy for it which allowed me to do 30-50MB/s downloads.

And I do not want to mention fact that if you want to configure mock you have to do that system wide…

debian development fedora ubuntu