<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&#39;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 &gt;= 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&#39;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 &quot;extended diag&quot; 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, &quot;  - complete list of reasons:\n&quot;);<br>++    queue_init(&amp;rules);<br>++    solver_findallproblemrules(libsolv_solver-&gt;solver, problem, &amp;rules);<br>++    for (i = 0; i &lt; rules.count; i++) {<br>++        Id type, source, target, dep;<br>++        Id r = rules.elements[i];<br>++        type = solver_ruleinfo(libsolv_solver-&gt;solver, r, &amp;source, &amp;target, &amp;dep);<br>++        opkg_message(ERROR, &quot;    - %s\n&quot;,<br>++                     solver_problemruleinfo2str(libsolv_solver-&gt;solver,<br>++                                                type, source, target, dep));<br>++    }<br>++    queue_free(&amp;rules);<br>++}<br>++<br>+ static int libsolv_solver_solve(libsolv_solver_t *libsolv_solver)<br>+ {<br>+     int problem_count = solver_solve(libsolv_solver-&gt;solver,<br>+@@ -810,6 +829,7 @@ static int libsolv_solver_solve(libsolv_<br>+             opkg_message(ERROR, &quot;Problem %d/%d:\n&quot;, problem, problem_count);<br>+             opkg_message(ERROR, &quot;  - %s\n&quot;,<br>+                          solver_problem2str(libsolv_solver-&gt;solver, problem));<br>++            libsolv_print_all_problem_rules(libsolv_solver, problem);<br>+             opkg_message(ERROR, &quot;\n&quot;);<br>+ <br>+             int solution_count = solver_solution_count(libsolv_solver-&gt;solver,</div><div><br></div><div>-- <br><div dir="ltr" class="gmail_signature" data-smartmail="gmail_signature">Yann Dirson &lt;<a href="mailto:yann@blade-group.com" target="_blank">yann@blade-group.com</a>&gt;<br>Blade / Shadow -- <a href="http://shadow.tech" target="_blank">http://shadow.tech</a><br><br></div></div></div>