Description of problem: mock must *not* automatically update packages in build root (and it never did). I am forced quite often to do something like: $ mock -r fedora-rawhide-x86_64 --pm-cmd downgrade https://kojipkgs.fedoraproject.org//packages/crypto-policies/20140905/1.git4649b7d.fc22/noarch/crypto-policies-20140905-1.git4649b7d.fc22.noarch.rpm $ mock -r fedora-rawhide-x86_64 ruby-2.1.5-24.fc22.src.rpm --no-clean to test what if that specific version of package is causing issues. But recently, mock updates the package back to the most recent version. This is wrong! Version-Release number of selected component (if applicable): $ rpm -q mock mock-1.2.1-1.fc20.noarch How reproducible: Steps to Reproduce: 1. mock -r fedora-rawhide-x86_64 --pm-cmd downgrade https://kojipkgs.fedoraproject.org//packages/crypto-policies/20140905/1.git4649b7d.fc22/noarch/crypto-policies-20140905-1.git4649b7d.fc22.noarch.rpm 2. mock -r fedora-rawhide-x86_64 ruby-2.1.5-24.fc22.src.rpm --no-clean 3. Actual results: The second command updates the crypto-policies to the most recent version: Start: yum update ================================================================================ Package Arch Version Repository Size ================================================================================ Updating: crypto-policies noarch 20141119-1.gitbe6fb4f.fc22 local 23 k Transaction Summary ================================================================================ Upgrade 1 Package Total size: 23 k Updated: crypto-policies.noarch 0:20141119-1.gitbe6fb4f.fc22 Finish: yum update Finish: chroot init Expected results: mock does not touch the packages in the build root, since the build root was already populated and all dependencies are met. Additional info:
This is the offending patch: ae79fb5bed79946b84871dc204fc0e6c8cb17cea
Just FTR, I tried to use --disablerepo=* to workaround the issues, and of course mock fails with error: Start: yum update There are no enabled repos. Run "yum repolist all" to see the repos you have. You can enable repos with yum-config-manager --enable <repo> ERROR: Exception(ruby-2.1.5-24.fc22.src.rpm) Config(fedora-rawhide-x86_64) 0 minutes 1 seconds INFO: Results and/or logs in: /var/lib/mock/fedora-rawhide-x86_64/result ERROR: Command failed. See logs for output. # /usr/bin/yum --installroot /var/lib/mock/fedora-rawhide-x86_64/root/ --releasever 22 --disablerepo * update --setopt=tsflags=nocontexts This is wrong as well.
You can use --offline to prevent packages from being updated.
'yum update' was presented in previous mock as well. And on exactly the same place. So this is no regression. Additionally this is configurable in site-default.cfg by setting: config_opts['update_before_build'] = False or, as Mikolaj said, by using --offline.
(In reply to Miroslav Suchý from comment #4) > 'yum update' was presented in previous mock as well. And on exactly the same > place. So this is no regression. This is not true IMO. 1) The behavior I described never happened before. 2) Checking 1.1.41, the update was run under this condition: https://git.fedorahosted.org/cgit/mock.git/tree/py/mockbuild/backend.py?id=mock-1.1.41#n453 and if go further, you'll see that the condition was never true for not cleaned chroot. https://git.fedorahosted.org/cgit/mock.git/tree/py/mockbuild/plugins/root_cache.py?id=mock-1.1.41#n105 Other reason why this happens might be enabled LVM plugin, not sure ... > Additionally this is configurable in site-default.cfg by setting: > config_opts['update_before_build'] = False Luckily it is and it should be disabled by default. It should never update. I can't imagine building package several times with --no-clean option and suddenly it starts failing due to some update which lands in the mean time. Moreover, it just delays the build. > or, as Mikolaj said, by using --offline. Thanks for the tip, I'll try it ...
(In reply to Vít Ondruch from comment #5) > (In reply to Miroslav Suchý from comment #4) > > 'yum update' was presented in previous mock as well. And on exactly the same > > place. So this is no regression. > > This is not true IMO. > > 1) The behavior I described never happened before. It definitely happened with mock 1.1.x. I am sure because I used to use private build of mock with this "feature" removed: https://github.com/mizdebsk/mock/commit/7ab92f6538b5e441d74f7fa3b56fc37e4d7ce711 > > or, as Mikolaj said, by using --offline. > > Thanks for the tip, I'll try it ... I might be wrong, but as I understand, in mock 1.1.x or 1.2.x with --offline will prevent mock from downloading any new dependencies. However if you configure mock to use dnf, --offline prevents running "dnf update" and refreshing metadata, but it doesn't prevent mock from downloading and installing new dependencies. This is exactly what I personally need and expect.
Vit is right, it didn't happen before when --no-clean was specified. Mikolaj is probably talking about updating without --no-clean which stayed the same. The code is similar, but previous versions of mock didn't execute it at all with --no-clean. Now initialize function is executed for all buildroot modifying actions in order to minimize code duplication and enable things like automatic initialization, LVM, mock shell accessible during build, etc. So this is a regression. Sent a patch upstream. In the meantime, you can use config_opts['update_before_build'] = False as a workaround for this (it will disable yum update for builds regardless of clean/no-clean)
Commited as 9085831
mock-1.2.3-1.fc21 has been submitted as an update for Fedora 21. https://admin.fedoraproject.org/updates/mock-1.2.3-1.fc21
mock-1.2.3-1.fc20 has been submitted as an update for Fedora 20. https://admin.fedoraproject.org/updates/mock-1.2.3-1.fc20
mock-1.2.3-1.el7 has been submitted as an update for Fedora EPEL 7. https://admin.fedoraproject.org/updates/mock-1.2.3-1.el7
mock-1.2.3-1.el6 has been submitted as an update for Fedora EPEL 6. https://admin.fedoraproject.org/updates/mock-1.2.3-1.el6
Package mock-1.2.3-1.fc21: * should fix your issue, * was pushed to the Fedora 21 testing repository, * should be available at your local mirror within two days. Update it with: # su -c 'yum update --enablerepo=updates-testing mock-1.2.3-1.fc21' as soon as you are able to. Please go to the following url: https://admin.fedoraproject.org/updates/FEDORA-2014-16285/mock-1.2.3-1.fc21 then log in and leave karma (feedback).
mock-1.2.3-1.fc21 has been pushed to the Fedora 21 stable repository. If problems still persist, please make note of it in this bug report.
mock-1.2.3-1.fc20 has been pushed to the Fedora 20 stable repository. If problems still persist, please make note of it in this bug report.
mock-1.2.3-1.el7 has been pushed to the Fedora EPEL 7 stable repository. If problems still persist, please make note of it in this bug report.
mock-1.2.3-1.el6 has been pushed to the Fedora EPEL 6 stable repository. If problems still persist, please make note of it in this bug report.