DPDK patches and discussions
 help / color / mirror / Atom feed
* [PATCH 1/2] build: fail if explicitly requested lib is unbuildable
@ 2023-09-01 14:23 Bruce Richardson
  2023-09-01 14:23 ` [PATCH 2/2] build: fail if explicitly requested driver " Bruce Richardson
                   ` (5 more replies)
  0 siblings, 6 replies; 13+ messages in thread
From: Bruce Richardson @ 2023-09-01 14:23 UTC (permalink / raw)
  To: dev; +Cc: Bruce Richardson

When the user passes a list of desired libraries to build via the
"enable_libs" option, the expectation is that those libraries should be
part of the build. However, if those libs have either external or
internal dependencies, they still may be silently disabled, for example:
running "meson setup -Denable_libs=security build" will successfully
run, but the security lib will not be configured as "cryptodev" is
missing.

We can fix this by setting a flag to indicate when the libraries are
specified via an enable_libs flag. If so, then we error out when a
library is unbuildable, giving a suitable error message. For the above
example case, the "meson setup" run fails with:

Message: Disabling security [lib/security]: missing internal dependency "cryptodev"

lib/meson.build:218:16: ERROR: Problem encountered: Cannot build explicitly requested lib "security".
	Please add missing dependency "cryptodev" to "enable_libs" option

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

diff --git a/lib/meson.build b/lib/meson.build
index 099b0ed18a..cf4aa63630 100644
--- a/lib/meson.build
+++ b/lib/meson.build
@@ -131,7 +131,9 @@ 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()
+require_libs = true
 if enable_libs.length() == 0
+    require_libs = false
     enable_libs += optional_libs
 endif
 enable_libs += always_enable
@@ -189,6 +191,10 @@ foreach l:libraries
 
     if build
         subdir(l)
+        if not build and require_libs
+            error('Cannot build explicitly requested lib "@0@".\n'.format(name)
+                    +'\tReason: ' + reason)
+        endif
     endif
     if name != l
         warning('Library name, "@0@", and directory name, "@1@", do not match'.format(name, l))
@@ -208,6 +214,10 @@ foreach l:libraries
             endif
             message('Disabling @1@ [@2@]: missing internal dependency "@0@"'
                     .format(d, name, 'lib/' + l))
+            if require_libs
+                error('Cannot build explicitly requested lib "@0@".\n'.format(name)
+                        + '\tPlease add missing dependency "@0@" to "enable_libs" option'.format(d))
+            endif
         else
             shared_deps += [get_variable('shared_rte_' + d)]
             static_deps += [get_variable('static_rte_' + d)]
-- 
2.39.2


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

end of thread, other threads:[~2023-09-21  7:02 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-09-01 14:23 [PATCH 1/2] build: fail if explicitly requested lib is unbuildable Bruce Richardson
2023-09-01 14:23 ` [PATCH 2/2] build: fail if explicitly requested driver " Bruce Richardson
2023-09-01 15:41   ` Morten Brørup
2023-09-02 17:24     ` Patrick Robb
2023-09-14  9:42       ` Bruce Richardson
2023-09-01 14:29 ` [PATCH 1/2] build: fail if explicitly requested lib " David Marchand
2023-09-01 14:30   ` David Marchand
2023-09-01 14:44     ` Bruce Richardson
2023-09-04 13:38       ` David Marchand
2023-09-01 15:40 ` Morten Brørup
2023-09-14  9:53 ` Bruce Richardson
2023-09-19 15:57 ` Bruce Richardson
2023-09-21  7:01 ` David Marchand

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).