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
Add expanding solvable provides for dependency matching #762
Conversation
@lukash could you check if you're able to build it locally using tito? |
@dmach sorry, missed that. I've added a commit fixing the test, although it should probably be squashed with the one introducing the change, I can do that later. |
There was an error while running a copr build. You can re-trigger copr build by adding a comment ( |
☔ The latest upstream changes (presumably 6993c4b) made this pull request unmergeable. Please resolve the merge conflicts. |
📌 Commit 13911cb has been approved by |
@lukash the |
@Conan-Kudo oops :( I wanted @j-mracek to look at this and the related PRs before it gets merged... I do think it's what we want but there's a chance it may not be. |
@lukash for what it's worth, your code changes made sense to me, and it didn't seem broken when I looked at it. |
@Conan-Kudo ok. The changes here are most probably fine, the dnf part has probably more potential to be problematic... Hopefully this will prompt @j-mracek to do the review 🙂 |
☔ The latest upstream changes (presumably db4b61a) made this pull request unmergeable. Please resolve the merge conflicts. |
@lukash Please could you also rebase it? |
Congratulations! The build has finished successfully. 🍾 You can install the built RPMs by following these steps:
Please note that the RPMs should be used only in a testing environment. |
@j-mracek I've switched from |
☔ The latest upstream changes (presumably d3eb5c9) made this pull request unmergeable. Please resolve the merge conflicts. |
@lukash Please could you rebase it? |
Join the HY_PKG_CONFLICTS switch branch with the rest of the dependencies and remove the matchtype assert. The assert is done in the filterRcoReldep() function and the rest is the same.
@lukash I would like to ask you to enhance python binging in query-py.cpp. The new code supports query but not list of packages. |
libdnf/sack/query.cpp
Outdated
assert(f.getMatches().size() == 1); | ||
|
||
dnf_sack_make_provides_ready(sack); | ||
Pool *pool = dnf_sack_get_pool(sack); |
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 Pool * pool
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.
Also in all other new line please use a middle position for *
.
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.
There were just a couple, I think I got them all.
|
||
o = hawkey.Query(self.sack).filter(obsoletes=q) | ||
self.assertLength(o, 1) | ||
self.assertEqual(str(o[0]), "fool-1-5.noarch") | ||
|
||
def test_requires_with_package_list(self): | ||
q = hawkey.Query(self.sack).filter(name="fool") | ||
o = hawkey.Query(self.sack).filter(requires=q) |
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 could you also add requires=q.run()
This allows to filter all dependencies (requires, conflicts, recommends, etc.) by a list of solvables that match the dependency. Can be used in the dnf repoquery command instead of a low-level piece of code which was expanding packages to their provides and then matching the dependencies as reldeps. https://bugzilla.redhat.com/show_bug.cgi?id=1534123 https://bugzilla.redhat.com/show_bug.cgi?id=1698034
Fixes tests after allowing to pass a query (or an iterable of packages) as an argument to dependency filters (requires, suggests, etc.) in "Query: add a dependency by solvable filter". Drops the exception check and adds a simple test for the new functionality.
In addition to supporting a query as an argument to the dependency filters (which then gets resolved to a list of packages), add support for passing a sequence of packages directly.
I'd also welcome if you were more specific with these requests, especially since it's been some time since the details were fresh in my head. Anyway, I think I figured out what you're asking for in the end and I've added a commit which adds support for a sequence of packages and the corresponding test with query.run(). |
This is meant to fix a bug where rich dependencies would match a package even if the require specified a different version range than doesn't match the version of the provide.
Uses a new libsolv function pool_whatmatchessolvable(). Further description is with the commits, along with some shortcomings this currently has.
dnf PR:
rpm-software-management/dnf#1432
Tests are here:
rpm-software-management/ci-dnf-stack#577
https://bugzilla.redhat.com/show_bug.cgi?id=1534123
https://bugzilla.redhat.com/show_bug.cgi?id=1698034