Closed douglas-raillard-arm closed 4 months ago
Fixed unwanted error logging when using Target.has()
to avoid littering WA output with:
ERROR Module "hotplug" failed to install on target: Module "hotplug" is not supported by the target
Note that Target.has()
still has to try to load the module, as only that can tell if the target supports the module or not. If the users want to speedup that process, devlib
allows forcefully disabling a module no matter what, so I suppose WA could expose such deny list in its config.
PR updated to import devlib.module
submodules in case a Module is not found to match the previous behavior. Otherwise, people would need explicit import
statement to make the relevant classes available for auto-loading.
@marcbonnici Any update on this one ? AFAIR the last update to the PR fixed the outstanding issues.
(last push is just a rebase on current master, there was no conflict to solve)
@marcbonnici PR updated:
Cleanup module code to improve robustness, modularity and enable lazy loading of modules.
The main features are:
Target(modules=...)
anymore to be used. They can simply be accessed and that will load them lazily. PassingTarget(modules=[{mod: None}])
will prevent loading of the module in all circumstances, including lazily.For now, modules passed to
Target(modules=...)
will be eagerly loaded, but that could be changed quite easily to enable full lazy loading if we wanted.On top of that, the list of default modules is made empty. This fixes https://github.com/ARM-software/devlib/issues/611 as nothing will be loaded by default, but existing code will keep working thanks to lazy loading.