Sort module variants before running singletons
With VoD, the module group order can become unstable when the on-demand
variants are added to module group. This has been previously fixed by
doing a sort at the end of the mutator where the on-demand variants are
created.
This runs into some issues with image mutator since the on-demand
variants need to be carefully inserted before normal variants to prevent
circular dep errors. As an example, the expected module order for rust in
recovery modules is
```
- (vendor,rlib-core)
- (vendor,rlib-std)
- (recovery,rlib-core)
- (recovery,rlib-std)
```
If (1) is created by the primary split and the rest are created by VoD,
there are no cicular dep errors
If (1) and (3) are created by the primary split (e.g. for prebuilts),
and the rest are created by VoD, there are some circular dep errors.
To resolve this, the sorting is moved to before the singleton runs.
Bug: 448182248
Test: With ag/38840861 and RELEASE_SOONG_IMAGE_VARIANT_ON_DEMAND set to
true locally
Test: m nothing && touch Android.bp && m nothing
Test: gqui out/soong_build_metrics.pb
Test: verified 100% singleton cache hit
Change-Id: I74ad4d0dbc0081b92a4cca2212b05f104a28dbfc
1 file changed