[24.03] build: track mandatory rather than optional libs
Checks
Commit Message
DPDK now has more optional libraries than mandatory ones, so invert the
list stored in the meson.build file from the optional ones to the
"always_enable" ones. As well as being a shorter list:
* we can remove the loop building up the "always_enable" list
dynamically from the optional list
* it better aligns with the drivers/meson.build file which maintains an
always_enable list.
Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
---
lib/meson.build | 70 +++++++++++++++++--------------------------------
1 file changed, 24 insertions(+), 46 deletions(-)
Comments
On Wed, Dec 20, 2023 at 3:22 PM Bruce Richardson
<bruce.richardson@intel.com> wrote:
>
> This patchset builds on the previous v1 and v2, and the discussion
> which followed about what libraries should be optional. While still
> a long way to go from the position suggested in the v2 discussion,
> this set moves us a bit further along the road.
>
> The first patch is a direct v3 from previous versions, changing the
> tracking from a list of optional libs to a list of mandatory ones.
> The second patch then knocks off another 5 libs off the mandatory
> list - all are libs which should have few dependencies in other
> components, but which some common sample apps like l3fwd depend upon.
> It should be possible to make other libs optional in future, but to
> do so likely requires code-changes to #ifdef out support in places.
>
> To that end, patch 3 is an RFC to add support for "optional libs" to
> the build system. For now, nothing uses this, but it may be useful if
> someone does want to take on the task of removing a hard dependency
> from one component on another and making it optional.
>
> Bruce Richardson (3):
> build: track mandatory rather than optional libs
> build: remove 5 libs from mandatory list
> build: RFC - add support for optional dependencies
I was not sure if I should take the third patch, but the two others
make sense to me and I applied them.
The third one can be reconsidered when the need arises.
Thanks Bruce.
On Thu, Feb 01, 2024 at 10:23:40AM +0100, David Marchand wrote:
> On Wed, Dec 20, 2023 at 3:22 PM Bruce Richardson
> <bruce.richardson@intel.com> wrote:
> >
> > This patchset builds on the previous v1 and v2, and the discussion
> > which followed about what libraries should be optional. While still
> > a long way to go from the position suggested in the v2 discussion,
> > this set moves us a bit further along the road.
> >
> > The first patch is a direct v3 from previous versions, changing the
> > tracking from a list of optional libs to a list of mandatory ones.
> > The second patch then knocks off another 5 libs off the mandatory
> > list - all are libs which should have few dependencies in other
> > components, but which some common sample apps like l3fwd depend upon.
> > It should be possible to make other libs optional in future, but to
> > do so likely requires code-changes to #ifdef out support in places.
> >
> > To that end, patch 3 is an RFC to add support for "optional libs" to
> > the build system. For now, nothing uses this, but it may be useful if
> > someone does want to take on the task of removing a hard dependency
> > from one component on another and making it optional.
> >
> > Bruce Richardson (3):
> > build: track mandatory rather than optional libs
> > build: remove 5 libs from mandatory list
> > build: RFC - add support for optional dependencies
>
> I was not sure if I should take the third patch, but the two others
> make sense to me and I applied them.
> The third one can be reconsidered when the need arises.
>
Yep, agreed. Thanks.
/Bruce
@@ -75,52 +75,29 @@ if is_ms_compiler
]
endif
-optional_libs = [
- 'bbdev',
- 'bitratestats',
- 'bpf',
- 'cfgfile',
- 'compressdev',
- 'cryptodev',
- 'dispatcher',
- 'distributor',
- 'dmadev',
- 'efd',
- 'eventdev',
- 'gpudev',
- 'graph',
- 'gro',
- 'gso',
- 'ip_frag',
- 'ipsec',
- 'jobstats',
- 'latencystats',
- 'member',
- 'metrics',
- 'mldev',
- 'node',
- 'pcapng',
- 'pdcp',
- 'pdump',
- 'pipeline',
- 'port',
- 'power',
- 'rawdev',
- 'regexdev',
- 'reorder',
- 'sched',
- 'security',
- 'table',
- 'vhost',
+always_enable = [
+ 'log',
+ 'kvargs',
+ 'telemetry',
+ 'eal',
+ 'ring',
+ 'rcu',
+ 'mempool',
+ 'mbuf',
+ 'net',
+ 'meter',
+ 'ethdev',
+ 'pci',
+ 'cmdline',
+ 'hash',
+ 'timer',
+ 'acl',
+ 'lpm',
+ 'rib',
+ 'stack',
+ 'fib'
]
-always_enable = []
-foreach l:libraries
- if not optional_libs.contains(l)
- always_enable += l
- endif
-endforeach
-
enable_deprecated_libs = []
foreach l:run_command(list_dir_globs, get_option('enable_deprecated_libs'),
check: true).stdout().split()
@@ -136,9 +113,10 @@ enable_libs = run_command(list_dir_globs, get_option('enable_libs'), check: true
require_libs = true
if enable_libs.length() == 0
require_libs = false
- enable_libs += optional_libs
+ enable_libs = libraries
+else
+ enable_libs += always_enable
endif
-enable_libs += always_enable
default_cflags = machine_args
default_cflags += ['-DALLOW_EXPERIMENTAL_API']