<div dir="ltr"><div>I was hit this week by opkg giving me a cryptic hint to resolve a problem:</div><div><br></div><div><div><li class="gmail-li1"><div class="gmail-de1">* Problem 1/2:</div></li>
<div class="gmail-de1"> * - package packagegroup-core-boot-1.0-r17.6.shadow_ghost requires sysvinit, but none of the providers can be installed</div> *
<div class="gmail-de2"> * Solution 1:</div>
* - do not ask to install a package providing packagegroup-core-boot</div></div><div><br></div><div>Digging a bit into how it does things, I saw it's making use of solver_problem2str(), which in</div><div>turn calls solver_findproblemrule(), which is documented as:</div><div><br></div><div> * search for a rule that describes the problem to the<br> * user. Actually a pretty hopeless task that may leave the user<br> * puzzled. To get all of the needed information use<br> * solver_findallproblemrules() instead.</div><div><br></div><div>So I ended up patching opkg to call the latter (patch below), yielding the following output:</div><div><br></div><div><div><li class="gmail-li1"><div class="gmail-de1">* Problem 1/2:</div></li>
<div class="gmail-de1"> * - package packagegroup-core-boot-1.0-r17.6.shadow_ghost requires sysvinit, but none of the providers can be installed</div>
<div class="gmail-de1"> * - complete list of reasons:</div>
<div class="gmail-de1"> * - package sysvinit-2.88dsf-r14.6.aarch64 requires sysvinit-inittab, but none of the providers can be installed</div>
<div class="gmail-de2"> * - package packagegroup-core-boot-1.0-r17.6.shadow_ghost requires sysvinit, but none of the providers can be installed</div>
<div class="gmail-de1"> * - package sysvinit-inittab-2.88dsf-r10.16.shadow_ghost requires o-usb, but none of the providers can be installed</div>
<div class="gmail-de1"> * - conflicting requests</div>
<div class="gmail-de1"> * - nothing provides openssl11 >= 1.1.0i needed by o-usb-0.0.0+git6+2c2d1e6fe3-r1.7.aarch64</div>
<div class="gmail-de1"> * </div>
<div class="gmail-de2"> * Solution 1:</div>
* - do not ask to install a package providing packagegroup-core-boot</div><br></div><div>Here I do find the expected information (openssl11 was a hack I hadded in sumo, which poluted my first warrior builds, thus polluted my shard-state, as there were 2 providers of this libssl soversion). So now I can solve my problem.</div><div><br></div><div>Where do we go from now ? I'd argue libsolv selects the wrong message, but its doc does say this API asks for the impossible, so we may not want to spend time fixing it.</div><div>Is it reasonable to include the full list of reasons, maybe flagging those that solver_findproblemrule() think are the most relevant ?<br>Or should this be seen as "extended diag" and conditioned by a new opkg flag, maybe for backward-compatibility of some sort ?</div><div>It may make sense to push a function like this to libsolv itself ?<br></div><div><br></div><div><br></div><div>@@ -0,0 +1,38 @@<br>+Index: opkg-0.4.0/libopkg/solvers/libsolv/opkg_solver_libsolv.c<br>+===================================================================<br>+--- opkg-0.4.0.orig/libopkg/solvers/libsolv/opkg_solver_libsolv.c<br>++++ opkg-0.4.0/libopkg/solvers/libsolv/opkg_solver_libsolv.c<br>+@@ -795,6 +795,25 @@ static void libsolv_solver_add_job(libso<br>+ }<br>+ }<br>+ <br>++static libsolv_print_all_problem_rules(libsolv_solver_t *libsolv_solver, Id problem)<br>++{<br>++ Queue rules;<br>++ int i;<br>++<br>++ opkg_message(ERROR, " - complete list of reasons:\n");<br>++ queue_init(&rules);<br>++ solver_findallproblemrules(libsolv_solver->solver, problem, &rules);<br>++ for (i = 0; i < rules.count; i++) {<br>++ Id type, source, target, dep;<br>++ Id r = rules.elements[i];<br>++ type = solver_ruleinfo(libsolv_solver->solver, r, &source, &target, &dep);<br>++ opkg_message(ERROR, " - %s\n",<br>++ solver_problemruleinfo2str(libsolv_solver->solver,<br>++ type, source, target, dep));<br>++ }<br>++ queue_free(&rules);<br>++}<br>++<br>+ static int libsolv_solver_solve(libsolv_solver_t *libsolv_solver)<br>+ {<br>+ int problem_count = solver_solve(libsolv_solver->solver,<br>+@@ -810,6 +829,7 @@ static int libsolv_solver_solve(libsolv_<br>+ opkg_message(ERROR, "Problem %d/%d:\n", problem, problem_count);<br>+ opkg_message(ERROR, " - %s\n",<br>+ solver_problem2str(libsolv_solver->solver, problem));<br>++ libsolv_print_all_problem_rules(libsolv_solver, problem);<br>+ opkg_message(ERROR, "\n");<br>+ <br>+ int solution_count = solver_solution_count(libsolv_solver->solver,</div><div><br></div><div>-- <br><div dir="ltr" class="gmail_signature" data-smartmail="gmail_signature">Yann Dirson <<a href="mailto:yann@blade-group.com" target="_blank">yann@blade-group.com</a>><br>Blade / Shadow -- <a href="http://shadow.tech" target="_blank">http://shadow.tech</a><br><br></div></div></div>