DPDK patches and discussions
 help / color / mirror / Atom feed
From: Bruce Richardson <bruce.richardson@intel.com>
To: bluca@debian.org, thomas@monjalon.net
Cc: dev@dpdk.org, john.mcnamara@intel.com,
	Bruce Richardson <bruce.richardson@intel.com>
Subject: [dpdk-dev] [PATCH 01/10] build: print list of disabled components for meson build
Date: Wed,  5 Jun 2019 21:22:39 +0100	[thread overview]
Message-ID: <20190605202248.394-2-bruce.richardson@intel.com> (raw)
In-Reply-To: <20190605202248.394-1-bruce.richardson@intel.com>

When configuring with meson we print out a list of enabled components, but
it is also useful to list out the disabled components and the reasons why.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
---
 doc/guides/contributing/coding_style.rst | 15 ++++++++++++++-
 drivers/meson.build                      | 12 +++++++++++-
 lib/meson.build                          |  6 +++++-
 meson.build                              | 15 +++++++++++++++
 4 files changed, 45 insertions(+), 3 deletions(-)

diff --git a/doc/guides/contributing/coding_style.rst b/doc/guides/contributing/coding_style.rst
index a5d5897f3..449b33494 100644
--- a/doc/guides/contributing/coding_style.rst
+++ b/doc/guides/contributing/coding_style.rst
@@ -852,12 +852,15 @@ allow_experimental_apis
 build
 	**Default Value = true**
 	Used to optionally compile a library, based on its dependencies or
-	environment. A simple example of use would be:
+	environment. When set to "false" the ``reason`` value, explained below, should
+	also be set to explain to the user why the component is not being built.
+	A simple example of use would be:
 
 .. code-block:: python
 
 	if not is_linux
 	        build = false
+	        reason = 'only supported on Linux'
 	endif
 
 
@@ -938,6 +941,13 @@ objs
 	objects that were compiled up as part of another target given in the
 	included library ``meson.build`` file.
 
+reason
+	**Default Value = '<unknown reason>'**.
+	This variable should be used when a library is not to be built i.e. when
+	``build`` is set to "false", to specify the reason why a library will not be
+	built. For missing dependencies this should be of the form
+	``'missing dependency, "libname"'``.
+
 version
 	**Default Value = 1**.
 	Specifies the ABI version of the library, and is used as the major
@@ -991,6 +1001,9 @@ pkgconfig_extra_libs
 	using static libraries. Anything added here will be appended to the end
 	of the ``pkgconfig --libs`` output.
 
+reason
+	As above.
+
 sources [mandatory]
 	As above
 
diff --git a/drivers/meson.build b/drivers/meson.build
index 4c444f495..94e6c829e 100644
--- a/drivers/meson.build
+++ b/drivers/meson.build
@@ -40,6 +40,7 @@ foreach class:dpdk_driver_classes
 
 		# set up empty variables used for build
 		build = true # set to false to disable, e.g. missing deps
+		reason = '<unknown reason>' # set if build == false to explain
 		name = drv
 		version = 1
 		allow_experimental_apis = false
@@ -61,7 +62,16 @@ foreach class:dpdk_driver_classes
 		# pull in driver directory which should assign to each of the above
 		subdir(drv_path)
 
-		if build
+		if not build
+			# some driver directories are placeholders which
+			# are never built, so we allow suppression of the
+			# component disable printout in those cases
+			if reason != ''
+				dpdk_drvs_disabled += drv_path
+				set_variable(drv_path.underscorify() +
+						'_disable_reason', reason)
+			endif
+		else
 			class_drivers += name
 
 			dpdk_conf.set(config_flag_fmt.format(name.to_upper()),1)
diff --git a/lib/meson.build b/lib/meson.build
index e067ce5ea..76c13b7da 100644
--- a/lib/meson.build
+++ b/lib/meson.build
@@ -46,6 +46,7 @@ default_cflags += '-D_GNU_SOURCE'
 
 foreach l:libraries
 	build = true
+	reason = '<unknown reason>' # set if build == false to explain why
 	name = l
 	version = 1
 	allow_experimental_apis = false
@@ -68,7 +69,10 @@ foreach l:libraries
 	dir_name = 'librte_' + l
 	subdir(dir_name)
 
-	if build
+	if not build
+		dpdk_libs_disabled += name
+		set_variable(name.underscorify() + '_disable_reason', reason)
+	else
 		enabled_libs += name
 		dpdk_conf.set('RTE_LIBRTE_' + name.to_upper(), 1)
 		install_headers(headers)
diff --git a/meson.build b/meson.build
index 9cad43481..63a1ce25b 100644
--- a/meson.build
+++ b/meson.build
@@ -20,6 +20,8 @@ dpdk_driver_classes = []
 dpdk_drivers = []
 dpdk_extra_ldflags = []
 dpdk_app_link_libraries = []
+dpdk_libs_disabled = []
+dpdk_drvs_disabled = []
 
 # configure the build, and make sure configs here and in config folder are
 # able to be included in any file. We also store a global array of include dirs
@@ -108,3 +110,16 @@ foreach class:dpdk_driver_classes
 	endforeach
 endforeach
 message(output_message + '\n')
+
+output_message = '\n=================\nContent Skipped\n=================\n'
+output_message += '\nlibs:\n\t'
+foreach lib:dpdk_libs_disabled
+	reason = get_variable(lib.underscorify() + '_disable_reason')
+	output_message += lib + ':\t' + reason + '\n\t'
+endforeach
+output_message += '\ndrivers:\n\t'
+foreach drv:dpdk_drvs_disabled
+	reason = get_variable(drv.underscorify() + '_disable_reason')
+	output_message += drv + ':\t' + reason + '\n\t'
+endforeach
+message(output_message + '\n')
-- 
2.21.0


  reply	other threads:[~2019-06-05 20:23 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-06-05 20:22 [dpdk-dev] [PATCH 00/10] enhance meson summary - list disabled components Bruce Richardson
2019-06-05 20:22 ` Bruce Richardson [this message]
2019-06-05 20:22 ` [dpdk-dev] [PATCH 02/10] lib: add reasons for components being disabled Bruce Richardson
2019-06-05 20:22 ` [dpdk-dev] [PATCH 03/10] drivers/bus: " Bruce Richardson
2019-06-05 20:22 ` [dpdk-dev] [PATCH 04/10] drivers/common: " Bruce Richardson
2019-06-05 20:22 ` [dpdk-dev] [PATCH 05/10] drivers/compress: " Bruce Richardson
2019-06-05 20:22 ` [dpdk-dev] [PATCH 06/10] drivers/crypto: " Bruce Richardson
2019-06-05 20:22 ` [dpdk-dev] [PATCH 07/10] drivers/event: " Bruce Richardson
2019-06-05 20:22 ` [dpdk-dev] [PATCH 08/10] drivers/mempool: " Bruce Richardson
2019-06-05 20:22 ` [dpdk-dev] [PATCH 09/10] drivers/net: " Bruce Richardson
2019-06-05 20:22 ` [dpdk-dev] [PATCH 10/10] drivers/raw: " Bruce Richardson
2019-06-05 20:39 ` [dpdk-dev] [PATCH 00/10] enhance meson summary - list disabled components Luca Boccassi
2019-06-18 13:18   ` Bruce Richardson
2019-07-02 21:21   ` 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=20190605202248.394-2-bruce.richardson@intel.com \
    --to=bruce.richardson@intel.com \
    --cc=bluca@debian.org \
    --cc=dev@dpdk.org \
    --cc=john.mcnamara@intel.com \
    --cc=thomas@monjalon.net \
    /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 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).