DPDK-dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [RFC PATCH 00/12] Add config-time dependency tracking
@ 2026-10-16 10:59 Bruce Richardson
  2026-10-16 10:59 ` [RFC PATCH 01/12] build: fix name of base library object Bruce Richardson
                   ` (12 more replies)
  0 siblings, 13 replies; 17+ messages in thread
From: Bruce Richardson @ 2026-10-16 10:59 UTC (permalink / raw)
  To: dev; +Cc: Bruce Richardson

Add configuration time dependency tracking for libs and drivers in DPDK,
so that when a user requests a driver, all dependent drivers also get
enabled. Similarly with libraries. What is not enabled in this RFC is
support for enabling libraries based on driver requests, or enabling
either libs or drivers based on the enable-apps config option. I've
omitted the former for now, because it would involve moving more logic
out of the lib/meson.build file and drivers/meson.build files into the
top-level one, something I'm a little hesitant to do for now. The
addition of apps only adds value once the cross-type dependency tracking
is enabled, since no app depends on any others.

The first 5 patches in this series are cleanups and bug fixes. The
following patches then implement the dependency tracking. While I
investigated having meson parse each components meson.build file
initially, without actually building it, this failed to work due to
logic other than variable assignments in many drivers.

Instead, python scripts are used to manage the dependency list. For
easier debug, and future introspection this dependency management is
split between two scripts - the first generates a dependency table file
which it writes to the build folder, allowing us to analyse this
post-build if so desired. The second script uses this file to actually
compute the necessary per-component dependencies.

The final patch of the series is a major reduction in the number of
required components for doing DPDK builds. We completely remove the list
of required libraries, and assume that a minimal build should only
require enough libraries to build EAL. However, EAL does assume that we
have a few additional buses, for example, EAL args are present for pci
and vdev. Also, in order for mempools to work, we always need to have
the default mempool ring driver build. That means that our de-facto
minimal build target set is the set of components needed to build
"bus/pci,bus/vdev,mempool/ring" (which would include EAL in the output,
which is why we can remove any hard-coded library lists)

Bruce Richardson (12):
  build: fix name of base library object
  build: fix ignoring requested driver when class is disabled
  build: prevent overlap of enable and disable lists
  build: add direct support for optional dependencies
  net/bond: rename directory for consistency
  build: add script to generate dependencies list
  build: use recursive addition for enabled libraries option
  build: use recursive addition for enabled drivers option
  build: improve error reporting for unbuildable components
  build: add EAL common directory to global include list
  build: make EAL an explicit dependency
  build: simplify mandatory library lists

 MAINTAINERS                                   |   2 +-
 app/meson.build                               |  15 +-
 app/proc-info/meson.build                     |   4 +-
 app/test-bbdev/meson.build                    |  18 +-
 app/test-crypto-perf/meson.build              |   4 +-
 app/test-pmd/meson.build                      |  50 ++---
 app/test/meson.build                          |   6 -
 buildtools/get-deps.py                        | 203 ++++++++++++++++++
 buildtools/meson.build                        |   2 +
 buildtools/resolve-deps.py                    |  80 +++++++
 devtools/test-meson-builds.sh                 |   3 +-
 doc/api/doxy-api.conf.in                      |   2 +-
 .../link_bonding_poll_mode_drv_lib.rst        |   2 +-
 doc/guides/testpmd_app_ug/testpmd_funcs.rst   |   2 +-
 drivers/common/mlx5/linux/meson.build         |   1 -
 drivers/meson.build                           |  85 ++++++--
 .../net/{bonding => bond}/bonding_testpmd.c   |   0
 .../eth_bond_8023ad_private.h                 |   0
 .../net/{bonding => bond}/eth_bond_private.h  |   0
 drivers/net/{bonding => bond}/meson.build     |   1 -
 drivers/net/{bonding => bond}/rte_eth_bond.h  |   0
 .../{bonding => bond}/rte_eth_bond_8023ad.c   |   0
 .../{bonding => bond}/rte_eth_bond_8023ad.h   |   0
 .../net/{bonding => bond}/rte_eth_bond_alb.c  |   0
 .../net/{bonding => bond}/rte_eth_bond_alb.h  |   0
 .../net/{bonding => bond}/rte_eth_bond_api.c  |   0
 .../net/{bonding => bond}/rte_eth_bond_args.c |   0
 .../net/{bonding => bond}/rte_eth_bond_flow.c |   0
 .../net/{bonding => bond}/rte_eth_bond_pmd.c  |   0
 drivers/net/intel/ice/meson.build             |   7 +-
 drivers/net/meson.build                       |   2 +-
 lib/acl/meson.build                           |   1 +
 lib/cfgfile/meson.build                       |   1 +
 lib/cryptodev/meson.build                     |   2 +-
 lib/dmadev/meson.build                        |   2 +-
 lib/eal/meson.build                           |   6 +-
 lib/ethdev/meson.build                        |   2 +-
 lib/eventdev/meson.build                      |   1 -
 lib/ipsec/meson.build                         |   2 +-
 lib/jobstats/meson.build                      |   1 +
 lib/log/meson.build                           |   1 -
 lib/mempool/meson.build                       |   2 +-
 lib/meson.build                               |  76 +++----
 lib/meter/meson.build                         |   1 +
 lib/metrics/meson.build                       |   2 +-
 lib/pci/meson.build                           |   1 +
 lib/ptr_compress/meson.build                  |   1 +
 lib/rawdev/meson.build                        |   2 +-
 lib/ring/meson.build                          |   2 +-
 lib/stack/meson.build                         |   1 +
 lib/timer/meson.build                         |   1 +
 meson.build                                   |  21 ++
 52 files changed, 478 insertions(+), 140 deletions(-)
 create mode 100644 buildtools/get-deps.py
 create mode 100644 buildtools/resolve-deps.py
 rename drivers/net/{bonding => bond}/bonding_testpmd.c (100%)
 rename drivers/net/{bonding => bond}/eth_bond_8023ad_private.h (100%)
 rename drivers/net/{bonding => bond}/eth_bond_private.h (100%)
 rename drivers/net/{bonding => bond}/meson.build (95%)
 rename drivers/net/{bonding => bond}/rte_eth_bond.h (100%)
 rename drivers/net/{bonding => bond}/rte_eth_bond_8023ad.c (100%)
 rename drivers/net/{bonding => bond}/rte_eth_bond_8023ad.h (100%)
 rename drivers/net/{bonding => bond}/rte_eth_bond_alb.c (100%)
 rename drivers/net/{bonding => bond}/rte_eth_bond_alb.h (100%)
 rename drivers/net/{bonding => bond}/rte_eth_bond_api.c (100%)
 rename drivers/net/{bonding => bond}/rte_eth_bond_args.c (100%)
 rename drivers/net/{bonding => bond}/rte_eth_bond_flow.c (100%)
 rename drivers/net/{bonding => bond}/rte_eth_bond_pmd.c (100%)

--
2.53.0


^ permalink raw reply	[flat|nested] 17+ messages in thread

* [RFC PATCH 01/12] build: fix name of base library object
  2026-10-16 10:59 [RFC PATCH 00/12] Add config-time dependency tracking Bruce Richardson
@ 2026-10-16 10:59 ` Bruce Richardson
  2026-10-16 10:59 ` [RFC PATCH 02/12] build: fix ignoring requested driver when class is disabled Bruce Richardson
                   ` (11 subsequent siblings)
  12 siblings, 0 replies; 17+ messages in thread
From: Bruce Richardson @ 2026-10-16 10:59 UTC (permalink / raw)
  To: dev; +Cc: Bruce Richardson, stable

The generation of the base code objects, in the case where the base code
needs separate C files, used the lib_name value, but that was not
actually assigned till later in the loop, meaning the name used was for
the previous driver built. Fix this by moving the 3-line block up in the
loop.

Fixes: 8fa3af6c05f8 ("build: add generic support for base code in drivers")
Cc: stable@dpdk.org

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
---
 drivers/meson.build | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/meson.build b/drivers/meson.build
index 102a8262e5..02adf51173 100644
--- a/drivers/meson.build
+++ b/drivers/meson.build
@@ -249,6 +249,10 @@ foreach subpath:subdirs
             continue
         endif
 
+        enabled_drivers += name
+        lib_name = '_'.join(['rte', class, name])
+        dpdk_conf.set(lib_name.to_upper(), 1)
+
         # not all drivers base code is lock annotation safe, so do base code builds before
         # adding on the lock annotation flags. NOTE: If no custom cflags, the lock annotation
         # checks will be done though.
@@ -263,10 +267,6 @@ foreach subpath:subdirs
             sources += base_sources
         endif
 
-        enabled_drivers += name
-        lib_name = '_'.join(['rte', class, name])
-        dpdk_conf.set(lib_name.to_upper(), 1)
-
         if developer_mode and is_windows and use_function_versioning
             message('@0@: Function versioning is not supported by Windows.'.format(name))
         endif
-- 
2.53.0


^ permalink raw reply related	[flat|nested] 17+ messages in thread

* [RFC PATCH 02/12] build: fix ignoring requested driver when class is disabled
  2026-10-16 10:59 [RFC PATCH 00/12] Add config-time dependency tracking Bruce Richardson
  2026-10-16 10:59 ` [RFC PATCH 01/12] build: fix name of base library object Bruce Richardson
@ 2026-10-16 10:59 ` Bruce Richardson
  2026-10-16 10:59 ` [RFC PATCH 03/12] build: prevent overlap of enable and disable lists Bruce Richardson
                   ` (10 subsequent siblings)
  12 siblings, 0 replies; 17+ messages in thread
From: Bruce Richardson @ 2026-10-16 10:59 UTC (permalink / raw)
  To: dev; +Cc: Bruce Richardson, stable

When a whole driver class is disabled due to missing dependencies, we
are silently ignoring the fact that the user may have requested drivers
of that class and therefore that the build configuration should fail.
This can be seen by configuring a build with parameters
"-Denable_drivers=event/sw -Ddisable_libs=eventdev". With eventdev
disabled, all event drivers are never considered and no error from this
misconfiguration results.

Fix this by adding a check for requested drivers when disabling a whole
class of devices.

Fixes: 70b6941e4e22 ("build: check drivers class dependencies early")
Cc: stable@dpdk.org

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
---
 drivers/meson.build | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/drivers/meson.build b/drivers/meson.build
index 02adf51173..b761e19be5 100644
--- a/drivers/meson.build
+++ b/drivers/meson.build
@@ -119,6 +119,14 @@ foreach subpath:subdirs
                 endif
                 message('Disabling @1@/* drivers: missing internal dependency "@0@"'
                         .format(d, class))
+                # error out if a driver in this class was explicitly requested,
+                # i.e. not via wildcard, since it can now never be built.
+                foreach drv_path : get_option('enable_drivers').split(',')
+                    if drv_path.startswith(class + '/')
+                        error('Cannot build explicitly requested driver "@0@".\n'.format(drv_path)
+                                +'\tReason: missing internal dependency "@0@"'.format(d))
+                    endif
+                endforeach
                 break
             endif
         endforeach
-- 
2.53.0


^ permalink raw reply related	[flat|nested] 17+ messages in thread

* [RFC PATCH 03/12] build: prevent overlap of enable and disable lists
  2026-10-16 10:59 [RFC PATCH 00/12] Add config-time dependency tracking Bruce Richardson
  2026-10-16 10:59 ` [RFC PATCH 01/12] build: fix name of base library object Bruce Richardson
  2026-10-16 10:59 ` [RFC PATCH 02/12] build: fix ignoring requested driver when class is disabled Bruce Richardson
@ 2026-10-16 10:59 ` Bruce Richardson
  2026-10-16 10:59 ` [RFC PATCH 04/12] build: add direct support for optional dependencies Bruce Richardson
                   ` (9 subsequent siblings)
  12 siblings, 0 replies; 17+ messages in thread
From: Bruce Richardson @ 2026-10-16 10:59 UTC (permalink / raw)
  To: dev; +Cc: Bruce Richardson

For enable_libs/disable_libs option, and the driver and app equivalents,
detect if a component is in both enable and disable lists and error out
if so.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
---
 app/meson.build     | 5 +++++
 drivers/meson.build | 5 +++++
 lib/meson.build     | 5 +++++
 3 files changed, 15 insertions(+)

diff --git a/app/meson.build b/app/meson.build
index 4515688471..7472d925b2 100644
--- a/app/meson.build
+++ b/app/meson.build
@@ -6,6 +6,11 @@ disable_apps = run_command(list_dir_globs, disable_apps, check: true).stdout().s
 
 enable_apps = ',' + get_option('enable_apps')
 enable_apps = run_command(list_dir_globs, enable_apps, check: true).stdout().split()
+foreach a:enable_apps
+    if disable_apps.contains(a)
+        error('Application "@0@" is in both "enable_apps" and "disable_apps".'.format(a))
+    endif
+endforeach
 require_apps = true
 if enable_apps.length() == 0
     require_apps = false
diff --git a/drivers/meson.build b/drivers/meson.build
index b761e19be5..440c3959cf 100644
--- a/drivers/meson.build
+++ b/drivers/meson.build
@@ -71,6 +71,11 @@ endforeach
 
 disable_drivers = run_command(list_dir_globs, disable_drivers, check: true).stdout().split()
 enable_drivers = run_command(list_dir_globs, enable_drivers, check: true).stdout().split()
+foreach d:enable_drivers
+    if disable_drivers.contains(d)
+        error('Driver "@0@" is in both "enable_drivers" and "disable_drivers".'.format(d))
+    endif
+endforeach
 require_drivers = true
 if enable_drivers.length() == 0
     require_drivers = false
diff --git a/lib/meson.build b/lib/meson.build
index af5c160cb8..0c5da21522 100644
--- a/lib/meson.build
+++ b/lib/meson.build
@@ -101,6 +101,11 @@ endforeach
 disable_libs = run_command(list_dir_globs, get_option('disable_libs'), check: true).stdout().split()
 
 enable_libs = run_command(list_dir_globs, get_option('enable_libs'), check: true).stdout().split()
+foreach l:enable_libs
+    if disable_libs.contains(l)
+        error('Library "@0@" is in both "enable_libs" and "disable_libs".'.format(l))
+    endif
+endforeach
 require_libs = true
 if enable_libs.length() == 0
     require_libs = false
