@psabata and I have discussed this a few times on the public IRC channel, but I was thinking about it some more this morning and I wanted to get my thoughts down in a ticket.
What I'd like to see in MBS is the ability for it to follow roughly the following algorithm:
On success, the final buildorder values that allowed all the packages to succeed will be reported back to the user, so the modulemd YAML can be updated (this might also be automated, but that's out of scope for this ticket).
This will allow users to submit a module the first time and let MBS figure out the complexities of the buildorder values. Unlike the original version I discussed with @psabata, this will also handle cases where a dependency ordering changes out from under the module owner. The build will still succeed and they will be told what values to adjust so that their subsequent builds will complete faster.
Pros:
Cons:
I always imagined this like some extra endpoint which would build a module like you describe and as a result, it would give you the modulemd with buildorder with which the module build succeeded. You would then review that, commit it to your repo and build it.
I don't see a way how this could be done everytime on every build you submit.
Note that I also think this could easily be external tool just calling MBS and reading the info about failed builds.
I would like to make some note that you don't need to check whether it fails or not, you just need to try resolve dependencies... because otherwise it could take ages.
So let me explain how OBS does this.. It has concept of few states: * unresolvable * failed * building * succeeded
so unresolvable means that dependencies are not satisfied.. I think MBS could do something like this.. But please don't rely on failing builds from koji/copr.. It is slow and unreliable.
@ngompa can correct me about OBS implementation.
Corresponding issue in fedmod looking at the question of how to derive a plausible build order based on declared build requirements: https://pagure.io/modularity/fedmod/issue/48
fedmod
I think we need that buildorder only in one place, preferably in MBS as that's where all the modules need to pass through.
Buildorder in fedmod can only be a short term solution until MBS gains this ability.
Anything that relies on failing builds works slightly badly for the Flatpak use case.
In the Flatpak use case, we are taking applications and their library dependencies from the main Fedora package set, and rebuilding them with prefix=/app. All the build requirements will already be in the main package set, so likely any build order will succeed.
But the application (or libraries) may end up being build against the -devel packages from the main package rather than the new rebuild -devel packages. 99% of the time this is OK. An example of where it wouldn't work would be, if hypothetically the gdk-pixbuf and librsvg2 were included in the module, then librsvg2 would do:
pkg-config --variable=gdk_pixbuf_moduledir gdk-pixbuf-2.0
And install it's image format loader in the wrong place if built before gdk-pixbuf-2.0. (gdk-pixbuf and librsvg will actually be in the runtime, so not end up in Flatpak modules, but this shows a potential type of problem.)
And even if no problems show up, you won't end up with a sensible build order in any case.
This issue has been migrated to Fedora Forge: https://forge.fedoraproject.org/koji/mbs/issues/715
Please continue any further discussion there.