Bug 843745

Summary: RFE: Add support for automatically downloading, building and installing dependencies in the chroot
Product: [Fedora] Fedora Reporter: Nick Coghlan <ncoghlan>
Component: mockAssignee: Copr Team <copr-team>
Status: NEW --- QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: rawhideCC: mebrown, msuchy, praiskup, williams
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 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:
Attachments:
Description Flags
Patch to add --megadeps command none

Description Nick Coghlan 2012-07-27 08:52:58 UTC
Created attachment 600720 [details]
Patch to add --megadeps command

The recently added mockchain script works by creating a local RPM repo and successively creating and destroying mock chroots until all SRPMs are building correctly. This can be quite slow if you have a lot of dependencies, and also requires determining the dependency list beforehand

The attached patch takes a different approach, allowing the mock configuration to include SRPM sources in addition to binary RPM sources and adding a new "--megadeps" command that works roughly as a combination of "--rebuild" and "--installdeps".

If a binary dependency is found to be missing, the "--megadeps" command means that mock will try to download the source RPM and build and install that, including the created RPM in the build result.

This mean that when migrating a large application with a lot of non-RHEL dependencies (e.g. Bugzilla) between RHEL versions without the aid of a centralised build tool like koji, you can simply define suitable sources of SRPMs (e.g. EPEL, versions of Fedora of similar vintage to the target RHEL version) and run a command like:

  mock -r <chroot config> --megadeps <application SRPM>

While this is useful in its own right, many dynamic language applications also depend directly on components from the language specific resources like CPAN. The attached patch includes an additional piece of CPAN integration that automatically generates an SRPM with cpanspec if no preexisting binary RPM or SRPM is available in the configured yum repos. That part may be better extracted and considered as a separate patch to the base feature of automatic building of dependencies.

The attached patch works (and has been used to ease RHEL 5 to RHEL 6 migrations), but can sometimes be thrown off if yum emits unexpected error messages (e.g. due to broken repos).

Comment 1 Jeff Fearn 🐞 2014-07-24 02:33:26 UTC
FYI this patch is now being carried in github.

https://github.com/jfearn/mock

Comment 2 Miroslav Suchý 2014-11-05 08:40:48 UTC
Personally I am ambivalent about this patch.
 1) I do not like having it in mock itself, because if I am reading code correctly it would mean that rebuilt deps would not have clean chroot.
 2) I like this logic and I would like to have this in mockchain. Much rather then current logic, which is there.

Comment 3 Fedora Admin XMLRPC Client 2020-03-17 04:42:52 UTC
This package has changed maintainer in the Fedora.
Reassigning to the new maintainer of this component.