Fedora Account System
Red Hat Associate
Red Hat Customer
When creating queries from package specs, hy_subject_get_best_solution() does not filter the results according to what package architectures are allowed (which was previously set via dnf_sack_set_arch()). Normally this is not an issue, as packages with an incorrect architecture will later be rejected anyway through checks happening in libsolv, but in Yocto project we found a scenario where it does lead to an incorrect decision. Specifically: 1. The system architecture is set to "correct-arch". 2. The installation repository contains two packages: - package "abc.incorrect-arch" - package "xyz.correct-arch", with "provides: abc" 3. What then happens is that hy_subject_get_best_solution() will pick "abc" package for the installation (because the code that would consider packages with "provides: abc" is not even reached). Then later the "abc" package will be rejected by libsolv, even though the correct solution would've been to pick "xyz". More info here: https://bugzilla.yoctoproject.org/show_bug.cgi?id=12025 I have considered various ways to fix this, but I can't decide which would be the optimal one. This is something for libdnf maintainer to ponder, I guess: 1) Add HY_ONLY_INSTALLABLE to _hy_query_flags, use it in hy-query.c init_result() to filter the package set with the help of pool_installable() from libsolv. 2) Add hy_query_filter_installable() funtcion to hy-query.c, which would use the same pool_installable() to filter the package set. Call it from hy_subject_get_best_solution(). 3) Add HY_PKG_INSTALLABLE type of filter, otherwise similar to solution 2. 4) in hy_subject_get_best_solution() get the list of allowed architectures (libsolv or libdnf do not provide a convenience function for it, but it can be done). Then issue: hy_query_filter_in(query, HY_PKG_ARCH, HY_EQ, allowed_arches); Thoughts?
This bug appears to have been reported against 'rawhide' during the Fedora 28 development cycle. Changing version to '28'.
This bug appears to have been reported against 'rawhide' during the Fedora 29 development cycle. Changing version to '29'.
The similar problem we used to have with src arch. Now they are filtered out using with_src=false. Please is still your request relevant?
Not really relevant anymore. We have meanwhile implemented repo setup in such a way that packages with incorrect architectures never make it to the repo (via whitelisting). So there's no way to even easily verify this anymore.
Thanks a lot for response.