conandeps: sort dependencies by level of indirection

Record each package's shortest distance from the consumer while collecting
the graph (1 = direct) and order the dependency table direct-first, then by
increasing depth, alphabetically within a level; the kind column now reads
"indirect (N)". Fixture gains a depth-3 package (libdeep under libbar) and
a test pins the ordering.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EYNdaGDrpaqDyT8QtrTQbM
This commit is contained in:
Ole-Morten Duesund 2026-08-25 15:29:46 +02:00
commit d44abc43ef
3 changed files with 82 additions and 15 deletions

View file

@ -92,12 +92,12 @@ profile: arch=x86_64, compiler=gcc, compiler.libcxx=libstdc++11, compiler.versio
Dependencies (4) and binary availability
package kind ctx Release Debug RelWithDebInfo
----------------------------------------------------------
MyDepA/1.0 direct host knor knor knor
boost/1.8 indirect host knor knor knor
MyDepB/1.0 direct host knor knor knor
Zigma/1.0 indirect host knor knor MISSING
package kind ctx Release Debug RelWithDebInfo
--------------------------------------------------------------
MyDepA/1.0 direct host knor knor knor
MyDepB/1.0 direct host knor knor knor
boost/1.8 indirect (2) host knor knor knor
Zigma/1.0 indirect (2) host knor knor MISSING
Missing binaries (1)
@ -127,7 +127,11 @@ environment variable turns that off, and redirecting stdout to a file never
produces colour codes unless you pass `--color always`. The HTML report uses
the same colour coding.
Reading the table:
Reading the table: rows are sorted with direct dependencies first
(alphabetically), then indirect ones by increasing level of indirection
`indirect (2)` is required by a direct dependency, `indirect (3)` by one of
those, and so on (shortest path counts).
* `knor` (a remote name) the remote has a binary for the package_id your
profile produces. Hover a cell in the HTML report to see the package_id.