-- 
2.53.0


^ permalink raw reply related	[flat|nested] 17+ messages in thread

* [RFC PATCH 04/12] build: add direct support for optional dependencies
  2026-10-16 10:59 [RFC PATCH 00/12] Add config-time dependency tracking Bruce Richardson
                   ` (2 preceding siblings ...)
  2026-10-16 10:59 ` [RFC PATCH 03/12] build: prevent overlap of enable and disable lists Bruce Richardson
@ 2026-10-16 10:59 ` Bruce Richardson
  2026-10-16 10:59 ` [RFC PATCH 05/12] net/bond: rename directory for consistency Bruce Richardson
                   ` (8 subsequent siblings)
  12 siblings, 0 replies; 17+ messages in thread
From: Bruce Richardson @ 2026-10-16 10:59 UTC (permalink / raw)
  To: dev; +Cc: Bruce Richardson

A number of DPDK components sometimes expose extra capabilities if other
drivers are present, without actually requiring that to be always
present. Standardize that design by way of an "optional_deps" variable
to be set in meson.build files.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
---
 app/meson.build                   | 10 ++++++-
 app/proc-info/meson.build         |  4 +--
 app/test-bbdev/meson.build        | 18 ++++-------
 app/test-crypto-perf/meson.build  |  4 +--
 app/test-pmd/meson.build          | 50 ++++++++++---------------------
 app/test/meson.build              |  6 ----
 drivers/meson.build               |  9 ++++++
 drivers/net/intel/ice/meson.build |  7 +++--
 lib/meson.build                   | 10 ++++++-
 9 files changed, 55 insertions(+), 63 deletions(-)

diff --git a/app/meson.build b/app/meson.build
index 7472d925b2..79a0672edc 100644
--- a/app/meson.build
+++ b/app/meson.build
@@ -63,9 +63,11 @@ foreach app:apps
               # instruction-set optimized versions of code
 
     # use "deps" for internal DPDK dependencies, and "ext_deps" for
-    # external package/library requirements
+    # external package/library requirements. Use "optional_deps" for internal
+    # dependencies to link against only if they are already being built.
     ext_deps = []
     deps = []
+    optional_deps = []
 
     if not enable_apps.contains(app)
         build = false
@@ -99,6 +101,12 @@ foreach app:apps
             endif
             dep_objs += [get_variable(var_name)]
         endforeach
+        foreach d:optional_deps
+            var_name = get_option('default_library') + '_rte_' + d
+            if is_variable(var_name) and not deps.contains(d)
+                dep_objs += [get_variable(var_name)]
+            endif
+        endforeach
     endif
 
     if not build
diff --git a/app/proc-info/meson.build b/app/proc-info/meson.build
index 316253cd5d..60c4eb2a90 100644
--- a/app/proc-info/meson.build
+++ b/app/proc-info/meson.build
@@ -9,8 +9,6 @@ endif
 
 sources = files('main.c')
 deps += ['ethdev', 'security', 'eventdev']
-if dpdk_conf.has('RTE_LIB_METRICS')
-    deps += 'metrics'
-endif
+optional_deps = ['metrics']
 
 cflags += no_wvla_cflag
diff --git a/app/test-bbdev/meson.build b/app/test-bbdev/meson.build
index f85a20c5b0..c3cdd4d7c5 100644
--- a/app/test-bbdev/meson.build
+++ b/app/test-bbdev/meson.build
@@ -8,17 +8,11 @@ sources = files(
         'test_bbdev_vector.c',
 )
 deps += ['bbdev', 'bus_vdev']
-if dpdk_conf.has('RTE_BASEBAND_FPGA_LTE_FEC')
-    deps += ['baseband_fpga_lte_fec']
-endif
-if dpdk_conf.has('RTE_BASEBAND_FPGA_5GNR_FEC')
-    deps += ['baseband_fpga_5gnr_fec']
-endif
-if dpdk_conf.has('RTE_BASEBAND_ACC')
-    deps += ['baseband_acc']
-endif
-if dpdk_conf.has('RTE_BASEBAND_LA12XX')
-    deps += ['baseband_la12xx']
-endif
+optional_deps = [
+        'baseband_acc',
+        'baseband_fpga_5gnr_fec',
+        'baseband_fpga_lte_fec',
+        'baseband_la12xx',
+]
 
 cflags += no_wvla_cflag
diff --git a/app/test-crypto-perf/meson.build b/app/test-crypto-perf/meson.build
index 87dd3bc5f1..76de68bfaf 100644
--- a/app/test-crypto-perf/meson.build
+++ b/app/test-crypto-perf/meson.build
@@ -20,8 +20,6 @@ sources = files(
         'main.c',
 )
 deps += ['cryptodev', 'net', 'security']
-if dpdk_conf.has('RTE_CRYPTO_SCHEDULER')
-    deps += 'crypto_scheduler'
-endif
+optional_deps = ['crypto_scheduler']
 
 cflags += no_wvla_cflag
diff --git a/app/test-pmd/meson.build b/app/test-pmd/meson.build
index 83163a5406..82ec6626f3 100644
--- a/app/test-pmd/meson.build
+++ b/app/test-pmd/meson.build
@@ -35,42 +35,24 @@ if dpdk_conf.has('RTE_HAS_JANSSON')
 endif
 
 deps += ['ethdev', 'cmdline', 'pci']
-if dpdk_conf.has('RTE_CRYPTO_SCHEDULER')
-    deps += 'crypto_scheduler'
-endif
-if dpdk_conf.has('RTE_LIB_BITRATESTATS')
-    deps += 'bitratestats'
-endif
+optional_deps = [
+        'bitratestats',
+        'bpf',
+        'bus_dpaa',
+        'crypto_scheduler',
+        'gro',
+        'gso',
+        'latencystats',
+        'mempool_dpaa',
+        'metrics',
+        'net_bnxt',
+        'net_dpaa',
+        'net_i40e',
+        'net_ixgbe',
+        'pdump',
+]
 if dpdk_conf.has('RTE_LIB_BPF')
     sources += files('bpf_cmd.c')
-    deps += 'bpf'
-endif
-if dpdk_conf.has('RTE_LIB_GRO')
-    deps += 'gro'
-endif
-if dpdk_conf.has('RTE_LIB_GSO')
-    deps += 'gso'
-endif
-if dpdk_conf.has('RTE_LIB_LATENCYSTATS')
-    deps += 'latencystats'
-endif
-if dpdk_conf.has('RTE_LIB_METRICS')
-    deps += 'metrics'
-endif
-if dpdk_conf.has('RTE_LIB_PDUMP')
-    deps += 'pdump'
-endif
-if dpdk_conf.has('RTE_NET_BNXT')
-    deps += 'net_bnxt'
-endif
-if dpdk_conf.has('RTE_NET_I40E')
-    deps += 'net_i40e'
-endif
-if dpdk_conf.has('RTE_NET_IXGBE')
-    deps += 'net_ixgbe'
-endif
-if dpdk_conf.has('RTE_NET_DPAA')
-    deps += ['bus_dpaa', 'mempool_dpaa', 'net_dpaa']
 endif
 
 # Driver-specific commands are located in driver directories.
diff --git a/app/test/meson.build b/app/test/meson.build
index 881b919b63..0b2f4fd708 100644
--- a/app/test/meson.build
+++ b/app/test/meson.build
@@ -259,12 +259,6 @@ foreach f, f_deps : source_file_deps
         sources += files(f)
     endif
 endforeach
-# add the optional dependencies
-foreach d:optional_deps
-    if is_variable(def_lib + '_rte_' + d) and d not in deps
-        deps += d
-    endif
-endforeach
 
 cflags += no_wvla_cflag
 cflags += no_shadow_cflag
diff --git a/drivers/meson.build b/drivers/meson.build
index 440c3959cf..e75fa983e2 100644
--- a/drivers/meson.build
+++ b/drivers/meson.build
@@ -174,6 +174,9 @@ foreach subpath:subdirs
         includes = [include_directories(drv_path)]
         # set up internal deps. Drivers can append/override as necessary
         deps = std_deps
+        # optional_deps: internal dependencies to link against only if they are
+        # already being built, rather than being always required
+        optional_deps = []
         # ext_deps: Stores external library dependency got
         # using dependency() (preferred) or find_library().
         # For the find_library() case (but not with dependency()) we also
@@ -249,6 +252,12 @@ foreach subpath:subdirs
                     static_deps += [get_variable('static_rte_' + d)]
                 endif
             endforeach
+            foreach d:optional_deps
+                if build and is_variable('shared_rte_' + d) and not deps.contains(d)
+                    shared_deps += [get_variable('shared_rte_' + d)]
+                    static_deps += [get_variable('static_rte_' + d)]
+                endif
+            endforeach
         endif
 
         if not build
diff --git a/drivers/net/intel/ice/meson.build b/drivers/net/intel/ice/meson.build
index 322d9597d2..e5ba7ac92c 100644
--- a/drivers/net/intel/ice/meson.build
+++ b/drivers/net/intel/ice/meson.build
@@ -22,9 +22,10 @@ testpmd_sources = files('ice_testpmd.c')
 
 deps += ['hash', 'net']
 
-if dpdk_conf.has('RTE_NET_IAVF')
-    deps += 'net_iavf'
-else
+# link against the iavf driver if it is being built, otherwise build the parts
+# of it needed here directly into this driver
+optional_deps = ['net_iavf']
+if not dpdk_conf.has('RTE_NET_IAVF')
     includes += include_directories(
             '../iavf',
             '../iavf/base'
diff --git a/lib/meson.build b/lib/meson.build
index 0c5da21522..87bfb914e8 100644
--- a/lib/meson.build
+++ b/lib/meson.build
@@ -137,9 +137,11 @@ foreach l:libraries
               # instruction-set optimized versions of code
 
     # use "deps" for internal DPDK dependencies, and "ext_deps" for
-    # external package/library requirements
+    # external package/library requirements. Use "optional_deps" for internal
+    # dependencies to link against only if they are already being built.
     ext_deps = []
     deps = []
+    optional_deps = []
     if dpdk_conf.has('RTE_LIB_EAL')
         # eal is standard dependency once built
         deps += ['eal']
@@ -201,6 +203,12 @@ foreach l:libraries
             static_deps += [get_variable('static_rte_' + d)]
         endif
     endforeach
+    foreach d:optional_deps
+        if build and is_variable('shared_rte_' + d) and not deps.contains(d)
+            shared_deps += [get_variable('shared_rte_' + d)]
+            static_deps += [get_variable('static_rte_' + d)]
+        endif
+    endforeach
 
     if not build
         dpdk_libs_disabled += name
-- 
2.53.0


^ permalink raw reply related	[flat|nested] 17+ messages in thread

* [RFC PATCH 05/12] net/bond: rename directory for consistency
  2026-10-16 10:59 [RFC PATCH 00/12] Add config-time dependency tracking Bruce Richardson
                   ` (3 preceding siblings ...)
  2026-10-16 10:59 ` [RFC PATCH 04/12] build: add direct support for optional dependencies Bruce Richardson
@ 2026-10-16 10:59 ` Bruce Richardson
  2026-10-16 10:59 ` [RFC PATCH 06/12] build: add script to generate dependencies list Bruce Richardson
                   ` (7 subsequent siblings)
  12 siblings, 0 replies; 17+ messages in thread
From: Bruce Richardson @ 2026-10-16 10:59 UTC (permalink / raw)
  To: dev; +Cc: Bruce Richardson

All libraries and drivers in DPDK have the directory name match the
resulting .so library name, with the exception of "net/bonding" which is
internally renamed to "net/bond". The shorter name is used for the .so
object and for dependency tracking in other DPDK components. Remove the
inconsistency by renaming the directory from "bonding" to "bond",
thereby removing the need for any tooling to take account of the fact
that directory names may not be the same as object or dependency names.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
---
 MAINTAINERS                                              | 2 +-
 doc/api/doxy-api.conf.in                                 | 2 +-
 doc/guides/prog_guide/link_bonding_poll_mode_drv_lib.rst | 2 +-
 doc/guides/testpmd_app_ug/testpmd_funcs.rst              | 2 +-
 drivers/meson.build                                      | 1 +
 drivers/net/{bonding => bond}/bonding_testpmd.c          | 0
 drivers/net/{bonding => bond}/eth_bond_8023ad_private.h  | 0
 drivers/net/{bonding => bond}/eth_bond_private.h         | 0
 drivers/net/{bonding => bond}/meson.build                | 1 -
 drivers/net/{bonding => bond}/rte_eth_bond.h             | 0
 drivers/net/{bonding => bond}/rte_eth_bond_8023ad.c      | 0
 drivers/net/{bonding => bond}/rte_eth_bond_8023ad.h      | 0
 drivers/net/{bonding => bond}/rte_eth_bond_alb.c         | 0
 drivers/net/{bonding => bond}/rte_eth_bond_alb.h         | 0
 drivers/net/{bonding => bond}/rte_eth_bond_api.c         | 0
 drivers/net/{bonding => bond}/rte_eth_bond_args.c        | 0
 drivers/net/{bonding => bond}/rte_eth_bond_flow.c        | 0
 drivers/net/{bonding => bond}/rte_eth_bond_pmd.c         | 0
 drivers/net/meson.build                                  | 2 +-
 19 files changed, 6 insertions(+), 6 deletions(-)
 rename drivers/net/{bonding => bond}/bonding_testpmd.c (100%)
 rename drivers/net/{bonding => bond}/eth_bond_8023ad_private.h (100%)
 rename drivers/net/{bonding => bond}/eth_bond_private.h (100%)
 rename drivers/net/{bonding => bond}/meson.build (95%)
 rename drivers/net/{bonding => bond}/rte_eth_bond.h (100%)
 rename drivers/net/{bonding => bond}/rte_eth_bond_8023ad.c (100%)
 rename drivers/net/{bonding => bond}/rte_eth_bond_8023ad.h (100%)
 rename drivers/net/{bonding => bond}/rte_eth_bond_alb.c (100%)
 rename drivers/net/{bonding => bond}/rte_eth_bond_alb.h (100%)
 rename drivers/net/{bonding => bond}/rte_eth_bond_api.c (100%)
 rename drivers/net/{bonding => bond}/rte_eth_bond_args.c (100%)
 rename drivers/net/{bonding => bond}/rte_eth_bond_flow.c (100%)
 rename drivers/net/{bonding => bond}/rte_eth_bond_pmd.c (100%)

