All of lore.kernel.org
 help / color / mirror / Atom feed
From: Bruce Richardson <bruce.richardson@intel.com>
To: dev@dpdk.org
Cc: Bruce Richardson <bruce.richardson@intel.com>
Subject: [PATCH] build: improve error message for missing dependency
Date: Fri, 20 Jul 2018 14:28:25 +0100	[thread overview]
Message-ID: <20180720132825.772-1-bruce.richardson@intel.com> (raw)

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

             reply	other threads:[~2018-07-20 13:28 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-07-20 13:28 Bruce Richardson [this message]
2018-07-26  8:05 ` [PATCH] build: improve error message for missing dependency Thomas Monjalon

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180720132825.772-1-bruce.richardson@intel.com \
    --to=bruce.richardson@intel.com \
    --cc=dev@dpdk.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.