New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
mock: fix dynamic buildrequires unnecesarry loop #482
mock: fix dynamic buildrequires unnecesarry loop #482
Conversation
afbb79f
to
b735e72
Compare
mock/py/mockbuild/backend.py
Outdated
@@ -699,7 +699,6 @@ def get_command(mode): | |||
# * it fails | |||
# * installSrpmDeps does nothing | |||
# * or we run out of dynamic_buildrequires_max_loops tries | |||
packages_before = self.buildroot.all_chroot_packages() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, we can drop this (no need to access the RPM db by rpm -qa
), but we
need a replacement here. Most likely you need to maintain a set()
of
real build requirements across the iteration... in each step you can get
the list from installSrpmDeps
with small enhancements.
b735e72
to
13c095e
Compare
13c095e
to
955fd7b
Compare
mock/py/mockbuild/backend.py
Outdated
self.installSrpmDeps(*buildreqs) | ||
packages_after = self.buildroot.all_chroot_packages() | ||
if packages_after == packages_before: | ||
new_deps = self.installSrpmDeps(*buildreqs, *deps) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't we use just deps
argument here, without star?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd perhaps use ignored_deps=deps
to underline the purpose of the argument.
mock/py/mockbuild/backend.py
Outdated
@@ -180,24 +180,27 @@ def remove(self, *rpms): | |||
self.buildroot.root_log.info(output) | |||
|
|||
@traceLog() | |||
def installSrpmDeps(self, *srpms): | |||
def installSrpmDeps(self, *srpms, ignored_deps=None): | |||
"""Figure out deps from srpm. Call package manager to install them""" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please state what ignored_deps
means in the method documentation.
9069255
to
84dc7a7
Compare
The commit message doesn't correspond to what is really changing. |
@@ -708,6 +708,7 @@ def get_command(mode): | |||
except Error as e: | |||
if e.resultcode != 11: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please document the fact that we accept exit_status 0 and exit_status 11, and why.
I am sorry, the PR is not yet finished. I forgot to add WIP tag. |
Test that mockchain works, with tmpfs plugin ON (keep_mounted=True), nocache plugin ON, and dynamic buildrequires package. Relates: rpm-software-management#482, rpm-software-management#512, rpm-software-management#479
Test that mockchain works, with tmpfs plugin ON (keep_mounted=True), nocache plugin ON, and dynamic buildrequires package. Relates: rpm-software-management#482, rpm-software-management#512, rpm-software-management#479
per discussion here: rpm-software-management/rpm#963 Mock should accept return code 0 as well as 11 from rpm. Later when rpm is fixed, mock will accept just 0.
84dc7a7
to
30d0230
Compare
per discussion here: rpm-software-management/rpm#963
Mock should accept return code 0 from rpm.
Relates: #434