[v2] build: don't parse build configs of explicitly disabled drivers

Message ID 20200507101350.123873-1-dariusz.stojaczyk@intel.com (mailing list archive)
State Accepted, archived
Delegated to: Thomas Monjalon
Headers
Series [v2] build: don't parse build configs of explicitly disabled drivers |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/iol-intel-Performance success Performance Testing PASS
ci/iol-nxp-Performance success Performance Testing PASS
ci/travis-robot warning Travis build: failed
ci/Intel-compilation fail Compilation issues
ci/iol-mellanox-Performance success Performance Testing PASS
ci/iol-testing success Testing PASS

Commit Message

Stojaczyk, Dariusz May 7, 2020, 10:13 a.m. UTC
  Even when a PMD was disabled with meson's disable_drivers option
its config file was still being parsed. Some of the PMD configs
attempt to find a library they depend on and parse its header files
with certain assumptions. If the library is found, but it's simply
too old to contain the necessary header files, the meson build
fails and it can only be fixed by either updating that library, or
expanding the meson script for the faulty PMD.

While the latter should be still done for the sake of DPDK quality,
an intermediate solution would be to skip building the faulty PMD
- there's a chance we don't need it. That's what this patch allows.

Signed-off-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
---
v2:
 - simplified the code with if X.contains(), as Bruce suggested
 - removed the related comment from the code - it should be
   self-documented now

 drivers/meson.build | 19 ++++++++-----------
 1 file changed, 8 insertions(+), 11 deletions(-)
  

Comments

Thomas Monjalon May 19, 2020, 2:50 p.m. UTC | #1
07/05/2020 12:13, Darek Stojaczyk:
> Even when a PMD was disabled with meson's disable_drivers option
> its config file was still being parsed. Some of the PMD configs
> attempt to find a library they depend on and parse its header files
> with certain assumptions. If the library is found, but it's simply
> too old to contain the necessary header files, the meson build
> fails and it can only be fixed by either updating that library, or
> expanding the meson script for the faulty PMD.
> 
> While the latter should be still done for the sake of DPDK quality,
> an intermediate solution would be to skip building the faulty PMD
> - there's a chance we don't need it. That's what this patch allows.
> 
> Signed-off-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
> Acked-by: Bruce Richardson <bruce.richardson@intel.com>
> ---
> v2:
>  - simplified the code with if X.contains(), as Bruce suggested
>  - removed the related comment from the code - it should be
>    self-documented now

Applied, thanks
  

Patch

diff --git a/drivers/meson.build b/drivers/meson.build
index 72eec46088..483226a789 100644
--- a/drivers/meson.build
+++ b/drivers/meson.build
@@ -57,17 +57,14 @@  foreach class:dpdk_driver_classes
 		ext_deps = []
 		pkgconfig_extra_libs = []
 
-		# pull in driver directory which should assign to each of the above
-		subdir(drv_path)
-
-		# skip disabled drivers. For meson 0.49 change this to use
-		# "in" keyword
-		foreach disable_path: disabled_drivers
-			if drv_path == disable_path
-				build = false
-				reason = 'Explicitly disabled via build config'
-			endif
-		endforeach
+		if disabled_drivers.contains(drv_path)
+			build = false
+			reason = 'Explicitly disabled via build config'
+		else
+			# pull in driver directory which should update all the local variables
+			subdir(drv_path)
+		endif
+
 		if build
 			# get dependency objs from strings
 			shared_deps = ext_deps