diff --git a/MAINTAINERS b/MAINTAINERS
index 482bc7df76..02a06d9506 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -671,7 +671,7 @@ F: doc/guides/nics/features/default.ini
 Link bonding
 M: Chas Williams <chas3@att.com>
 M: Min Hu (Connor) <humin29@huawei.com>
-F: drivers/net/bonding/
+F: drivers/net/bond/
 F: doc/guides/prog_guide/link_bonding_poll_mode_drv_lib.rst
 F: app/test/test_link_bonding*
 F: examples/bond/
diff --git a/doc/api/doxy-api.conf.in b/doc/api/doxy-api.conf.in
index 94096ee710..f8b80e1110 100644
--- a/doc/api/doxy-api.conf.in
+++ b/doc/api/doxy-api.conf.in
@@ -15,7 +15,7 @@ INPUT                   = @TOPDIR@/doc/api/doxy-api-index.md \
                           @TOPDIR@/drivers/mempool/dpaa2 \
                           @TOPDIR@/drivers/net/ark \
                           @TOPDIR@/drivers/net/bnxt \
-                          @TOPDIR@/drivers/net/bonding \
+                          @TOPDIR@/drivers/net/bond \
                           @TOPDIR@/drivers/net/cnxk \
                           @TOPDIR@/drivers/net/dpaa \
                           @TOPDIR@/drivers/net/dpaa2 \
diff --git a/doc/guides/prog_guide/link_bonding_poll_mode_drv_lib.rst b/doc/guides/prog_guide/link_bonding_poll_mode_drv_lib.rst
index 2fa1ac4028..469a8f1d9e 100644
--- a/doc/guides/prog_guide/link_bonding_poll_mode_drv_lib.rst
+++ b/doc/guides/prog_guide/link_bonding_poll_mode_drv_lib.rst
@@ -29,7 +29,7 @@ bonding device and its member devices.
 
     The Link Bonding PMD Library is enabled by default in the build
     configuration, the library can be disabled using the meson option
-    "-Ddisable_drivers=net/bonding".
+    "-Ddisable_drivers=net/bond".
 
 
 Link Bonding Modes Overview
diff --git a/doc/guides/testpmd_app_ug/testpmd_funcs.rst b/doc/guides/testpmd_app_ug/testpmd_funcs.rst
index 30cac0ad8c..72c4f5bec7 100644
--- a/doc/guides/testpmd_app_ug/testpmd_funcs.rst
+++ b/doc/guides/testpmd_app_ug/testpmd_funcs.rst
@@ -5738,6 +5738,6 @@ Driver specific commands
 Some drivers provide specific features.
 See:
 
-- :ref:`net/bonding testpmd driver specific commands <bonding_testpmd_commands>`
+- :ref:`net/bond testpmd driver specific commands <bonding_testpmd_commands>`
 - :ref:`net/i40e testpmd driver specific commands <i40e_testpmd_commands>`
 - :ref:`net/ixgbe testpmd driver specific commands <ixgbe_testpmd_commands>`
