2015-05-20 12:38:11

Why mock does not work on EL 6 and EL7 and how to fix it

I am receiving lots of complaints that people are unable to build Fedora rawhide builds on EL6 and EL7. This is intentional and I will show you how you can workaround it.

At the outset brief history lesson: As you know DNF became default in Fedora and Yum is obsoleted. After few releases of Fedora, Yum will be likely removed from distribution. Definitely during lifetime of EL6 and EL7. So while we have Yum in all distributions currently, we are approaching the moment where we will not have either Dnf or Yum available in all distribution which Mock supports. During DevConf.cz various stakeholders decided to change Mock settings to use DNF for building rawhide builds (soon to be F23 builds). However this introduced big dilema: EL6 and EL7 does not have DNF available (well there is DNF in EPEL7, but not dnf-plugins-core, which are crucial for for Mock). There are three options how to handle this situation:

  1. Do not allow EL6 and EL7 to build packages for Fedora rawhide (and F23+).
  2. Change Mock settings that EL6 and EL7 users will continue to use Yum for building Fedora rawhide (and F23+). While this option seems to be good trade-off, there is big risk that you end up with different binary compared to the same process on Fedoras. For example there was issue that Rubygems requires ruby(release), which Yum resolved to normal ruby, however DNF resolved that to jruby. And that is big difference.
  3. So I decided to go with first option (i.e. to not allow builds for Fedora rawhide), however you have two option how to easily workaround it, if you know what you are doing. The important part is that you must do manually change. This is basicaly your acknowledgment that you are doing something non-standard.

Workaround

You have two way how to force Mock to use Yum:

  1. The first option is more suitable for one shot mode. You simply pass --yum option on a command line.
  2. For persistent change you can put this line inside of /etc/mock/site-defaults.cfg or inside of any /etc/mock/*.cfg file:

    config_opts['package_manager'] = 'yum'

This is something which you may want to do, when you are building some packages for personal usage. However you should avoid that if you are operating some build system. In such case migration to some recent Fedora is your only option.

Once again - this is implication of 'DNF as default' feature. We could postpone it probably by few months, but then it would hit us even harder.


Posted by Miroslav Suchý | Permanent link
Comments
comments powered by Disqus