[v2] build: check drivers class dependencies early
Checks
Commit Message
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@redhat.com>
Acked-by: Morten Brørup <mb@smartsharesystems.com>
---
Changes since v1:
- added break on the first missing dependency,
- added logs for disabled drivers,
---
drivers/meson.build | 19 +++++++++++++++++++
1 file changed, 19 insertions(+)
Comments
On Tue, Aug 01, 2023 at 03:41:33PM +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@redhat.com>
> Acked-by: Morten Brørup <mb@smartsharesystems.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
On Tue, Aug 01, 2023 at 03:01:31PM +0100, Bruce Richardson wrote:
> On Tue, Aug 01, 2023 at 03:41:33PM +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@redhat.com>
> > Acked-by: Morten Brørup <mb@smartsharesystems.com>
> Acked-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Tyler Retzlaff <roretzla@linux.microsoft.com>
On Tue, Aug 1, 2023 at 3:41 PM David Marchand <david.marchand@redhat.com> 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@redhat.com>
> Acked-by: Morten Brørup <mb@smartsharesystems.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Tyler Retzlaff <roretzla@linux.microsoft.com>
Applied, thanks.
Bruce, could you rebase your series marking more libraries optional?
There is some conflicts after removal of kni/flow_classify, and adding
a unit test (perf reasm).
On Tue, Aug 08, 2023 at 09:43:25AM +0200, David Marchand wrote:
> On Tue, Aug 1, 2023 at 3:41 PM David Marchand <david.marchand@redhat.com> 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@redhat.com>
> > Acked-by: Morten Brørup <mb@smartsharesystems.com>
> Acked-by: Bruce Richardson <bruce.richardson@intel.com>
> Acked-by: Tyler Retzlaff <roretzla@linux.microsoft.com>
>
> Applied, thanks.
>
> Bruce, could you rebase your series marking more libraries optional?
> There is some conflicts after removal of kni/flow_classify, and adding
> a unit test (perf reasm).
>
Yes, I plan to do so. However, I think I'd rather defer that set until
after the set reworking the build of the tests completely. It makes
everything a lot simpler in that regard. In fact, I may merge the two sets
into one.
/Bruce
@@ -70,6 +70,25 @@ 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
+ reason = 'missing internal dependency, "@0@"'.format(d)
+ if dpdk_libs_deprecated.contains(d)
+ reason += ' (deprecated lib)'
+ endif
+ message('Disabling @1@/* drivers: missing internal dependency "@0@"'
+ .format(d, class))
+ break
+ endif
+ endforeach
+ if skip_class
+ drv_path = join_paths(class, '*')
+ dpdk_drvs_disabled += drv_path
+ set_variable(drv_path.underscorify() + '_disable_reason', reason)
+ continue
+ endif
endif
# save class name on first occurrence