[PATCH] build: check drivers class dependencies early
Bruce Richardson
bruce.richardson at intel.com
Tue Aug 1 11:25:16 CEST 2023
On Tue, Aug 01, 2023 at 10:52:53AM +0200, David Marchand wrote:
> Drivers implementing a class of devices (for example, drivers/event)
> depend on the associated abstraction library (lib/eventdev).
> This dependency is expressed in the top level meson.build for this class
> (drivers/event/meson.build).
>
> As we are making more libraries optional, custom constructs referencing
> the class dependencies in some drivers meson.build (event/dlb2) may break.
>
> It would be possible to add more checks in those drivers meson.build but
> it is more straightforward to not even consider a driver meson.build when
> the class dependencies are not met.
>
> Signed-off-by: David Marchand <david.marchand at redhat.com>
> ---
> drivers/meson.build | 11 +++++++++++
> 1 file changed, 11 insertions(+)
>
> diff --git a/drivers/meson.build b/drivers/meson.build
> index 74ae8cb96b..c375352e77 100644
> --- a/drivers/meson.build
> +++ b/drivers/meson.build
> @@ -70,6 +70,17 @@ foreach subpath:subdirs
> else
> class = subpath
> subdir(class)
> + skip_class = false
> + foreach d:std_deps
> + if not is_variable('shared_rte_' + d)
> + skip_class = true
> + message('Disabling all @1@ drivers: missing internal dependency "@0@"'
> + .format(d, class))
> + endif
> + endforeach
> + if skip_class
> + continue
> + endif
> endif
>
> # save class name on first occurrence
I like this approach. However, we do need something in the summary at the
end of the build too. Either:
* Single message stating all drivers of a given class are skipped
* (as now), message for each driver stating that it has been disabled
The former is nice as it gives us a shorter summary. The latter is nice
because it's consistent with what we have now. Authors choice, which to go
for! :-)
Thanks.
/Bruce
More information about the dev
mailing list