diff --git a/drivers/meson.build b/drivers/meson.build
index e75fa983e2..cb71bc8231 100644
--- a/drivers/meson.build
+++ b/drivers/meson.build
@@ -35,6 +35,7 @@ endif
 
 # map legacy driver names
 driver_map = {
+    'net/bonding': 'net/bond',
     'net/cpfl': 'net/intel/cpfl',
     'net/e1000': 'net/intel/e1000',
     'net/fm10k': 'net/intel/fm10k',
diff --git a/drivers/net/bonding/bonding_testpmd.c b/drivers/net/bond/bonding_testpmd.c
similarity index 100%
rename from drivers/net/bonding/bonding_testpmd.c
rename to drivers/net/bond/bonding_testpmd.c
diff --git a/drivers/net/bonding/eth_bond_8023ad_private.h b/drivers/net/bond/eth_bond_8023ad_private.h
similarity index 100%
rename from drivers/net/bonding/eth_bond_8023ad_private.h
rename to drivers/net/bond/eth_bond_8023ad_private.h
diff --git a/drivers/net/bonding/eth_bond_private.h b/drivers/net/bond/eth_bond_private.h
similarity index 100%
rename from drivers/net/bonding/eth_bond_private.h
rename to drivers/net/bond/eth_bond_private.h
diff --git a/drivers/net/bonding/meson.build b/drivers/net/bond/meson.build
similarity index 95%
rename from drivers/net/bonding/meson.build
rename to drivers/net/bond/meson.build
index 14304b68a8..bf73ce2e57 100644
--- a/drivers/net/bonding/meson.build
+++ b/drivers/net/bond/meson.build
@@ -7,7 +7,6 @@ if is_windows
     subdir_done()
 endif
 
-name = 'bond' #, james bond :-)
 sources = files(
         'rte_eth_bond_8023ad.c',
         'rte_eth_bond_alb.c',
diff --git a/drivers/net/bonding/rte_eth_bond.h b/drivers/net/bond/rte_eth_bond.h
similarity index 100%
rename from drivers/net/bonding/rte_eth_bond.h
rename to drivers/net/bond/rte_eth_bond.h
diff --git a/drivers/net/bonding/rte_eth_bond_8023ad.c b/drivers/net/bond/rte_eth_bond_8023ad.c
similarity index 100%
rename from drivers/net/bonding/rte_eth_bond_8023ad.c
rename to drivers/net/bond/rte_eth_bond_8023ad.c
diff --git a/drivers/net/bonding/rte_eth_bond_8023ad.h b/drivers/net/bond/rte_eth_bond_8023ad.h
similarity index 100%
rename from drivers/net/bonding/rte_eth_bond_8023ad.h
rename to drivers/net/bond/rte_eth_bond_8023ad.h
diff --git a/drivers/net/bonding/rte_eth_bond_alb.c b/drivers/net/bond/rte_eth_bond_alb.c
similarity index 100%
rename from drivers/net/bonding/rte_eth_bond_alb.c
rename to drivers/net/bond/rte_eth_bond_alb.c
diff --git a/drivers/net/bonding/rte_eth_bond_alb.h b/drivers/net/bond/rte_eth_bond_alb.h
similarity index 100%
rename from drivers/net/bonding/rte_eth_bond_alb.h
rename to drivers/net/bond/rte_eth_bond_alb.h
diff --git a/drivers/net/bonding/rte_eth_bond_api.c b/drivers/net/bond/rte_eth_bond_api.c
similarity index 100%
rename from drivers/net/bonding/rte_eth_bond_api.c
rename to drivers/net/bond/rte_eth_bond_api.c
diff --git a/drivers/net/bonding/rte_eth_bond_args.c b/drivers/net/bond/rte_eth_bond_args.c
similarity index 100%
rename from drivers/net/bonding/rte_eth_bond_args.c
rename to drivers/net/bond/rte_eth_bond_args.c
diff --git a/drivers/net/bonding/rte_eth_bond_flow.c b/drivers/net/bond/rte_eth_bond_flow.c
similarity index 100%
rename from drivers/net/bonding/rte_eth_bond_flow.c
rename to drivers/net/bond/rte_eth_bond_flow.c
diff --git a/drivers/net/bonding/rte_eth_bond_pmd.c b/drivers/net/bond/rte_eth_bond_pmd.c
similarity index 100%
rename from drivers/net/bonding/rte_eth_bond_pmd.c
rename to drivers/net/bond/rte_eth_bond_pmd.c
diff --git a/drivers/net/meson.build b/drivers/net/meson.build
index 4e8ccb945f..0de3e30cf2 100644
--- a/drivers/net/meson.build
+++ b/drivers/net/meson.build
@@ -11,7 +11,7 @@ drivers = [
         'axgbe',
         'bnx2x',
         'bnxt',
-        'bonding',
+        'bond',
         'cnxk',
         'cxgbe',
         'dpaa',
-- 
2.53.0


^ permalink raw reply related	[flat|nested] 17+ messages in thread

* [RFC PATCH 06/12] build: add script to generate dependencies list
  2026-10-16 10:59 [RFC PATCH 00/12] Add config-time dependency tracking Bruce Richardson
                   ` (4 preceding siblings ...)
  2026-10-16 10:59 ` [RFC PATCH 05/12] net/bond: rename directory for consistency Bruce Richardson
@ 2026-10-16 10:59 ` Bruce Richardson
  2026-10-16 10:59 ` [RFC PATCH 07/12] build: use recursive addition for enabled libraries option Bruce Richardson
                   ` (6 subsequent siblings)
  12 siblings, 0 replies; 17+ messages in thread
From: Bruce Richardson @ 2026-10-16 10:59 UTC (permalink / raw)
  To: dev; +Cc: Bruce Richardson

At start of the build configuration, generate a list of all components
and their dependencies on other internal components. Future changes can
use this list to have smarter behaviour for enabling and disabling
drivers and libs.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
---
 buildtools/get-deps.py | 203 +++++++++++++++++++++++++++++++++++++++++
 buildtools/meson.build |   1 +
 meson.build            |   7 ++
 3 files changed, 211 insertions(+)
 create mode 100644 buildtools/get-deps.py

diff --git a/buildtools/get-deps.py b/buildtools/get-deps.py
new file mode 100644
index 0000000000..ca3ee35ff7
--- /dev/null
+++ b/buildtools/get-deps.py
@@ -0,0 +1,203 @@
+#!/usr/bin/env python3
+# SPDX-License-Identifier: BSD-3-Clause
+# Copyright(c) 2026 Intel Corporation
+
+"""Report the internal DPDK dependencies of every library, driver and app.
+
+Scans the meson.build file of each component for "deps" and "optional_deps"
+assignments, without needing to execute them.  This lets the build work out what
+each component requires before any component has been configured, which in turn
+allows enabling a component to also enable whatever it depends on.
+
+Output is one line per component:
+
+    kind|name|path|deps|optional_deps
+
+"kind" is one of lib, drv or app, and the two dependency fields are
+comma-separated and may be empty.  Dependency names are the names components are
+known by once built, i.e. a library is named after its directory, while a driver
+is "<class>_<name>".
+"""
+
+import re
+import sys
+from pathlib import Path
+from typing import NamedTuple
+
+# an assignment to one of the dependency variables, capturing the operator so
+# that "deps = " (replacing the class defaults) can be told from "deps += "
+ASSIGN = re.compile(r"^(deps|std_deps|optional_deps)\s*(\+?=)\s*(.*)$")
+# meson has no double-quoted strings, so anything quoted is quoted with '
+QUOTED = re.compile(r"'([^']+)'")
+
+
+class Component(NamedTuple):
+    kind: str  # lib, drv or app
+    name: str  # the name the component is known by once built
+    path: str  # source directory, relative to the DPDK root
+    deps: list
+    optional_deps: list
+
+
+def strip_comment(line):
+    """Remove a trailing comment. Dependency names never contain '#'."""
+    return line.split("#", 1)[0]
+
+
+def logical_lines(path):
+    """Yield (indent, text) with multi-line list literals joined into one line."""
+    if not path.is_file():
+        return
+    pending = ""
+    depth = 0
+    indent = 0
+    for raw in path.read_text().splitlines():
+        text = strip_comment(raw)
+        if not text.strip():
+            continue
+        # depth == 0 means we are not inside any brackets or parentheses
+        if depth == 0:
+            indent = len(text) - len(text.lstrip())
+            pending = text.strip()
+        else:
+            # inside a multi-line list or parentheses, so just append the stripped text
+            pending += " " + text.strip()
+        # brackets and the parentheses of calls such as files(...) may both span lines
+        depth = pending.count("[") - pending.count("]") + pending.count("(") - pending.count(")")
+        if depth <= 0:
+            depth = 0
+            yield indent, pending
+            pending = ""
+
+
+def dedup(items):
+    return list(dict.fromkeys(items))
+
+
+def list_variable(path, varname):
+    """Collect every value assigned or appended to a list variable."""
+    found = []
+    pattern = re.compile(r"^%s\s*\+?=\s*(.*)$" % re.escape(varname))
+    for _, line in logical_lines(path):
+        m = pattern.match(line)
+        if m:
+            found += QUOTED.findall(m.group(1))
+    return dedup(found)
+
+
+def scan(path):
+    """Return (deps, optional_deps, replaces_std_deps) for a component.
+
+    Conditions around an assignment are deliberately ignored: a dependency that
+    is only needed on some platforms is still recorded, which over-approximates
+    in the safe direction.  Use "optional_deps" for a dependency that should be
+    linked against only when it is already being built.
+    """
+    deps = []
+    optional = []
+    replaces = False
+
+    for indent, line in logical_lines(path):
+        m = ASSIGN.match(line)
+        if not m:
+            continue
+        var, op, rhs = m.groups()
+
+        items = QUOTED.findall(rhs)
+        if not items:
+            # a computed value such as "deps += some_variable" cannot be scanned
+            continue
+
+        if var == "optional_deps":
+            optional += items
+        elif op == "=" and var == "deps" and indent == 0:
+            # only a top-level "deps =" discards the class defaults; one inside a
+            # conditional may not run at all, so treat it as an addition
+            replaces = True
+            deps = list(items)
+        else:
+            deps += items
+
+    return dedup(deps), dedup(optional), replaces
+
+
+def scan_libs(root):
+    libdir = root / "lib"
+    for lib in list_variable(libdir / "meson.build", "libraries"):
+        deps, optional, _ = scan(libdir / lib / "meson.build")
+        yield Component("lib", lib, "lib/" + lib, deps, optional)
+
+
+def scan_drivers(root):
+    drvdir = root / "drivers"
+    for subpath in list_variable(drvdir / "meson.build", "subdirs"):
+        if "/" in subpath:
+            # a driver listed on its own gets no class-wide default dependencies
+            cls, rest = subpath.split("/", 1)
+            drivers, std_deps = [rest], []
+        else:
+            cls = subpath
+            classfile = drvdir / cls / "meson.build"
+            drivers = list_variable(classfile, "drivers")
+            std_deps, _, _ = scan(classfile)
+
+        for drv in drivers:
+            path = cls + "/" + drv
+            deps, optional, replaces = scan(drvdir / path / "meson.build")
+            if not replaces:
+                deps = dedup(std_deps + deps)
+            yield Component(
+                "drv", cls + "_" + drv.split("/")[-1], "drivers/" + path, deps, optional
+            )
+
+
+def scan_apps(root):
+    appdir = root / "app"
+    for app in list_variable(appdir / "meson.build", "apps"):
+        deps, optional, _ = scan(appdir / app / "meson.build")
+        yield Component("app", app, "app/" + app, deps, optional)
+
+
+def validate(components):
+    """Reject anything that would make the dependency graph unusable."""
+    errors = []
+    provider = {}
+    for c in components:
+        # apps are never depended upon, so they are outside the component namespace
+        if c.kind == "app":
+            continue
+        if c.name in provider:
+            errors.append(
+                '"%s" is provided by both %s and %s' % (c.name, provider[c.name], c.path)
+            )
+        provider[c.name] = c.path
+
+    for c in components:
+        for d in c.deps + c.optional_deps:
+            if d not in provider:
+                errors.append('%s depends on "%s", which is not a known component' % (c.path, d))
+    return errors
+
+
+def main():
+    if len(sys.argv) != 2:
+        sys.exit("usage: %s <dpdk-source-root>" % sys.argv[0])
+    root = Path(sys.argv[1])
+
+    components = list(scan_libs(root)) + list(scan_drivers(root)) + list(scan_apps(root))
+
+    errors = validate(components)
+    if errors:
+        for e in errors:
+            print("error: " + e, file=sys.stderr)
+        sys.exit(1)
+
+    for c in components:
+        print(
+            "%s|%s|%s|%s|%s"
+            % (c.kind, c.name, c.path, ",".join(c.deps), ",".join(c.optional_deps))
+        )
+
+
+if __name__ == "__main__":
+    main()
diff --git a/buildtools/meson.build b/buildtools/meson.build
index 32cea7cff7..02c66a5580 100644
--- a/buildtools/meson.build
+++ b/buildtools/meson.build
@@ -22,6 +22,7 @@ gen_version_map = py3 + files('gen-version-map.py')
 list_dir_globs = py3 + files('list-dir-globs.py')
 sphinx_wrapper = py3 + files('call-sphinx-build.py')
 get_cpu_count_cmd = py3 + files('get-cpu-count.py')
+get_deps_cmd = py3 + files('get-deps.py')
 get_numa_count_cmd = py3 + files('get-numa-count.py')
 get_min_meson_version_cmd = py3 + files('get-min-meson-version.py')
 get_test_suites_cmd = py3 + files('get-test-suites.py')
diff --git a/meson.build b/meson.build
index 6b8cfa8b2e..e153894ac7 100644
--- a/meson.build
+++ b/meson.build
@@ -88,6 +88,13 @@ if is_linux
     global_inc += include_directories('kernel/linux')
 endif
 
+# record what each component depends on, so that enabling a component can also
+# enable the components it needs
+dpdk_deps_graph = configure_file(
+        command: [get_deps_cmd, dpdk_source_root],
+        capture: true,
+        output: 'dependencies.txt')
+
 # build libs and drivers
 subdir('lib')
 subdir('drivers')
-- 
2.53.0


^ permalink raw reply related	[flat|nested] 17+ messages in thread

* [RFC PATCH 07/12] build: use recursive addition for enabled libraries option
  2026-10-16 10:59 [RFC PATCH 00/12] Add config-time dependency tracking Bruce Richardson
                   ` (5 preceding siblings ...)
  2026-10-16 10:59 ` [RFC PATCH 06/12] build: add script to generate dependencies list Bruce Richardson
@ 2026-10-16 10:59 ` Bruce Richardson
  2026-10-16 10:59 ` [RFC PATCH 08/12] build: use recursive addition for enabled drivers option Bruce Richardson
                   ` (5 subsequent siblings)
  12 siblings, 0 replies; 17+ messages in thread
From: Bruce Richardson @ 2026-10-16 10:59 UTC (permalink / raw)
  To: dev; +Cc: Bruce Richardson

When a user configures the build using "--enable_libs" there is no
automatic handling of dependencies for the requested libraries. For
example, if "ipsec" is a requested library, the user must know that
security and cryptodev libs must also be in the enabled set.

Fix this omission by using a python script to parse the previously
generated dependency set for the DPDK components and report out the
necessary libraries. This allows for the automatic addition of extra
libraries if they are needed to enable an explicitly-requested library.
If a dependency of a requested lib is explicitly in the disable list,
then error out.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
---
 buildtools/meson.build     |  1 +
 buildtools/resolve-deps.py | 80 ++++++++++++++++++++++++++++++++++++++
 lib/meson.build            | 18 +++++----
 3 files changed, 91 insertions(+), 8 deletions(-)
 create mode 100644 buildtools/resolve-deps.py

diff --git a/buildtools/meson.build b/buildtools/meson.build
index 02c66a5580..b3aa7197f9 100644
--- a/buildtools/meson.build
+++ b/buildtools/meson.build
@@ -26,6 +26,7 @@ get_deps_cmd = py3 + files('get-deps.py')
 get_numa_count_cmd = py3 + files('get-numa-count.py')
 get_min_meson_version_cmd = py3 + files('get-min-meson-version.py')
 get_test_suites_cmd = py3 + files('get-test-suites.py')
+resolve_deps_cmd = py3 + files('resolve-deps.py')
 header_gen_cmd = py3 + files('gen-header.py')
 has_hugepages_cmd = py3 + files('has-hugepages.py')
 cmdline_gen_cmd = py3 + files('dpdk-cmdline-gen.py')
diff --git a/buildtools/resolve-deps.py b/buildtools/resolve-deps.py
new file mode 100644
index 0000000000..ac2f9c63d9
--- /dev/null
+++ b/buildtools/resolve-deps.py
@@ -0,0 +1,80 @@
+#!/usr/bin/env python3
+# SPDX-License-Identifier: BSD-3-Clause
+# Copyright(c) 2026 Intel Corporation
+
+"""List everything needed in order to build the given components.
+
+Reads the dependency graph produced by get-deps.py and prints, as a single
+comma-separated list, the named components plus everything they depend on,
+directly or indirectly.
+
+"""
+
+import argparse
+from collections import namedtuple
+
+Component = namedtuple("Component", ["kind", "name", "key", "deps"])
+
+
+def read_graph(filename):
+    """Load every component that can be depended upon.
+
+    Apps are never depended upon and may share a name with a library, e.g. graph
+    and pdump, so they are left out of the graph entirely.
+    """
+    components = []
+    with open(filename) as f:
+        for line in f:
+            kind, name, path, deps, _ = line.strip().split("|")
+            if kind == "app":
+                continue
+            # the option key is the path without its category directory
+            key = path.split("/", 1)[1]
+            components.append(Component(kind, name, key, [d for d in deps.split(",") if d]))
+    return components
+
+
+def needed(components, roots, kinds):
+    """Return the keys, of the wanted kinds, of everything the roots need."""
+    by_name = {c.name: c for c in components}
+    by_key = {c.key: c for c in components}
+
+    pending = []
+    for r in roots:
+        comp = by_key.get(r) or by_name.get(r)
+        if comp is not None:
+            pending.append(comp.name)
+
+    seen = set()
+    while pending:
+        comp = by_name[pending.pop()]
+        if comp.name in seen:
+            continue
+        seen.add(comp.name)
+        pending += [d for d in comp.deps if d in by_name]
+
+    return sorted(c.key for c in components if c.name in seen and c.kind in kinds)
+
+
+def main():
+    parser = argparse.ArgumentParser(description=__doc__)
+    parser.add_argument("graph", help="dependency graph file from get-deps.py")
+    parser.add_argument("--libs", action="store_true", help="report only libraries")
+    parser.add_argument("--drivers", action="store_true", help="report only drivers")
+    parser.add_argument("component", nargs="+", help="components to be built")
+    args = parser.parse_args()
+
+    kinds = []
+    if args.libs:
+        kinds.append("lib")
+    if args.drivers:
+        kinds.append("drv")
+    if not kinds:
+        kinds = ["lib", "drv"]
+
+    components = read_graph(args.graph)
+    print(",".join(needed(components, args.component, kinds)))
+
+
+if __name__ == "__main__":
+    main()
diff --git a/lib/meson.build b/lib/meson.build
index 87bfb914e8..f7705d7ebe 100644
--- a/lib/meson.build
+++ b/lib/meson.build
@@ -100,18 +100,20 @@ endforeach
 
 disable_libs = run_command(list_dir_globs, get_option('disable_libs'), check: true).stdout().split()
 
-enable_libs = run_command(list_dir_globs, get_option('enable_libs'), check: true).stdout().split()
-foreach l:enable_libs
+requested_libs = run_command(list_dir_globs, get_option('enable_libs'), check: true).stdout().split()
+foreach l:requested_libs
     if disable_libs.contains(l)
         error('Library "@0@" is in both "enable_libs" and "disable_libs".'.format(l))
     endif
 endforeach
-require_libs = true
-if enable_libs.length() == 0
-    require_libs = false
-    enable_libs = libraries
-else
-    enable_libs += always_enable
+require_libs = requested_libs.length() != 0
+
+# expand the requested libraries to also include the libraries they depend on,
+# with an empty request meaning every library is wanted
+enable_libs = libraries
+if requested_libs.length() > 0
+    enable_libs = run_command(resolve_deps_cmd, dpdk_deps_graph, '--libs',
+            requested_libs + always_enable, check: true).stdout().strip().split(',')
 endif
 
 default_cflags = machine_args
-- 
2.53.0


^ permalink raw reply related	[flat|nested] 17+ messages in thread

* [RFC PATCH 08/12] build: use recursive addition for enabled drivers option
  2026-10-16 10:59 [RFC PATCH 00/12] Add config-time dependency tracking Bruce Richardson
                   ` (6 preceding siblings ...)
  2026-10-16 10:59 ` [RFC PATCH 07/12] build: use recursive addition for enabled libraries option Bruce Richardson
@ 2026-10-16 10:59 ` Bruce Richardson
  2026-10-16 10:59 ` [RFC PATCH 09/12] build: improve error reporting for unbuildable components Bruce Richardson
                   ` (4 subsequent siblings)
  12 siblings, 0 replies; 17+ messages in thread
From: Bruce Richardson @ 2026-10-16 10:59 UTC (permalink / raw)
  To: dev; +Cc: Bruce Richardson

As with the libraries, recursively add dependencies of the enabled
drivers to the build list to enable building with, for example, just
--enable_drivers=net/mlx5 or --enable_drivers=net/cpfl.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
---
 drivers/meson.build | 21 ++++++++++++---------
 1 file changed, 12 insertions(+), 9 deletions(-)

diff --git a/drivers/meson.build b/drivers/meson.build
index cb71bc8231..fe514a0b15 100644
--- a/drivers/meson.build
+++ b/drivers/meson.build
@@ -71,23 +71,26 @@ foreach driver_option : ['disable_drivers', 'enable_drivers']
 endforeach
 
 disable_drivers = run_command(list_dir_globs, disable_drivers, check: true).stdout().split()
-enable_drivers = run_command(list_dir_globs, enable_drivers, check: true).stdout().split()
-foreach d:enable_drivers
+requested_drivers = run_command(list_dir_globs, enable_drivers, check: true).stdout().split()
+foreach d:requested_drivers
     if disable_drivers.contains(d)
         error('Driver "@0@" is in both "enable_drivers" and "disable_drivers".'.format(d))
     endif
 endforeach
-require_drivers = true
-if enable_drivers.length() == 0
-    require_drivers = false
-    enable_drivers = run_command(list_dir_globs, '**', check: true).stdout().split()
-endif
+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']
-enable_drivers += always_enable
+
+# 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
+enable_drivers = []
+if require_drivers
+    enable_drivers = run_command(resolve_deps_cmd, dpdk_deps_graph, '--drivers',
+            requested_drivers + always_enable, check: true).stdout().strip().split(',')
+endif
 
 default_cflags = machine_args
 default_cflags += ['-DALLOW_EXPERIMENTAL_API']
@@ -200,7 +203,7 @@ foreach subpath:subdirs
             name = name.split('/')[1]
         endif
 
-        if not enable_drivers.contains(drv_path)
+        if require_drivers and not enable_drivers.contains(drv_path)
             build = false
             reason = 'not in enabled drivers build config'
         elif disable_drivers.contains(drv_path)
-- 
2.53.0


^ permalink raw reply related	[flat|nested] 17+ messages in thread

* [RFC PATCH 09/12] build: improve error reporting for unbuildable components
  2026-10-16 10:59 [RFC PATCH 00/12] Add config-time dependency tracking Bruce Richardson
                   ` (7 preceding siblings ...)
  2026-10-16 10:59 ` [RFC PATCH 08/12] build: use recursive addition for enabled drivers option Bruce Richardson
@ 2026-10-16 10:59 ` Bruce Richardson
  2026-10-16 10:59 ` [RFC PATCH 10/12] build: add EAL common directory to global include list Bruce Richardson
                   ` (3 subsequent siblings)
  12 siblings, 0 replies; 17+ messages in thread
From: Bruce Richardson @ 2026-10-16 10:59 UTC (permalink / raw)
  To: dev; +Cc: Bruce Richardson

With the addition of automatic dependency tracking so that dependencies
are automatically enabled for libraries and drivers, the error message
for a missing library is now inaccurate (although following it will lead
eventually to a solution by way of other error messages!).

Improve this situation by correctly reporting if a necessary component
is explicitly disabled or cannot be built for some other reason.

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

drivers
---
 drivers/meson.build | 27 ++++++++++++++++++++++++++-
 lib/meson.build     | 16 ++++++++++++----
 2 files changed, 38 insertions(+), 5 deletions(-)

diff --git a/drivers/meson.build b/drivers/meson.build
index fe514a0b15..aacfe29c46 100644
--- a/drivers/meson.build
+++ b/drivers/meson.build
@@ -248,8 +248,33 @@ foreach subpath:subdirs
                     # error out if we can't build a driver and that driver was explicitly
                     # requested, i.e. not via wildcard.
                     if require_drivers and get_option('enable_drivers').contains(drv_path)
+                        # reconstruct the path from the name by replacing the first
+                        # "_" with a "/"; the class never contains an underscore
+                        d_parts = d.split('_')
+                        d_rest = []
+                        foreach i : range(1, d_parts.length())
+                            d_rest += d_parts[i]
+                        endforeach
+                        missing_path = d_parts[0] + '/' + '_'.join(d_rest)
+                        if driver_map.has_key(missing_path)
+                            # disable_drivers/dpdk_drvs_disabled store the canonical
+                            # path, e.g. net/intel/idpf rather than the legacy net/idpf
+                            missing_path = driver_map[missing_path]
+                        endif
+                        if disable_drivers.contains(missing_path)
+                            advice = 'Remove "@0@" from the "disable_drivers" option.'.format(
+                                    missing_path)
+                        elif dpdk_drvs_disabled.contains(missing_path)
+                            advice = 'Driver "@0@" cannot be built: @1@'.format(missing_path,
+                                    get_variable('drv_' + missing_path.underscorify()
+                                            + '_disable_reason'))
+                        else
+                            advice = 'Please check the build configuration for driver "@0@".'.format(
+                                    missing_path)
+                        endif
                         error('Cannot build explicitly requested driver "@0@".\n'.format(drv_path)
-                                +'\tPlease enable missing dependency "@0@"'.format(d))
+                                + '\tMissing dependency "@0@".\n'.format(d)
+                                + '\t' + advice)
                     endif
                 else
                     shared_deps += [get_variable('shared_rte_' + d)]
diff --git a/lib/meson.build b/lib/meson.build
index f7705d7ebe..8adb510513 100644
--- a/lib/meson.build
+++ b/lib/meson.build
@@ -106,7 +106,6 @@ foreach l:requested_libs
         error('Library "@0@" is in both "enable_libs" and "disable_libs".'.format(l))
     endif
 endforeach
-require_libs = requested_libs.length() != 0
 
 # expand the requested libraries to also include the libraries they depend on,
 # with an empty request meaning every library is wanted
@@ -173,7 +172,7 @@ foreach l:libraries
 
     if build
         subdir(l)
-        if not build and require_libs
+        if not build and requested_libs.contains(l)
             error('Cannot build explicitly requested lib "@0@".\n'.format(name)
                     +'\tReason: ' + reason)
         endif
@@ -196,9 +195,18 @@ foreach l:libraries
             endif
             message('Disabling @1@ [@2@]: missing internal dependency "@0@"'
                     .format(d, name, 'lib/' + l))
-            if require_libs
+            if requested_libs.contains(l)
+                if disable_libs.contains(d)
+                    advice = 'Remove "@0@" from the "disable_libs" option.'.format(d)
+                elif dpdk_libs_disabled.contains(d)
+                    advice = 'Library "@0@" cannot be built: @1@'.format(d,
+                            get_variable('lib_' + d.underscorify() + '_disable_reason'))
+                else
+                    advice = 'Please check the build configuration for library "@0@".'.format(d)
+                endif
                 error('Cannot build explicitly requested lib "@0@".\n'.format(name)
-                        + '\tPlease add missing dependency "@0@" to "enable_libs" option'.format(d))
+                        + '\tMissing dependency "@0@".\n'.format(d)
+                        + '\t' + advice)
             endif
         else
             shared_deps += [get_variable('shared_rte_' + d)]
-- 
2.53.0


^ permalink raw reply related	[flat|nested] 17+ messages in thread

* [RFC PATCH 10/12] build: add EAL common directory to global include list
  2026-10-16 10:59 [RFC PATCH 00/12] Add config-time dependency tracking Bruce Richardson
                   ` (8 preceding siblings ...)
  2026-10-16 10:59 ` [RFC PATCH 09/12] build: improve error reporting for unbuildable components Bruce Richardson
@ 2026-10-16 10:59 ` Bruce Richardson
  2026-10-16 10:59 ` [RFC PATCH 11/12] build: make EAL an explicit dependency Bruce Richardson
                   ` (2 subsequent siblings)
  12 siblings, 0 replies; 17+ messages in thread
From: Bruce Richardson @ 2026-10-16 10:59 UTC (permalink / raw)
  To: dev; +Cc: Bruce Richardson

The eal/common directory includes many headers needed internally to
build various libraries, so add it to the global include rather than
relying on it being added separately in the lib meson.build file. To
simplify things further we can then just use global_inc as a standard
set of includes for building libraries - both pre and post-eal. While
those built with a dependency on EAL don't need this include, having it
there is harmless.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
---
 drivers/common/mlx5/linux/meson.build | 1 -
 lib/eal/meson.build                   | 1 -
 lib/log/meson.build                   | 1 -
 lib/meson.build                       | 5 +----
 meson.build                           | 1 +
 5 files changed, 2 insertions(+), 7 deletions(-)

diff --git a/drivers/common/mlx5/linux/meson.build b/drivers/common/mlx5/linux/meson.build
index 3767e7a69b..69dbbc8593 100644
--- a/drivers/common/mlx5/linux/meson.build
+++ b/drivers/common/mlx5/linux/meson.build
@@ -239,7 +239,6 @@ if dlopen_ibverbs
     dlopen_sources = files('mlx5_glue.c')
     dlopen_install_dir = [ eal_pmd_path + '-glue' ]
     dlopen_includes = [global_inc]
-    dlopen_includes += include_directories('../../../../lib/eal/common')
     dlopen_includes += include_directories('..')
     shared_lib = shared_library(
             dlopen_lib_name,
diff --git a/lib/eal/meson.build b/lib/eal/meson.build
index 092f5c5261..e72276a7ca 100644
--- a/lib/eal/meson.build
+++ b/lib/eal/meson.build
@@ -1,7 +1,6 @@
 # SPDX-License-Identifier: BSD-3-Clause
 # Copyright(c) 2017-2019 Intel Corporation
 
-includes += global_inc
 subdir('include')
 
 subdir('common')
diff --git a/lib/log/meson.build b/lib/log/meson.build
index b3de57b9c7..00f45b6bae 100644
--- a/lib/log/meson.build
+++ b/lib/log/meson.build
@@ -1,7 +1,6 @@
 # SPDX-License-Identifier: BSD-3-Clause
 # Copyright(c) 2023 Intel Corporation
 
-includes += global_inc
 sources = files(
         'log.c',
         'log_color.c',
diff --git a/lib/meson.build b/lib/meson.build
index 8adb510513..16c7a65786 100644
--- a/lib/meson.build
+++ b/lib/meson.build
@@ -132,7 +132,7 @@ foreach l:libraries
     headers = []
     indirect_headers = [] # public headers not directly included by apps
     driver_sdk_headers = [] # public headers included by drivers
-    includes = []
+    includes = global_inc
     cflags = default_cflags
     objs = [] # other object files to link against, used e.g. for
               # instruction-set optimized versions of code
@@ -146,9 +146,6 @@ foreach l:libraries
     if dpdk_conf.has('RTE_LIB_EAL')
         # eal is standard dependency once built
         deps += ['eal']
-    else
-        # otherwise, make private headers available (like eal_export.h)
-        includes += include_directories('eal/common')
     endif
 
     if dpdk_libs_deprecated.contains(l)
diff --git a/meson.build b/meson.build
index e153894ac7..4536f7e9c5 100644
--- a/meson.build
+++ b/meson.build
@@ -76,6 +76,7 @@ endif
 config_inc = [include_directories('.', 'config')]
 global_inc = [config_inc, include_directories(
     'lib/eal/include',
+    'lib/eal/common',
     'lib/eal/@0@/include'.format(host_machine.system()),
     'lib/eal/@0@/include'.format(arch_subdir),
 )]
-- 
2.53.0


^ permalink raw reply related	[flat|nested] 17+ messages in thread

* [RFC PATCH 11/12] build: make EAL an explicit dependency
  2026-10-16 10:59 [RFC PATCH 00/12] Add config-time dependency tracking Bruce Richardson
                   ` (9 preceding siblings ...)
  2026-10-16 10:59 ` [RFC PATCH 10/12] build: add EAL common directory to global include list Bruce Richardson
@ 2026-10-16 10:59 ` Bruce Richardson
  2026-10-16 10:59 ` [RFC PATCH 12/12] build: simplify mandatory library lists Bruce Richardson
  2026-10-16 14:35 ` [RFC PATCH 00/12] Add config-time dependency tracking David Marchand
  12 siblings, 0 replies; 17+ messages in thread
From: Bruce Richardson @ 2026-10-16 10:59 UTC (permalink / raw)
  To: dev; +Cc: Bruce Richardson

To improve dependency tracking using the querying script, remove EAL as
an automatic dependency of libraries, and instead include it explicitly
in the dependency list of libraries that need it (and don't have it via
other existing dependencies).

In the process, we can simplify dependency lists a bit more by removing
the conditional link between EAL and telemetry on windows. Since
telemetry is always built, it can always be present as a dependency of
EAL, and so need not be specified as a dependency when EAL is.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
---
 lib/acl/meson.build          | 1 +
 lib/cfgfile/meson.build      | 1 +
 lib/cryptodev/meson.build    | 2 +-
 lib/dmadev/meson.build       | 2 +-
 lib/eal/meson.build          | 5 +----
 lib/ethdev/meson.build       | 2 +-
 lib/eventdev/meson.build     | 1 -
 lib/ipsec/meson.build        | 2 +-
 lib/jobstats/meson.build     | 1 +
 lib/mempool/meson.build      | 2 +-
 lib/meson.build              | 4 ----
 lib/meter/meson.build        | 1 +
 lib/metrics/meson.build      | 2 +-
 lib/pci/meson.build          | 1 +
 lib/ptr_compress/meson.build | 1 +
 lib/rawdev/meson.build       | 2 +-
 lib/ring/meson.build         | 2 +-
 lib/stack/meson.build        | 1 +
 lib/timer/meson.build        | 1 +
 19 files changed, 17 insertions(+), 17 deletions(-)

diff --git a/lib/acl/meson.build b/lib/acl/meson.build
index a26c111395..e41e1d1d4d 100644
--- a/lib/acl/meson.build
+++ b/lib/acl/meson.build
@@ -9,6 +9,7 @@ endif
 
 cflags += no_wvla_cflag
 
+deps += ['eal']
 sources = files('acl_bld.c', 'acl_gen.c', 'acl_run_scalar.c',
         'rte_acl.c', 'tb_mem.c')
 headers = files('rte_acl.h', 'rte_acl_osdep.h')
diff --git a/lib/cfgfile/meson.build b/lib/cfgfile/meson.build
index 88eb819856..d6d690ccaa 100644
--- a/lib/cfgfile/meson.build
+++ b/lib/cfgfile/meson.build
@@ -1,5 +1,6 @@
 # SPDX-License-Identifier: BSD-3-Clause
 # Copyright(c) 2017 Intel Corporation
 
+deps += ['eal']
 sources = files('rte_cfgfile.c')
 headers = files('rte_cfgfile.h')
diff --git a/lib/cryptodev/meson.build b/lib/cryptodev/meson.build
index 4734acf321..2dcadb3513 100644
--- a/lib/cryptodev/meson.build
+++ b/lib/cryptodev/meson.build
@@ -20,4 +20,4 @@ driver_sdk_headers += files(
         'cryptodev_pmd.h',
 )
 
-deps += ['kvargs', 'mbuf', 'rcu', 'telemetry']
+deps += ['kvargs', 'mbuf', 'rcu']
diff --git a/lib/dmadev/meson.build b/lib/dmadev/meson.build
index 62b0650b9b..4352178783 100644
--- a/lib/dmadev/meson.build
+++ b/lib/dmadev/meson.build
@@ -6,4 +6,4 @@ headers = files('rte_dmadev.h')
 indirect_headers += files('rte_dmadev_core.h', 'rte_dmadev_trace_fp.h')
 driver_sdk_headers += files('rte_dmadev_pmd.h')
 
-deps += ['telemetry']
+deps += ['eal']
diff --git a/lib/eal/meson.build b/lib/eal/meson.build
index e72276a7ca..ee84f4852a 100644
--- a/lib/eal/meson.build
+++ b/lib/eal/meson.build
@@ -13,10 +13,7 @@ subdir(exec_env)
 
 subdir(arch_subdir)
 
-deps += ['argparse', 'kvargs']
-if not is_windows
-    deps += ['telemetry']
-endif
+deps += ['argparse', 'kvargs', 'telemetry']
 
 if dpdk_conf.has('RTE_HAS_LIBARCHIVE')
     ext_deps += libarchive
diff --git a/lib/ethdev/meson.build b/lib/ethdev/meson.build
index 8ba6c708a2..c9c141db02 100644
--- a/lib/ethdev/meson.build
+++ b/lib/ethdev/meson.build
@@ -53,7 +53,7 @@ if is_linux
     )
 endif
 
