DPDK patches and discussions
 help / color / mirror / Atom feed
From: Stephen Hemminger <stephen@networkplumber.org>
To: Bruce Richardson <bruce.richardson@intel.com>
Cc: "Morten Brørup" <mb@smartsharesystems.com>, dev@dpdk.org
Subject: Re: [PATCH v3 3/3] build: RFC - add support for optional dependencies
Date: Fri, 4 Oct 2024 13:59:48 -0700	[thread overview]
Message-ID: <20241004135948.590b6744@hermes.local> (raw)
In-Reply-To: <ZYMLqAiI5F5kF6-F@bricha3-MOBL.ger.corp.intel.com>

On Wed, 20 Dec 2023 15:43:36 +0000
Bruce Richardson <bruce.richardson@intel.com> wrote:

> On Wed, Dec 20, 2023 at 04:08:08PM +0100, Morten Brørup wrote:
> > > From: Bruce Richardson [mailto:bruce.richardson@intel.com]
> > > Sent: Wednesday, 20 December 2023 15.22
> > > 
> > > In order to remove more libraries from the mandatory list, we need to
> > > have support for optionally having a dependency from a driver or
> > > library
> > > to another driver or lib. This patch adds this support by adding a new
> > > optional_deps variable, the contents of which are added to the deps
> > > list
> > > if those optional dependencies are present in the build.
> > > 
> > > Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
> > > ---
> > >  drivers/meson.build | 7 +++++++
> > >  lib/meson.build     | 7 +++++++
> > >  2 files changed, 14 insertions(+)
> > > 
> > > diff --git a/drivers/meson.build b/drivers/meson.build
> > > index 5ba534049a..af2d8da5a8 100644
> > > --- a/drivers/meson.build
> > > +++ b/drivers/meson.build
> > > @@ -127,6 +127,7 @@ foreach subpath:subdirs
> > >          includes = [include_directories(drv_path)]
> > >          # set up internal deps. Drivers can append/override as
> > > necessary
> > >          deps = std_deps
> > > +        optional_deps = []  
> > 
> > (I'm a meson noob, so please bear with my stupid questions.)
> > 
> > Is a separate "optional_deps" necessary? If a driver has any of these dependencies, why can it not just add them to the "deps" in the driver's meson.build file?
> > 
> > Ohhh... It's the other way around: The driver only depends on the other (optional) lib if that other lib is enabled! Correct?
> >   
> Yes, it's a shortcut to save an app having to manually check for its
> optional dependency itself in the meson.build file.
> 
> However, this is only really useful if it's an optional dependency where we
> just have #ifdefs in the C code for it. For the initial example I was
> thinking of to try and use it - meter lib in ethdev - something that simple
> is not enough. So long as there are extra C files or headers that need to
> be built when a dependency is present, we need to change the meson.build
> file to explicitly check anyway. Hence it's only an RFC until such time as
> we find a use-case or two that uses it.

Reasonable solution, but it hasn't been an issue for anything so far over a  year.
Marking it as "Awaiting upstream" since if a feature needs this, then use this.

  reply	other threads:[~2024-10-04 20:59 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-11-03 16:28 [PATCH 24.03] build: track mandatory rather than optional libs Bruce Richardson
2023-11-03 16:52 ` [PATCH 24.03 v2] " Bruce Richardson
2023-11-03 17:31   ` Morten Brørup
2023-11-03 18:08     ` Bruce Richardson
2023-11-03 20:19       ` Morten Brørup
2023-11-06 10:28         ` Bruce Richardson
2023-11-06 11:22           ` Morten Brørup
2023-11-06 11:27             ` Bruce Richardson
2023-11-06 11:37               ` Morten Brørup
2023-12-20 14:21 ` [PATCH v3 0/3] Improve optional lib support Bruce Richardson
2023-12-20 14:21   ` [PATCH v3 1/3] build: track mandatory rather than optional libs Bruce Richardson
2023-12-20 14:21   ` [PATCH v3 2/3] build: remove 5 libs from mandatory list Bruce Richardson
2023-12-20 15:18     ` Morten Brørup
2023-12-20 16:05       ` Bruce Richardson
2023-12-20 14:21   ` [PATCH v3 3/3] build: RFC - add support for optional dependencies Bruce Richardson
2023-12-20 15:08     ` Morten Brørup
2023-12-20 15:43       ` Bruce Richardson
2024-10-04 20:59         ` Stephen Hemminger [this message]
2024-02-01  9:23   ` [PATCH v3 0/3] Improve optional lib support David Marchand
2024-02-01  9:25     ` 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=20241004135948.590b6744@hermes.local \
    --to=stephen@networkplumber.org \
    --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).