DPDK patches and discussions
 help / color / mirror / Atom feed
From: David Marchand <david.marchand@redhat.com>
To: dev@dpdk.org
Cc: bruce.richardson@intel.com, "Morten Brørup" <mb@smartsharesystems.com>
Subject: [PATCH v2] build: check drivers class dependencies early
Date: Tue,  1 Aug 2023 15:41:33 +0200	[thread overview]
Message-ID: <20230801134133.2860104-1-david.marchand@redhat.com> (raw)
In-Reply-To: <20230801085253.2447095-1-david.marchand@redhat.com>

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(+)

diff --git a/drivers/meson.build b/drivers/meson.build
index 74ae8cb96b..c909070c30 100644
--- a/drivers/meson.build
+++ b/drivers/meson.build
@@ -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
-- 
2.41.0


  parent reply	other threads:[~2023-08-01 13:41 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-08-01  8:52 [PATCH] " David Marchand
2023-08-01  9:25 ` Bruce Richardson
2023-08-01 10:20   ` David Marchand
2023-08-01 10:35     ` Bruce Richardson
2023-08-01 10:49     ` Morten Brørup
2023-08-01 11:04       ` Morten Brørup
2023-08-01 13:41 ` David Marchand [this message]
2023-08-01 14:01   ` [PATCH v2] " Bruce Richardson
2023-08-02 16:11     ` Tyler Retzlaff
2023-08-08  7:43   ` David Marchand
2023-08-08  8:07     ` Bruce Richardson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230801134133.2860104-1-david.marchand@redhat.com \
    --to=david.marchand@redhat.com \
    --cc=bruce.richardson@intel.com \
    --cc=dev@dpdk.org \
    --cc=mb@smartsharesystems.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).