tito icon indicating copy to clipboard operation
tito copied to clipboard

MockBuilder doesn't use mock for srpms

Open ringerc opened this issue 11 years ago • 4 comments

mock supports srpm generation. This is useful and important, because srpms aren't 100% compatible across distros even if the spec file is the same or uses conditionals. In particular, RH Bugzilla 490613 shows that the checksum method that newer RH/Fedora defaults to will produce SRPMs that won't work on older RHEL/CentOS.

MockBuilder should probably use --buildsrpm --spec the.spec --sources * or similar to generate SRPMs for each target separately.

ringerc avatar Jul 31 '14 07:07 ringerc

Tito cheat and produce srpm with: rpmbuild --define "_source_filedigest_algorithm md5" so everybody from RHEL5 to Fedora rawhide can understand it.

Using mock for generating srpm would mean that you will have to generate separate srpm for each releaser (or something similar). It sounds too complicated, because currently builder knows nothing about targeting release. Nevertheless if you have idea how to implement it, then I'm listening.

xsuchy avatar Aug 03 '14 19:08 xsuchy

Yeah, that's a workaround, but it produces weaker SRPMs, may be unsupported in future, and won't solve any other incompatibilities that may arise.

If it's written with the assumption that there can be only one SRPM for a release, then there's not much to be done about it - your workaround does the job for now after all, and I guess it's one of those "too hard to change" issues. Still a bug IMO, but one that hasn't fully bitten yet.

ringerc avatar Aug 04 '14 03:08 ringerc

I thought about it over night and I can imagine that

tito build --srpm

would still works as now. However, we can add:

tito build --srpm -r fedora-20-x86_64

which would use mock for building srpm.

And in releaser.conf we can add

[releaser-name]
builder.srpm_mock = fedora-20-x86_64

which would be passed to builder similarly as builder.test is passed now.

xsuchy avatar Aug 04 '14 07:08 xsuchy

One drawback of using one tool for building SRPMs and another one for binary RPMs is that I have to define RPM macros twice if the macros are needed to build the binary RPMs, e.g.:

tito build --rpm --test --rpmbuild-options='--define="snapshot 123"' --builder=mock --arg=mock=fedora-rawhide-x86_64 --arg='mock_args=--define "snapshot 123"'

ghost avatar May 22 '15 10:05 ghost