DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] build: improve error message for missing dependency
@ 2018-07-20 13:28 Bruce Richardson
  2018-07-26  8:05 ` Thomas Monjalon
  0 siblings, 1 reply; 2+ messages in thread
From: Bruce Richardson @ 2018-07-20 13:28 UTC (permalink / raw)
  To: dev; +Cc: Bruce Richardson

When building a driver or library and a required internal dependency
is missing, the error message printed was:

    Tried to get unknown variable "shared_rte_<libname>".

However, a better way to handle this is to catch the missing variable
earlier and convert it into a proper message, informing the user
that the required dependency is missing, and most importantly, what
library or driver wanted that dependency.

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

diff --git a/drivers/meson.build b/drivers/meson.build
index 82cc8ed49..f94e2fe67 100644
--- a/drivers/meson.build
+++ b/drivers/meson.build
@@ -62,6 +62,10 @@ foreach class:driver_classes
 			shared_objs = []
 			static_objs = []
 			foreach d:deps
+				if not is_variable('shared_rte_' + d)
+					error('Missing dependency ' + d +
+						' for driver ' + lib_name)
+				endif
 				shared_objs += [get_variable('shared_rte_' + d)]
 				static_objs += [get_variable('static_rte_' + d)]
 			endforeach
diff --git a/lib/meson.build b/lib/meson.build
index 4384813f8..71f35d162 100644
--- a/lib/meson.build
+++ b/lib/meson.build
@@ -69,6 +69,10 @@ foreach l:libraries
 			shared_deps = ext_deps
 			static_deps = ext_deps
 			foreach d:deps
+				if not is_variable('shared_rte_' + d)
+					error('Missing dependency ' + d +
+						' for library ' + lib_name)
+				endif
 				shared_deps += [get_variable('shared_rte_' + d)]
 				static_deps += [get_variable('static_rte_' + d)]
 			endforeach
-- 
2.17.0

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

end of thread, other threads:[~2018-07-26  8:05 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-07-20 13:28 [dpdk-dev] [PATCH] build: improve error message for missing dependency Bruce Richardson
2018-07-26  8:05 ` Thomas Monjalon

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).