`Module` configuration/installation issues
marcbonnici opened this issue · comments
We currently have no method of specifying dependencies for modules, this can result in them failing to initialise due to an incorrect ordering. Therefore we need to introduce a dependency mechanism to determine if a required module is going to be installed at a later time or whether an error needs to be thrown.
Another issue is there are currently multiple ways of supplying configuration for a module which can conflict. For example a flashing module can be partially configured via the Platform
and via user entered module configuration and the priority of which configuration is not clear.
FWIW the problem is somewhat solved in LISA by loading them on demand whenever the attribute is accessed:
https://github.com/ARM-software/lisa/blob/master/lisa/target.py#L340
This could also be easily exposed on a dedicated proxy object like target.lazy_module.sched
in case you want to preserve target.sched
behavior.
Note that this won't solve problems across module types, in case they need to be initialized in more than one batch (like if a regular module that wants to depend on a setup module, since the setup module would need to be initialized way earlier).