[RFC PATCH 12/12] build: simplify mandatory library lists

Bruce Richardson bruce.richardson at intel.com
Fri Oct 16 12:59:50 CEST 2026


Rather than listing out all the libraries we think need to be built,
let's just have a minimal set that are necessary to build the minimal
set of drivers. Use the existing dependency resolution script to build
that minimal required library and driver set.

This change necessitates a change to test-meson-builds.sh since ethdev
is no longer in the always-required set, meaning that a minimal build
will error out if net/null is added as a required driver.

Signed-off-by: Bruce Richardson <bruce.richardson at intel.com>

---
The change to test-meson-builds.sh will cause issues for anyone who is
using an already-configured set of build directories, as the script does
not attempt any reconfiguration. For now, to avoid any potential testing
issues, I've side-stepped the issue by adjusting the directory name from
build-mini to build-minimal. This will configure a new directory rather
than reusing the old one with the broken config.
---
 devtools/test-meson-builds.sh |  3 +--
 drivers/meson.build           |  8 ++++----
 lib/meson.build               | 22 ++++------------------
 meson.build                   | 13 +++++++++++++
 4 files changed, 22 insertions(+), 24 deletions(-)

diff --git a/devtools/test-meson-builds.sh b/devtools/test-meson-builds.sh
index 501034f398..9128d6bda7 100755
--- a/devtools/test-meson-builds.sh
+++ b/devtools/test-meson-builds.sh
@@ -249,8 +249,7 @@ for c in gcc clang ; do
 	done
 done
 
-build build-mini cc skipABI $use_shared -Ddisable_libs=* \
-	-Denable_drivers=net/null
+build build-minimal cc skipABI $use_shared -Ddisable_libs=*
 
 # test compilation with minimal x86 instruction set
 # Set the install path for libraries to "lib" explicitly to prevent problems
diff --git a/drivers/meson.build b/drivers/meson.build
index aacfe29c46..29b473eb04 100644
--- a/drivers/meson.build
+++ b/drivers/meson.build
@@ -79,10 +79,10 @@ foreach d:requested_drivers
 endforeach
 require_drivers = requested_drivers.length() != 0
 
-# these drivers must always be enabled, otherwise the build breaks
-always_enable = ['bus/pci', 'bus/vdev']
-# we always need a mempool driver, and ring is default, so make it mandatory
-always_enable += ['mempool/ring']
+# these drivers must always be enabled, otherwise the build breaks; the
+# full set, including their own dependencies, is computed once at the top
+# level
+always_enable = dpdk_min_required_drivers
 
 # expand the requested drivers to also include the drivers they depend on; with
 # no drivers requested every driver is wanted, so no list is needed
diff --git a/lib/meson.build b/lib/meson.build
index 34fbd93977..e4998d1090 100644
--- a/lib/meson.build
+++ b/lib/meson.build
@@ -70,24 +70,10 @@ libraries = [
         'node',
 ]
 
-always_enable = [
-        'argparse',
-        'cmdline',
-        'eal',
-        'ethdev',
-        'hash',
-        'kvargs',
-        'log',
-        'mbuf',
-        'mempool',
-        'meter',
-        'net',
-        'pci',
-        'rcu',
-        'ring',
-        'stack',
-        'telemetry',
-]
+# these libraries must always be enabled, otherwise the build breaks; the
+# full set, including their own dependencies, is computed once at the top
+# level, from the libraries that the mandatory drivers need
+always_enable = dpdk_min_required_libs
 
 enable_deprecated_libs = []
 foreach l:run_command(list_dir_globs, get_option('enable_deprecated_libs'),
diff --git a/meson.build b/meson.build
index 4536f7e9c5..8d31230528 100644
--- a/meson.build
+++ b/meson.build
@@ -96,6 +96,19 @@ dpdk_deps_graph = configure_file(
         capture: true,
         output: 'dependencies.txt')
 
+# these drivers must always be enabled, otherwise the build breaks: a PCI bus
+# driver, a vdev bus driver, and a mempool driver, with ring as the default
+dpdk_min_required_driver_paths = ['bus/pci', 'bus/vdev', 'mempool/ring']
+
+# the mandatory drivers' own dependencies are mandatory too, as are the
+# libraries they need, so none of them can be left out of the build
+dpdk_min_required_drivers = run_command(resolve_deps_cmd, dpdk_deps_graph,
+        '--drivers', dpdk_min_required_driver_paths,
+        check: true).stdout().strip().split(',')
+dpdk_min_required_libs = run_command(resolve_deps_cmd, dpdk_deps_graph,
+        '--libs', dpdk_min_required_driver_paths,
+        check: true).stdout().strip().split(',')
+
 # build libs and drivers
 subdir('lib')
 subdir('drivers')
-- 
2.53.0



More information about the dev mailing list