[24.03] build: track mandatory rather than optional libs

Message ID 20231103162830.593702-1-bruce.richardson@intel.com (mailing list archive)
State Superseded, archived
Delegated to: Thomas Monjalon
Headers
Series [24.03] build: track mandatory rather than optional libs |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/loongarch-compilation success Compilation OK
ci/loongarch-unit-testing success Unit Testing PASS
ci/Intel-compilation success Compilation OK
ci/intel-Testing success Testing PASS
ci/iol-intel-Performance success Performance Testing PASS
ci/iol-mellanox-Performance success Performance Testing PASS
ci/iol-broadcom-Functional success Functional Testing PASS
ci/iol-intel-Functional success Functional Testing PASS
ci/iol-compile-amd64-testing success Testing PASS
ci/intel-Functional success Functional PASS
ci/iol-broadcom-Performance success Performance Testing PASS
ci/iol-unit-amd64-testing success Testing PASS
ci/iol-unit-arm64-testing success Testing PASS
ci/iol-sample-apps-testing success Testing PASS
ci/iol-compile-arm64-testing success Testing PASS

Commit Message

Bruce Richardson Nov. 3, 2023, 4:28 p.m. UTC
  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

David Marchand Feb. 1, 2024, 9:23 a.m. UTC | #1
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.
  
Bruce Richardson Feb. 1, 2024, 9:25 a.m. UTC | #2
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
  

Patch

diff --git a/lib/meson.build b/lib/meson.build
index 6c143ce5a6..2dd2ee7262 100644
--- a/lib/meson.build
+++ b/lib/meson.build
@@ -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']