diff --git a/mock/py/mockbuild/backend.py b/mock/py/mockbuild/backend.py index f9ad24d91..15a40f923 100644 --- a/mock/py/mockbuild/backend.py +++ b/mock/py/mockbuild/backend.py @@ -783,9 +783,6 @@ def get_command(mode): # We want to (re-)write src.rpm with dynamic BuildRequires, # but with short-circuit it doesn't matter mode = ['-ba'] - # rpmbuild -br already does %prep, so we don't need waste time - # on re-doing it - mode += ['--noprep'] self.buildroot.doChroot(get_command(mode), shell=False, logger=self.buildroot.build_log, timeout=timeout, diff --git a/releng/release-notes-next/generate_buildrequires.bug b/releng/release-notes-next/generate_buildrequires.bug new file mode 100644 index 000000000..68d0204dd --- /dev/null +++ b/releng/release-notes-next/generate_buildrequires.bug @@ -0,0 +1,17 @@ +To save time, Mock previously skipped the `%prep` section when building +an RPM package after completing the installation of all the requirements +generated by `%generate_buildrequries`. + +However, when the `%generate_buildrequries` section has side effects altering +the results of a subsequent run of self, +then the final build may work with different data and generate incorrect +build requirements that may not be actually installed during the build. +In extreme case, it is possible to successfully build a package with +unsatisfiable BuildRequires in the built SRPM metadata. + +Mock now calls `%prep` section even during the final build after completing +the installation of all the generated build requirements. +This may result in a few seconds of delay when spec file uses +`%generate_buildrequries` but the source used to generate the build requirements +is more likely to stay consistent during the build, +making it harder to accidentally generate unsatisfied BuildRequires.