Tuesday, November 15, 2016

Finding a valid build order for KDE repositories

KDE has been lately been growing quite a bit in repositories, and it's not always easy to tell what needs to be build before, do i build first kdepim-apps-libs or pimcommon?

A few days ago i was puzzled by the same question and realized we have the answer in the dependency-data-* files from the kde-build-metadata repository.

They define what depends on what so what we need to do is just build a graph with those dependencies and get a valid build order from it.

Thankfully python already has a module for graphs and stuff so build-order.py was not that hard to write.

So say you want to know a valid build order for the stable repositories based on kf5-qt5

Here it is

Note i've been saying *a* valid build order, not *the* valid build order, since there are various orders that are valid since not every repo depends other repos.

Now i wonder, does anyone else find this useful? And if so to which repository do you think i should commit such script?


Michael Pyne said...

I would suggest the kde-build-metadata repository itself, under the tools/ subdirectory... but watch out for the existing script called "list_dependencies"! ;)

Ilya said...

Hello! :)
I wonder if you could possibly add Russian localization package to the Neon repos...

Albert Astals Cid said...

Илья Бизяев: I've no idea, I'm not a Neon contributor.

Albert Astals Cid said...

@Michael: AFAIU list_dependencies is similar but not the same right? I mean it will give you the build order for "one" project, but not the build order for all of them, no?

Michael Pyne said...

@Albert, you're right, you'd have to ask for at least one project to build. When I've been interested in a more global order I used kdesrc-build instead with the --print-modules flag. But even that would need to have a .kdesrc-buildrc asking for *all* KDE modules, so this is good for pushing the state of the art. Maybe it could be a periodic check run on the build.kde.org infrastructure to make sure there's no accidental build cycles or impossible deps.