This is a patch that adds distclean and rpm targets and fixes a couple
of issues I hit in the spec file.
Ignacio Vazquez-Abrams <ivazquez(a)ivazquez.net>
gpg --keyserver hkp://subkeys.pgp.net --recv-key 38028b72
This patch provides the ability to specify a unique extension to the buildroot
directory. This provides the ability for more than one mock process building
the same .cfg file, but isolated from each other. Useful for build systems :)
during a recent rebuild of all RHEL4 packages in mock, I saw a number of
packages which expect pkg-config to be present during the build stage, but
do not define it as a BuildRequire.
A short discussion of this issue on #fedora-devel suggested dropping
pkg-config into the buildgroups.xml definitions, so that it gets installed
by mock in each case.
I would like to request a couple additions to mock for the build
The important ones:
1) Ability to pass $statedir from mock's command line. Since the
process calling mock has no clue where the buildroot actually is
(without parsing the *.cfg file for the buildroot, see issues with that
below), the builder needs to be able to specify where mock writes its
state so that the builder can read that state. We talked about adding a
"--statedir" parameter to mock.
2) Doing multiple concurrent builds with two separate mock processes for
the same target/buildroot will fail because the mock *.cfg file for a
buildroot doesn't distinguish between different processes. We've talked
about making the config file have something like:
config_opts['root'] = 'aurora-development-sparc-core-%s' % os.getpid()
If there was any way to embed the addition of the PID into mock though,
I think that would be better since there's less possibility of the users
accidentally screwing that line up.
Perhaps another solution would be to add a mock argument like
"--rootdir-suffix" such that the calling process could specify a suffix
to add, and in the buildsystem that would most likely be the jobid of
the build job.
3) The build client is expected to clean up after the mock process, and
it cannot know what directory to delete unless it's able to find out
what the buildroot dir is from mock. Ideally the client wouldn't have
to parse the mock .cfg file, but perhaps mock would write out the
buildroot dir to its stdout first thing, or some other mechanism of
telling the calling process what the buildroot dir is.
4) commands.getstatusoutput() seems to buffer the output of the child
until the child has exited. It would be nice (and somewhat useful) to
stream the command output to a file rather than grab it all at once and
write it out at the end. Packages like OpenOffice.org generate lots of
build output, around 25MB. That's a lot of memory usage at the end of
the job when the output buffer is acquired and written out all at once.
I've also thought of adding a feature to the build system like "get last
500 lines of buildlog output" so that users might be able to see where
in the package the build is (for OOo, the build takes about 3 - 7 hrs on
1) Fixes traceback when the buildroot directory doesn't exist (which
will be the case when we start specifying buildroots on the mock command
2) Fixes traceback when Root() fails for some reason (wrong user/group
config, mock user doesn't exist with same GID as the mock executable,
If it looks OK, I can apply.
Anyone know what the following means:
Errors cleaning out chroot: mock-helper: error: /var/lib/mock//fedora-development-i386-core: No such file or directory
making /dev devices
making misc files of use
yum: command /usr/sbin/mock-helper yum --installroot /var/lib/mock//fedora-development-i386-core/root groupinstall build
Creating user for builds
Non-zero return value 127 on executing /usr/sbin/mock-helper chroot /var/lib/mock//fedora-development-i386-core/root /sbin/runuser - root -c "/usr/sbin/useradd -u 500 -d /builddir mockbuild"
I've added myself to the mock group, and I'm using mock-0.3-2.fc4. I'm
probably forgetting a step somewhere...
For anyone interested, I've patched mock against CVS for the following:
1. Make available configs in the following order, with the latter config
overriding the prior config:
/etc/mock/$CHROOT.cfg <-- Originally, only this was available.
This is in: mock.py-config.patch
2. Make the build.log and root.log prefixed with the name of the srpm
This is in: mock.py-uniquify.patch
This patch helps by cutting down on the repetition seen in the different
chroot cfgs. Right now, root/target_arch/yum.conf goes in my chroot
cfgs and the rest is dumped into general.cfg. The name can change to
whatever, but I think the gist of it is clear. ~/.mockrc is good for
things like custom rpmmacros that you don't want to su for
editing /etc/mock/* stuff all the time.
RCS file: /cvs/fedora/mock/mock.py,v
retrieving revision 1.6
diff -u -3 -p -r1.6 mock.py
--- mock.py 28 May 2005 17:18:49 -0000 1.6
+++ mock.py 7 Jun 2005 16:07:15 -0000
@@ -628,6 +628,18 @@ def main():
srpm = args # we only take one and I don't care. :)
+ # bring in an optional generic config file
+ general_cfg = os.path.join(config_path, "general.cfg")
+ if os.path.exists(general_cfg):
+ # and optional user config file
+ user_cfg = os.path.join(os.path.expanduser("~/.mockrc"))
+ if os.path.exists(user_cfg):
# read in the config file by chroot name