-deps += ['net', 'kvargs', 'meter', 'telemetry']
+deps += ['net', 'kvargs', 'meter']
 
 if is_freebsd
     annotate_locks = false
diff --git a/lib/eventdev/meson.build b/lib/eventdev/meson.build
index 0797c145e7..6df290bd23 100644
--- a/lib/eventdev/meson.build
+++ b/lib/eventdev/meson.build
@@ -44,4 +44,3 @@ driver_sdk_headers += files(
 )
 
 deps += ['ring', 'ethdev', 'hash', 'mempool', 'mbuf', 'timer', 'cryptodev', 'dmadev']
-deps += ['telemetry']
diff --git a/lib/ipsec/meson.build b/lib/ipsec/meson.build
index 02d18f5829..7c5cb44128 100644
--- a/lib/ipsec/meson.build
+++ b/lib/ipsec/meson.build
@@ -16,6 +16,6 @@ sources = files('esp_inb.c', 'esp_outb.c',
 headers = files('rte_ipsec.h', 'rte_ipsec_sa.h', 'rte_ipsec_sad.h')
 indirect_headers += files('rte_ipsec_group.h')
 
-deps += ['mbuf', 'net', 'cryptodev', 'security', 'hash', 'telemetry']
+deps += ['mbuf', 'net', 'cryptodev', 'security', 'hash']
 
 annotate_locks = false
diff --git a/lib/jobstats/meson.build b/lib/jobstats/meson.build
index 6da2a95b75..b7544aa035 100644
--- a/lib/jobstats/meson.build
+++ b/lib/jobstats/meson.build
@@ -7,5 +7,6 @@ if is_windows
     subdir_done()
 endif
 
+deps += ['eal']
 sources = files('rte_jobstats.c')
 headers = files('rte_jobstats.h')
diff --git a/lib/mempool/meson.build b/lib/mempool/meson.build
index 8099a56466..db67349668 100644
--- a/lib/mempool/meson.build
+++ b/lib/mempool/meson.build
@@ -19,4 +19,4 @@ headers = files(
         'rte_mempool.h',
         'rte_mempool_trace_fp.h',
 )
-deps += ['ring', 'telemetry']
+deps += ['ring']
diff --git a/lib/meson.build b/lib/meson.build
index 16c7a65786..34fbd93977 100644
--- a/lib/meson.build
+++ b/lib/meson.build
@@ -143,10 +143,6 @@ foreach l:libraries
     ext_deps = []
     deps = []
     optional_deps = []
-    if dpdk_conf.has('RTE_LIB_EAL')
-        # eal is standard dependency once built
-        deps += ['eal']
-    endif
 
     if dpdk_libs_deprecated.contains(l)
         if not enable_deprecated_libs.contains(l)
diff --git a/lib/meter/meson.build b/lib/meter/meson.build
index 646fd4d43f..e9e4aba506 100644
--- a/lib/meter/meson.build
+++ b/lib/meter/meson.build
@@ -1,5 +1,6 @@
 # SPDX-License-Identifier: BSD-3-Clause
 # Copyright(c) 2017 Intel Corporation
 
+deps += ['eal']
 sources = files('rte_meter.c')
 headers = files('rte_meter.h')
diff --git a/lib/metrics/meson.build b/lib/metrics/meson.build
index 6722f666d2..7dfc48b3ec 100644
--- a/lib/metrics/meson.build
+++ b/lib/metrics/meson.build
@@ -8,6 +8,6 @@ if dpdk_conf.has('RTE_HAS_JANSSON')
     ext_deps += jansson_dep
 endif
 
-deps += ['ethdev', 'telemetry']
+deps += ['ethdev']
 
 cflags += no_wvla_cflag
diff --git a/lib/pci/meson.build b/lib/pci/meson.build
index dd41cd5068..3b42932ac7 100644
--- a/lib/pci/meson.build
+++ b/lib/pci/meson.build
@@ -1,5 +1,6 @@
 # SPDX-License-Identifier: BSD-3-Clause
 # Copyright(c) 2017 Intel Corporation
 
+deps += ['eal']
 sources = files('rte_pci.c')
 headers = files('rte_pci.h')
diff --git a/lib/ptr_compress/meson.build b/lib/ptr_compress/meson.build
index e92706a45f..07705034ac 100644
--- a/lib/ptr_compress/meson.build
+++ b/lib/ptr_compress/meson.build
@@ -1,4 +1,5 @@
 # SPDX-License-Identifier: BSD-3-Clause
 # Copyright(c) 2024 Arm Limited
 
+deps += ['eal']
 headers = files('rte_ptr_compress.h')
diff --git a/lib/rawdev/meson.build b/lib/rawdev/meson.build
index ccfd922fda..9a2478492c 100644
--- a/lib/rawdev/meson.build
+++ b/lib/rawdev/meson.build
@@ -11,4 +11,4 @@ sources = files('rte_rawdev.c')
 headers = files('rte_rawdev.h')
 driver_sdk_headers = files('rte_rawdev_pmd.h')
 
-deps += ['telemetry']
+deps += ['eal']
diff --git a/lib/ring/meson.build b/lib/ring/meson.build
index 2ba160b178..a1b709836d 100644
--- a/lib/ring/meson.build
+++ b/lib/ring/meson.build
@@ -18,4 +18,4 @@ indirect_headers += files (
         'rte_ring_rts.h',
         'rte_ring_rts_elem_pvt.h',
 )
-deps += ['telemetry']
+deps += ['eal']
diff --git a/lib/stack/meson.build b/lib/stack/meson.build
index 18177a742f..cd569665b9 100644
--- a/lib/stack/meson.build
+++ b/lib/stack/meson.build
@@ -1,6 +1,7 @@
 # SPDX-License-Identifier: BSD-3-Clause
 # Copyright(c) 2019 Intel Corporation
 
+deps += ['eal']
 sources = files('rte_stack.c', 'rte_stack_std.c', 'rte_stack_lf.c')
 headers = files('rte_stack.h')
 # subheaders, not for direct inclusion by apps
diff --git a/lib/timer/meson.build b/lib/timer/meson.build
index 66ef89ac00..a8d89a8d93 100644
--- a/lib/timer/meson.build
+++ b/lib/timer/meson.build
@@ -1,6 +1,7 @@
 # SPDX-License-Identifier: BSD-3-Clause
 # Copyright(c) 2017 Intel Corporation
 
+deps += ['eal']
 sources = files('rte_timer.c')
 headers = files('rte_timer.h')
 
-- 
2.53.0


^ permalink raw reply related	[flat|nested] 17+ messages in thread

* [RFC PATCH 12/12] build: simplify mandatory library lists
  2026-10-16 10:59 [RFC PATCH 00/12] Add config-time dependency tracking Bruce Richardson
                   ` (10 preceding siblings ...)
  2026-10-16 10:59 ` [RFC PATCH 11/12] build: make EAL an explicit dependency Bruce Richardson
@ 2026-10-16 10:59 ` Bruce Richardson
  2026-10-16 14:35 ` [RFC PATCH 00/12] Add config-time dependency tracking David Marchand
  12 siblings, 0 replies; 17+ messages in thread
From: Bruce Richardson @ 2026-10-16 10:59 UTC (permalink / raw)
  To: dev; +Cc: Bruce Richardson

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@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


^ permalink raw reply related	[flat|nested] 17+ messages in thread

* Re: [RFC PATCH 00/12] Add config-time dependency tracking
  2026-10-16 10:59 [RFC PATCH 00/12] Add config-time dependency tracking Bruce Richardson
                   ` (11 preceding siblings ...)
  2026-10-16 10:59 ` [RFC PATCH 12/12] build: simplify mandatory library lists Bruce Richardson
@ 2026-10-16 14:35 ` David Marchand
  2026-10-16 14:44   ` Bruce Richardson
  12 siblings, 1 reply; 17+ messages in thread
From: David Marchand @ 2026-10-16 14:35 UTC (permalink / raw)
  To: Bruce Richardson; +Cc: dev

On Fri, 16 Oct 2026 at 13:00, Bruce Richardson
<bruce.richardson@intel.com> wrote:
>
> Add configuration time dependency tracking for libs and drivers in DPDK,
> so that when a user requests a driver, all dependent drivers also get
> enabled. Similarly with libraries. What is not enabled in this RFC is
> support for enabling libraries based on driver requests, or enabling
> either libs or drivers based on the enable-apps config option. I've
> omitted the former for now, because it would involve moving more logic
> out of the lib/meson.build file and drivers/meson.build files into the
> top-level one, something I'm a little hesitant to do for now. The
> addition of apps only adds value once the cross-type dependency tracking
> is enabled, since no app depends on any others.
>
> The first 5 patches in this series are cleanups and bug fixes. The
> following patches then implement the dependency tracking. While I
> investigated having meson parse each components meson.build file
> initially, without actually building it, this failed to work due to
> logic other than variable assignments in many drivers.
>
> Instead, python scripts are used to manage the dependency list. For
> easier debug, and future introspection this dependency management is
> split between two scripts - the first generates a dependency table file
> which it writes to the build folder, allowing us to analyse this
> post-build if so desired. The second script uses this file to actually
> compute the necessary per-component dependencies.
>
> The final patch of the series is a major reduction in the number of
> required components for doing DPDK builds. We completely remove the list
> of required libraries, and assume that a minimal build should only
> require enough libraries to build EAL. However, EAL does assume that we
> have a few additional buses, for example, EAL args are present for pci
> and vdev. Also, in order for mempools to work, we always need to have
> the default mempool ring driver build. That means that our de-facto
> minimal build target set is the set of components needed to build
> "bus/pci,bus/vdev,mempool/ring" (which would include EAL in the output,
> which is why we can remove any hard-coded library lists)
>
> Bruce Richardson (12):
>   build: fix name of base library object
>   build: fix ignoring requested driver when class is disabled
>   build: prevent overlap of enable and disable lists
>   build: add direct support for optional dependencies
>   net/bond: rename directory for consistency
>   build: add script to generate dependencies list
>   build: use recursive addition for enabled libraries option
>   build: use recursive addition for enabled drivers option
>   build: improve error reporting for unbuildable components
>   build: add EAL common directory to global include list
>   build: make EAL an explicit dependency
>   build: simplify mandatory library lists
>
>  MAINTAINERS                                   |   2 +-
>  app/meson.build                               |  15 +-
>  app/proc-info/meson.build                     |   4 +-
>  app/test-bbdev/meson.build                    |  18 +-
>  app/test-crypto-perf/meson.build              |   4 +-
>  app/test-pmd/meson.build                      |  50 ++---
>  app/test/meson.build                          |   6 -
>  buildtools/get-deps.py                        | 203 ++++++++++++++++++
>  buildtools/meson.build                        |   2 +
>  buildtools/resolve-deps.py                    |  80 +++++++
>  devtools/test-meson-builds.sh                 |   3 +-
>  doc/api/doxy-api.conf.in                      |   2 +-
>  .../link_bonding_poll_mode_drv_lib.rst        |   2 +-
>  doc/guides/testpmd_app_ug/testpmd_funcs.rst   |   2 +-
>  drivers/common/mlx5/linux/meson.build         |   1 -
>  drivers/meson.build                           |  85 ++++++--
>  .../net/{bonding => bond}/bonding_testpmd.c   |   0
>  .../eth_bond_8023ad_private.h                 |   0
>  .../net/{bonding => bond}/eth_bond_private.h  |   0
>  drivers/net/{bonding => bond}/meson.build     |   1 -
>  drivers/net/{bonding => bond}/rte_eth_bond.h  |   0
>  .../{bonding => bond}/rte_eth_bond_8023ad.c   |   0
>  .../{bonding => bond}/rte_eth_bond_8023ad.h   |   0
>  .../net/{bonding => bond}/rte_eth_bond_alb.c  |   0
>  .../net/{bonding => bond}/rte_eth_bond_alb.h  |   0
>  .../net/{bonding => bond}/rte_eth_bond_api.c  |   0
>  .../net/{bonding => bond}/rte_eth_bond_args.c |   0
>  .../net/{bonding => bond}/rte_eth_bond_flow.c |   0
>  .../net/{bonding => bond}/rte_eth_bond_pmd.c  |   0
>  drivers/net/intel/ice/meson.build             |   7 +-
>  drivers/net/meson.build                       |   2 +-
>  lib/acl/meson.build                           |   1 +
>  lib/cfgfile/meson.build                       |   1 +
>  lib/cryptodev/meson.build                     |   2 +-
>  lib/dmadev/meson.build                        |   2 +-
>  lib/eal/meson.build                           |   6 +-
>  lib/ethdev/meson.build                        |   2 +-
>  lib/eventdev/meson.build                      |   1 -
>  lib/ipsec/meson.build                         |   2 +-
>  lib/jobstats/meson.build                      |   1 +
>  lib/log/meson.build                           |   1 -
>  lib/mempool/meson.build                       |   2 +-
>  lib/meson.build                               |  76 +++----
>  lib/meter/meson.build                         |   1 +
>  lib/metrics/meson.build                       |   2 +-
>  lib/pci/meson.build                           |   1 +
>  lib/ptr_compress/meson.build                  |   1 +
>  lib/rawdev/meson.build                        |   2 +-
>  lib/ring/meson.build                          |   2 +-
>  lib/stack/meson.build                         |   1 +
>  lib/timer/meson.build                         |   1 +
>  meson.build                                   |  21 ++
>  52 files changed, 478 insertions(+), 140 deletions(-)
>  create mode 100644 buildtools/get-deps.py
>  create mode 100644 buildtools/resolve-deps.py
>  rename drivers/net/{bonding => bond}/bonding_testpmd.c (100%)
>  rename drivers/net/{bonding => bond}/eth_bond_8023ad_private.h (100%)
>  rename drivers/net/{bonding => bond}/eth_bond_private.h (100%)
>  rename drivers/net/{bonding => bond}/meson.build (95%)
>  rename drivers/net/{bonding => bond}/rte_eth_bond.h (100%)
>  rename drivers/net/{bonding => bond}/rte_eth_bond_8023ad.c (100%)
>  rename drivers/net/{bonding => bond}/rte_eth_bond_8023ad.h (100%)
>  rename drivers/net/{bonding => bond}/rte_eth_bond_alb.c (100%)
>  rename drivers/net/{bonding => bond}/rte_eth_bond_alb.h (100%)
>  rename drivers/net/{bonding => bond}/rte_eth_bond_api.c (100%)
>  rename drivers/net/{bonding => bond}/rte_eth_bond_args.c (100%)
>  rename drivers/net/{bonding => bond}/rte_eth_bond_flow.c (100%)
>  rename drivers/net/{bonding => bond}/rte_eth_bond_pmd.c (100%)

Interesting series.

I did not review in depth, but it seems promising.
The first 4 (and maybe the 5th one) patches can go to 26.11 right now.

I noticed a little formatting issue in patch 9 commitlog.

One thing bothers me.. but I did not play enough with the options maybe...

Could we use new build options (request_libs/apps/drivers or better named) ?
This series changes the enable_libs/apps/drivers semantics and will
likely result in confused users.
(and we would need no support for mixing old and new options)


-- 
David Marchand


^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [RFC PATCH 00/12] Add config-time dependency tracking
  2026-10-16 14:35 ` [RFC PATCH 00/12] Add config-time dependency tracking David Marchand
@ 2026-10-16 14:44   ` Bruce Richardson
  2026-10-16 14:51     ` David Marchand
  0 siblings, 1 reply; 17+ messages in thread
From: Bruce Richardson @ 2026-10-16 14:44 UTC (permalink / raw)
  To: David Marchand; +Cc: dev

On Fri, Oct 16, 2026 at 04:35:51PM +0200, David Marchand wrote:
> On Fri, 16 Oct 2026 at 13:00, Bruce Richardson
> <bruce.richardson@intel.com> wrote:
> >
> > Add configuration time dependency tracking for libs and drivers in DPDK,
> > so that when a user requests a driver, all dependent drivers also get
> > enabled. Similarly with libraries. What is not enabled in this RFC is
> > support for enabling libraries based on driver requests, or enabling
> > either libs or drivers based on the enable-apps config option. I've
> > omitted the former for now, because it would involve moving more logic
> > out of the lib/meson.build file and drivers/meson.build files into the
> > top-level one, something I'm a little hesitant to do for now. The
> > addition of apps only adds value once the cross-type dependency tracking
> > is enabled, since no app depends on any others.
> >
> > The first 5 patches in this series are cleanups and bug fixes. The
> > following patches then implement the dependency tracking. While I
> > investigated having meson parse each components meson.build file
> > initially, without actually building it, this failed to work due to
> > logic other than variable assignments in many drivers.
> >
> > Instead, python scripts are used to manage the dependency list. For
> > easier debug, and future introspection this dependency management is
> > split between two scripts - the first generates a dependency table file
> > which it writes to the build folder, allowing us to analyse this
> > post-build if so desired. The second script uses this file to actually
> > compute the necessary per-component dependencies.
> >
> > The final patch of the series is a major reduction in the number of
> > required components for doing DPDK builds. We completely remove the list
> > of required libraries, and assume that a minimal build should only
> > require enough libraries to build EAL. However, EAL does assume that we
> > have a few additional buses, for example, EAL args are present for pci
> > and vdev. Also, in order for mempools to work, we always need to have
> > the default mempool ring driver build. That means that our de-facto
> > minimal build target set is the set of components needed to build
> > "bus/pci,bus/vdev,mempool/ring" (which would include EAL in the output,
> > which is why we can remove any hard-coded library lists)
> >
> > Bruce Richardson (12):
> >   build: fix name of base library object
> >   build: fix ignoring requested driver when class is disabled
> >   build: prevent overlap of enable and disable lists
> >   build: add direct support for optional dependencies
> >   net/bond: rename directory for consistency
> >   build: add script to generate dependencies list
> >   build: use recursive addition for enabled libraries option
> >   build: use recursive addition for enabled drivers option
> >   build: improve error reporting for unbuildable components
> >   build: add EAL common directory to global include list
> >   build: make EAL an explicit dependency
> >   build: simplify mandatory library lists
> >
> >  MAINTAINERS                                   |   2 +-
> >  app/meson.build                               |  15 +-
> >  app/proc-info/meson.build                     |   4 +-
> >  app/test-bbdev/meson.build                    |  18 +-
> >  app/test-crypto-perf/meson.build              |   4 +-
> >  app/test-pmd/meson.build                      |  50 ++---
> >  app/test/meson.build                          |   6 -
> >  buildtools/get-deps.py                        | 203 ++++++++++++++++++
> >  buildtools/meson.build                        |   2 +
> >  buildtools/resolve-deps.py                    |  80 +++++++
> >  devtools/test-meson-builds.sh                 |   3 +-
> >  doc/api/doxy-api.conf.in                      |   2 +-
> >  .../link_bonding_poll_mode_drv_lib.rst        |   2 +-
> >  doc/guides/testpmd_app_ug/testpmd_funcs.rst   |   2 +-
> >  drivers/common/mlx5/linux/meson.build         |   1 -
> >  drivers/meson.build                           |  85 ++++++--
> >  .../net/{bonding => bond}/bonding_testpmd.c   |   0
> >  .../eth_bond_8023ad_private.h                 |   0
> >  .../net/{bonding => bond}/eth_bond_private.h  |   0
> >  drivers/net/{bonding => bond}/meson.build     |   1 -
> >  drivers/net/{bonding => bond}/rte_eth_bond.h  |   0
> >  .../{bonding => bond}/rte_eth_bond_8023ad.c   |   0
> >  .../{bonding => bond}/rte_eth_bond_8023ad.h   |   0
> >  .../net/{bonding => bond}/rte_eth_bond_alb.c  |   0
> >  .../net/{bonding => bond}/rte_eth_bond_alb.h  |   0
> >  .../net/{bonding => bond}/rte_eth_bond_api.c  |   0
> >  .../net/{bonding => bond}/rte_eth_bond_args.c |   0
> >  .../net/{bonding => bond}/rte_eth_bond_flow.c |   0
> >  .../net/{bonding => bond}/rte_eth_bond_pmd.c  |   0
> >  drivers/net/intel/ice/meson.build             |   7 +-
> >  drivers/net/meson.build                       |   2 +-
> >  lib/acl/meson.build                           |   1 +
> >  lib/cfgfile/meson.build                       |   1 +
> >  lib/cryptodev/meson.build                     |   2 +-
> >  lib/dmadev/meson.build                        |   2 +-
> >  lib/eal/meson.build                           |   6 +-
> >  lib/ethdev/meson.build                        |   2 +-
> >  lib/eventdev/meson.build                      |   1 -
> >  lib/ipsec/meson.build                         |   2 +-
> >  lib/jobstats/meson.build                      |   1 +
> >  lib/log/meson.build                           |   1 -
> >  lib/mempool/meson.build                       |   2 +-
> >  lib/meson.build                               |  76 +++----
> >  lib/meter/meson.build                         |   1 +
> >  lib/metrics/meson.build                       |   2 +-
> >  lib/pci/meson.build                           |   1 +
> >  lib/ptr_compress/meson.build                  |   1 +
> >  lib/rawdev/meson.build                        |   2 +-
> >  lib/ring/meson.build                          |   2 +-
> >  lib/stack/meson.build                         |   1 +
> >  lib/timer/meson.build                         |   1 +
> >  meson.build                                   |  21 ++
> >  52 files changed, 478 insertions(+), 140 deletions(-)
> >  create mode 100644 buildtools/get-deps.py
> >  create mode 100644 buildtools/resolve-deps.py
> >  rename drivers/net/{bonding => bond}/bonding_testpmd.c (100%)
> >  rename drivers/net/{bonding => bond}/eth_bond_8023ad_private.h (100%)
> >  rename drivers/net/{bonding => bond}/eth_bond_private.h (100%)
> >  rename drivers/net/{bonding => bond}/meson.build (95%)
> >  rename drivers/net/{bonding => bond}/rte_eth_bond.h (100%)
> >  rename drivers/net/{bonding => bond}/rte_eth_bond_8023ad.c (100%)
> >  rename drivers/net/{bonding => bond}/rte_eth_bond_8023ad.h (100%)
> >  rename drivers/net/{bonding => bond}/rte_eth_bond_alb.c (100%)
> >  rename drivers/net/{bonding => bond}/rte_eth_bond_alb.h (100%)
> >  rename drivers/net/{bonding => bond}/rte_eth_bond_api.c (100%)
> >  rename drivers/net/{bonding => bond}/rte_eth_bond_args.c (100%)
> >  rename drivers/net/{bonding => bond}/rte_eth_bond_flow.c (100%)
> >  rename drivers/net/{bonding => bond}/rte_eth_bond_pmd.c (100%)
> 
> Interesting series.
> 
> I did not review in depth, but it seems promising.
> The first 4 (and maybe the 5th one) patches can go to 26.11 right now.
> 
> I noticed a little formatting issue in patch 9 commitlog.
> 
> One thing bothers me.. but I did not play enough with the options maybe...
> 
> Could we use new build options (request_libs/apps/drivers or better named) ?
> This series changes the enable_libs/apps/drivers semantics and will
> likely result in confused users.
> (and we would need no support for mixing old and new options)
> 
Can you clarify how it changes the semantic from a user viewpoint? Unless
I'm missing something, the only change is automatically fixing a broken
build for a user who didn't know the dependencies of the driver they want
enabled.

/Bruce

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [RFC PATCH 00/12] Add config-time dependency tracking
  2026-10-16 14:44   ` Bruce Richardson
@ 2026-10-16 14:51     ` David Marchand
  2026-10-16 15:42       ` Bruce Richardson
  0 siblings, 1 reply; 17+ messages in thread
From: David Marchand @ 2026-10-16 14:51 UTC (permalink / raw)
  To: Bruce Richardson; +Cc: dev

On Fri, 16 Oct 2026 at 16:44, Bruce Richardson
<bruce.richardson@intel.com> wrote:
>
> On Fri, Oct 16, 2026 at 04:35:51PM +0200, David Marchand wrote:
> > On Fri, 16 Oct 2026 at 13:00, Bruce Richardson
> > <bruce.richardson@intel.com> wrote:
> > >
> > > Add configuration time dependency tracking for libs and drivers in DPDK,
> > > so that when a user requests a driver, all dependent drivers also get
> > > enabled. Similarly with libraries. What is not enabled in this RFC is
> > > support for enabling libraries based on driver requests, or enabling
> > > either libs or drivers based on the enable-apps config option. I've
> > > omitted the former for now, because it would involve moving more logic
> > > out of the lib/meson.build file and drivers/meson.build files into the
> > > top-level one, something I'm a little hesitant to do for now. The
> > > addition of apps only adds value once the cross-type dependency tracking
> > > is enabled, since no app depends on any others.
> > >
> > > The first 5 patches in this series are cleanups and bug fixes. The
> > > following patches then implement the dependency tracking. While I
> > > investigated having meson parse each components meson.build file
> > > initially, without actually building it, this failed to work due to
> > > logic other than variable assignments in many drivers.
> > >
> > > Instead, python scripts are used to manage the dependency list. For
> > > easier debug, and future introspection this dependency management is
> > > split between two scripts - the first generates a dependency table file
> > > which it writes to the build folder, allowing us to analyse this
> > > post-build if so desired. The second script uses this file to actually
> > > compute the necessary per-component dependencies.
> > >
> > > The final patch of the series is a major reduction in the number of
> > > required components for doing DPDK builds. We completely remove the list
> > > of required libraries, and assume that a minimal build should only
> > > require enough libraries to build EAL. However, EAL does assume that we
> > > have a few additional buses, for example, EAL args are present for pci
> > > and vdev. Also, in order for mempools to work, we always need to have
> > > the default mempool ring driver build. That means that our de-facto
> > > minimal build target set is the set of components needed to build
> > > "bus/pci,bus/vdev,mempool/ring" (which would include EAL in the output,
> > > which is why we can remove any hard-coded library lists)
> > >
> > > Bruce Richardson (12):
> > >   build: fix name of base library object
> > >   build: fix ignoring requested driver when class is disabled
> > >   build: prevent overlap of enable and disable lists
> > >   build: add direct support for optional dependencies
> > >   net/bond: rename directory for consistency
> > >   build: add script to generate dependencies list
> > >   build: use recursive addition for enabled libraries option
> > >   build: use recursive addition for enabled drivers option
> > >   build: improve error reporting for unbuildable components
> > >   build: add EAL common directory to global include list
> > >   build: make EAL an explicit dependency
> > >   build: simplify mandatory library lists
> > >
> > >  MAINTAINERS                                   |   2 +-
> > >  app/meson.build                               |  15 +-
> > >  app/proc-info/meson.build                     |   4 +-
> > >  app/test-bbdev/meson.build                    |  18 +-
> > >  app/test-crypto-perf/meson.build              |   4 +-
> > >  app/test-pmd/meson.build                      |  50 ++---
> > >  app/test/meson.build                          |   6 -
> > >  buildtools/get-deps.py                        | 203 ++++++++++++++++++
> > >  buildtools/meson.build                        |   2 +
> > >  buildtools/resolve-deps.py                    |  80 +++++++
> > >  devtools/test-meson-builds.sh                 |   3 +-
> > >  doc/api/doxy-api.conf.in                      |   2 +-
> > >  .../link_bonding_poll_mode_drv_lib.rst        |   2 +-
> > >  doc/guides/testpmd_app_ug/testpmd_funcs.rst   |   2 +-
> > >  drivers/common/mlx5/linux/meson.build         |   1 -
> > >  drivers/meson.build                           |  85 ++++++--
> > >  .../net/{bonding => bond}/bonding_testpmd.c   |   0
> > >  .../eth_bond_8023ad_private.h                 |   0
> > >  .../net/{bonding => bond}/eth_bond_private.h  |   0
> > >  drivers/net/{bonding => bond}/meson.build     |   1 -
> > >  drivers/net/{bonding => bond}/rte_eth_bond.h  |   0
> > >  .../{bonding => bond}/rte_eth_bond_8023ad.c   |   0
> > >  .../{bonding => bond}/rte_eth_bond_8023ad.h   |   0
> > >  .../net/{bonding => bond}/rte_eth_bond_alb.c  |   0
> > >  .../net/{bonding => bond}/rte_eth_bond_alb.h  |   0
> > >  .../net/{bonding => bond}/rte_eth_bond_api.c  |   0
> > >  .../net/{bonding => bond}/rte_eth_bond_args.c |   0
> > >  .../net/{bonding => bond}/rte_eth_bond_flow.c |   0
> > >  .../net/{bonding => bond}/rte_eth_bond_pmd.c  |   0
> > >  drivers/net/intel/ice/meson.build             |   7 +-
> > >  drivers/net/meson.build                       |   2 +-
> > >  lib/acl/meson.build                           |   1 +
> > >  lib/cfgfile/meson.build                       |   1 +
> > >  lib/cryptodev/meson.build                     |   2 +-
> > >  lib/dmadev/meson.build                        |   2 +-
> > >  lib/eal/meson.build                           |   6 +-
> > >  lib/ethdev/meson.build                        |   2 +-
> > >  lib/eventdev/meson.build                      |   1 -
> > >  lib/ipsec/meson.build                         |   2 +-
> > >  lib/jobstats/meson.build                      |   1 +
> > >  lib/log/meson.build                           |   1 -
> > >  lib/mempool/meson.build                       |   2 +-
> > >  lib/meson.build                               |  76 +++----
> > >  lib/meter/meson.build                         |   1 +
> > >  lib/metrics/meson.build                       |   2 +-
> > >  lib/pci/meson.build                           |   1 +
> > >  lib/ptr_compress/meson.build                  |   1 +
> > >  lib/rawdev/meson.build                        |   2 +-
> > >  lib/ring/meson.build                          |   2 +-
> > >  lib/stack/meson.build                         |   1 +
> > >  lib/timer/meson.build                         |   1 +
> > >  meson.build                                   |  21 ++
> > >  52 files changed, 478 insertions(+), 140 deletions(-)
> > >  create mode 100644 buildtools/get-deps.py
> > >  create mode 100644 buildtools/resolve-deps.py
> > >  rename drivers/net/{bonding => bond}/bonding_testpmd.c (100%)
> > >  rename drivers/net/{bonding => bond}/eth_bond_8023ad_private.h (100%)
> > >  rename drivers/net/{bonding => bond}/eth_bond_private.h (100%)
> > >  rename drivers/net/{bonding => bond}/meson.build (95%)
> > >  rename drivers/net/{bonding => bond}/rte_eth_bond.h (100%)
> > >  rename drivers/net/{bonding => bond}/rte_eth_bond_8023ad.c (100%)
> > >  rename drivers/net/{bonding => bond}/rte_eth_bond_8023ad.h (100%)
> > >  rename drivers/net/{bonding => bond}/rte_eth_bond_alb.c (100%)
> > >  rename drivers/net/{bonding => bond}/rte_eth_bond_alb.h (100%)
> > >  rename drivers/net/{bonding => bond}/rte_eth_bond_api.c (100%)
> > >  rename drivers/net/{bonding => bond}/rte_eth_bond_args.c (100%)
> > >  rename drivers/net/{bonding => bond}/rte_eth_bond_flow.c (100%)
> > >  rename drivers/net/{bonding => bond}/rte_eth_bond_pmd.c (100%)
> >
> > Interesting series.
> >
> > I did not review in depth, but it seems promising.
> > The first 4 (and maybe the 5th one) patches can go to 26.11 right now.
> >
> > I noticed a little formatting issue in patch 9 commitlog.
> >
> > One thing bothers me.. but I did not play enough with the options maybe...
> >
> > Could we use new build options (request_libs/apps/drivers or better named) ?
> > This series changes the enable_libs/apps/drivers semantics and will
> > likely result in confused users.
> > (and we would need no support for mixing old and new options)
> >
> Can you clarify how it changes the semantic from a user viewpoint? Unless
> I'm missing something, the only change is automatically fixing a broken
> build for a user who didn't know the dependencies of the driver they want
> enabled.

Well, the fact that everything becomes optional is a change in
behavior, and enable_drivers=net/null not enabling ethdev is a problem
to me.
Or I misunderstood the last patch comments.


-- 
David Marchand


^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [RFC PATCH 00/12] Add config-time dependency tracking
  2026-10-16 14:51     ` David Marchand
@ 2026-10-16 15:42       ` Bruce Richardson
  0 siblings, 0 replies; 17+ messages in thread
From: Bruce Richardson @ 2026-10-16 15:42 UTC (permalink / raw)
  To: David Marchand; +Cc: dev

On Fri, Oct 16, 2026 at 04:51:48PM +0200, David Marchand wrote:
> On Fri, 16 Oct 2026 at 16:44, Bruce Richardson
> <bruce.richardson@intel.com> wrote:
> >
> > On Fri, Oct 16, 2026 at 04:35:51PM +0200, David Marchand wrote:
> > > On Fri, 16 Oct 2026 at 13:00, Bruce Richardson
> > > <bruce.richardson@intel.com> wrote:
> > > >
> > > > Add configuration time dependency tracking for libs and drivers in DPDK,
> > > > so that when a user requests a driver, all dependent drivers also get
> > > > enabled. Similarly with libraries. What is not enabled in this RFC is
> > > > support for enabling libraries based on driver requests, or enabling
> > > > either libs or drivers based on the enable-apps config option. I've
> > > > omitted the former for now, because it would involve moving more logic
> > > > out of the lib/meson.build file and drivers/meson.build files into the
> > > > top-level one, something I'm a little hesitant to do for now. The
> > > > addition of apps only adds value once the cross-type dependency tracking
> > > > is enabled, since no app depends on any others.
> > > >
> > > > The first 5 patches in this series are cleanups and bug fixes. The
> > > > following patches then implement the dependency tracking. While I
> > > > investigated having meson parse each components meson.build file
> > > > initially, without actually building it, this failed to work due to
> > > > logic other than variable assignments in many drivers.
> > > >
> > > > Instead, python scripts are used to manage the dependency list. For
> > > > easier debug, and future introspection this dependency management is
> > > > split between two scripts - the first generates a dependency table file
> > > > which it writes to the build folder, allowing us to analyse this
> > > > post-build if so desired. The second script uses this file to actually
> > > > compute the necessary per-component dependencies.
> > > >
> > > > The final patch of the series is a major reduction in the number of
> > > > required components for doing DPDK builds. We completely remove the list
> > > > of required libraries, and assume that a minimal build should only
> > > > require enough libraries to build EAL. However, EAL does assume that we
> > > > have a few additional buses, for example, EAL args are present for pci
> > > > and vdev. Also, in order for mempools to work, we always need to have
> > > > the default mempool ring driver build. That means that our de-facto
> > > > minimal build target set is the set of components needed to build
> > > > "bus/pci,bus/vdev,mempool/ring" (which would include EAL in the output,
> > > > which is why we can remove any hard-coded library lists)
> > > >
> > > > Bruce Richardson (12):
> > > >   build: fix name of base library object
> > > >   build: fix ignoring requested driver when class is disabled
> > > >   build: prevent overlap of enable and disable lists
> > > >   build: add direct support for optional dependencies
> > > >   net/bond: rename directory for consistency
> > > >   build: add script to generate dependencies list
> > > >   build: use recursive addition for enabled libraries option
> > > >   build: use recursive addition for enabled drivers option
> > > >   build: improve error reporting for unbuildable components
> > > >   build: add EAL common directory to global include list
> > > >   build: make EAL an explicit dependency
> > > >   build: simplify mandatory library lists
> > > >
> > > >  MAINTAINERS                                   |   2 +-
> > > >  app/meson.build                               |  15 +-
> > > >  app/proc-info/meson.build                     |   4 +-
> > > >  app/test-bbdev/meson.build                    |  18 +-
> > > >  app/test-crypto-perf/meson.build              |   4 +-
> > > >  app/test-pmd/meson.build                      |  50 ++---
> > > >  app/test/meson.build                          |   6 -
> > > >  buildtools/get-deps.py                        | 203 ++++++++++++++++++
> > > >  buildtools/meson.build                        |   2 +
> > > >  buildtools/resolve-deps.py                    |  80 +++++++
> > > >  devtools/test-meson-builds.sh                 |   3 +-
> > > >  doc/api/doxy-api.conf.in                      |   2 +-
> > > >  .../link_bonding_poll_mode_drv_lib.rst        |   2 +-
> > > >  doc/guides/testpmd_app_ug/testpmd_funcs.rst   |   2 +-
> > > >  drivers/common/mlx5/linux/meson.build         |   1 -
> > > >  drivers/meson.build                           |  85 ++++++--
> > > >  .../net/{bonding => bond}/bonding_testpmd.c   |   0
> > > >  .../eth_bond_8023ad_private.h                 |   0
> > > >  .../net/{bonding => bond}/eth_bond_private.h  |   0
> > > >  drivers/net/{bonding => bond}/meson.build     |   1 -
> > > >  drivers/net/{bonding => bond}/rte_eth_bond.h  |   0
> > > >  .../{bonding => bond}/rte_eth_bond_8023ad.c   |   0
> > > >  .../{bonding => bond}/rte_eth_bond_8023ad.h   |   0
> > > >  .../net/{bonding => bond}/rte_eth_bond_alb.c  |   0
> > > >  .../net/{bonding => bond}/rte_eth_bond_alb.h  |   0
> > > >  .../net/{bonding => bond}/rte_eth_bond_api.c  |   0
> > > >  .../net/{bonding => bond}/rte_eth_bond_args.c |   0
> > > >  .../net/{bonding => bond}/rte_eth_bond_flow.c |   0
> > > >  .../net/{bonding => bond}/rte_eth_bond_pmd.c  |   0
> > > >  drivers/net/intel/ice/meson.build             |   7 +-
> > > >  drivers/net/meson.build                       |   2 +-
> > > >  lib/acl/meson.build                           |   1 +
> > > >  lib/cfgfile/meson.build                       |   1 +
> > > >  lib/cryptodev/meson.build                     |   2 +-
> > > >  lib/dmadev/meson.build                        |   2 +-
> > > >  lib/eal/meson.build                           |   6 +-
> > > >  lib/ethdev/meson.build                        |   2 +-
> > > >  lib/eventdev/meson.build                      |   1 -
> > > >  lib/ipsec/meson.build                         |   2 +-
> > > >  lib/jobstats/meson.build                      |   1 +
> > > >  lib/log/meson.build                           |   1 -
> > > >  lib/mempool/meson.build                       |   2 +-
> > > >  lib/meson.build                               |  76 +++----
> > > >  lib/meter/meson.build                         |   1 +
> > > >  lib/metrics/meson.build                       |   2 +-
> > > >  lib/pci/meson.build                           |   1 +
> > > >  lib/ptr_compress/meson.build                  |   1 +
> > > >  lib/rawdev/meson.build                        |   2 +-
> > > >  lib/ring/meson.build                          |   2 +-
> > > >  lib/stack/meson.build                         |   1 +
> > > >  lib/timer/meson.build                         |   1 +
> > > >  meson.build                                   |  21 ++
> > > >  52 files changed, 478 insertions(+), 140 deletions(-)
> > > >  create mode 100644 buildtools/get-deps.py
> > > >  create mode 100644 buildtools/resolve-deps.py
> > > >  rename drivers/net/{bonding => bond}/bonding_testpmd.c (100%)
> > > >  rename drivers/net/{bonding => bond}/eth_bond_8023ad_private.h (100%)
> > > >  rename drivers/net/{bonding => bond}/eth_bond_private.h (100%)
> > > >  rename drivers/net/{bonding => bond}/meson.build (95%)
> > > >  rename drivers/net/{bonding => bond}/rte_eth_bond.h (100%)
> > > >  rename drivers/net/{bonding => bond}/rte_eth_bond_8023ad.c (100%)
> > > >  rename drivers/net/{bonding => bond}/rte_eth_bond_8023ad.h (100%)
> > > >  rename drivers/net/{bonding => bond}/rte_eth_bond_alb.c (100%)
> > > >  rename drivers/net/{bonding => bond}/rte_eth_bond_alb.h (100%)
> > > >  rename drivers/net/{bonding => bond}/rte_eth_bond_api.c (100%)
> > > >  rename drivers/net/{bonding => bond}/rte_eth_bond_args.c (100%)
> > > >  rename drivers/net/{bonding => bond}/rte_eth_bond_flow.c (100%)
> > > >  rename drivers/net/{bonding => bond}/rte_eth_bond_pmd.c (100%)
> > >
> > > Interesting series.
> > >
> > > I did not review in depth, but it seems promising.
> > > The first 4 (and maybe the 5th one) patches can go to 26.11 right now.
> > >
> > > I noticed a little formatting issue in patch 9 commitlog.
> > >
> > > One thing bothers me.. but I did not play enough with the options maybe...
> > >
> > > Could we use new build options (request_libs/apps/drivers or better named) ?
> > > This series changes the enable_libs/apps/drivers semantics and will
> > > likely result in confused users.
> > > (and we would need no support for mixing old and new options)
> > >
> > Can you clarify how it changes the semantic from a user viewpoint? Unless
> > I'm missing something, the only change is automatically fixing a broken
> > build for a user who didn't know the dependencies of the driver they want
> > enabled.
> 
> Well, the fact that everything becomes optional is a change in
> behavior, and enable_drivers=net/null not enabling ethdev is a problem
> to me.
> Or I misunderstood the last patch comments.
> 

Ok, I take the point, but that's actually a separate difference from the
majority of the changes. We can actually take the last patch and still keep
ethdev and other libraries as mandatory for compatibility. I just dropped
them since in the past we removed other libs from always_enable without
notice or compat concerns.

/Bruce

^ permalink raw reply	[flat|nested] 17+ messages in thread

end of thread, other threads:[~2026-10-16 15:42 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-10-16 10:59 [RFC PATCH 00/12] Add config-time dependency tracking Bruce Richardson
2026-10-16 10:59 ` [RFC PATCH 01/12] build: fix name of base library object Bruce Richardson
2026-10-16 10:59 ` [RFC PATCH 02/12] build: fix ignoring requested driver when class is disabled Bruce Richardson
2026-10-16 10:59 ` [RFC PATCH 03/12] build: prevent overlap of enable and disable lists Bruce Richardson
2026-10-16 10:59 ` [RFC PATCH 04/12] build: add direct support for optional dependencies Bruce Richardson
2026-10-16 10:59 ` [RFC PATCH 05/12] net/bond: rename directory for consistency Bruce Richardson
2026-10-16 10:59 ` [RFC PATCH 06/12] build: add script to generate dependencies list Bruce Richardson
2026-10-16 10:59 ` [RFC PATCH 07/12] build: use recursive addition for enabled libraries option Bruce Richardson
2026-10-16 10:59 ` [RFC PATCH 08/12] build: use recursive addition for enabled drivers option Bruce Richardson
2026-10-16 10:59 ` [RFC PATCH 09/12] build: improve error reporting for unbuildable components Bruce Richardson
2026-10-16 10:59 ` [RFC PATCH 10/12] build: add EAL common directory to global include list Bruce Richardson
2026-10-16 10:59 ` [RFC PATCH 11/12] build: make EAL an explicit dependency Bruce Richardson
2026-10-16 10:59 ` [RFC PATCH 12/12] build: simplify mandatory library lists Bruce Richardson
2026-10-16 14:35 ` [RFC PATCH 00/12] Add config-time dependency tracking David Marchand
2026-10-16 14:44   ` Bruce Richardson
2026-10-16 14:51     ` David Marchand
2026-10-16 15:42       ` Bruce Richardson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox