From: Bruce Richardson <bruce.richardson@intel.com>
To: dev@dpdk.org
Cc: thomas@monjalon.net, david.marchand@redhat.com,
Bruce Richardson <bruce.richardson@intel.com>
Subject: [dpdk-dev] [PATCH 1/3] build: enable a developer mode setting
Date: Thu, 25 Feb 2021 15:29:01 +0000 [thread overview]
Message-ID: <20210225152903.148347-2-bruce.richardson@intel.com> (raw)
In-Reply-To: <20210225152903.148347-1-bruce.richardson@intel.com>
To allow support for additional build checks and tests only really
relevant for developers, we add support for a developer mode option to
DPDK. The default, "auto", value for this enables developer mode if a
".git" folder is found at the root of the source tree - as was the case
with the previous "make" build system. There is also support for
explicitly enabling or disabling this option using "meson configure" if
so desired.
Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
---
doc/guides/contributing/coding_style.rst | 8 ++++++++
meson.build | 14 ++++++++++++++
meson_options.txt | 2 ++
3 files changed, 24 insertions(+)
diff --git a/doc/guides/contributing/coding_style.rst b/doc/guides/contributing/coding_style.rst
index 734d1901b2..fdcd21861d 100644
--- a/doc/guides/contributing/coding_style.rst
+++ b/doc/guides/contributing/coding_style.rst
@@ -798,6 +798,14 @@ Integrating with the Build System
DPDK is built using the tools ``meson`` and ``ninja``.
+.. note::
+
+ In order to catch possible issues as soon as possible,
+ it is recommended that developers build DPDK in "developer mode" to enable additional checks.
+ By default, this mode is enabled if the build is being done from a git checkout,
+ but the mode can be manually enabled/disabled using the
+ ``developer_mode`` meson configuration option.
+
Therefore all new component additions should include a ``meson.build`` file,
and should be added to the component lists in the ``meson.build`` files in the
relevant top-level directory:
diff --git a/meson.build b/meson.build
index fcc4d4c900..8906b5e0b5 100644
--- a/meson.build
+++ b/meson.build
@@ -11,6 +11,20 @@ project('DPDK', 'C',
meson_version: '>= 0.47.1'
)
+# check for developer mode
+developer_mode = false
+if get_option('developer_mode').auto()
+ if meson.version().version_compare('>=0.53') # fs module available
+ fs = import('fs')
+ developer_mode = fs.is_dir('.git')
+ endif
+else
+ developer_mode = get_option('developer_mode').enabled()
+endif
+if developer_mode
+ message('## Building in Developer Mode ##')
+endif
+
# set up some global vars for compiler, platform, configuration, etc.
cc = meson.get_compiler('c')
dpdk_conf = configuration_data()
diff --git a/meson_options.txt b/meson_options.txt
index 6eff62e47d..fe0f9ed501 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -2,6 +2,8 @@
option('check_includes', type: 'boolean', value: false,
description: 'build "chkincs" to verify each header file can compile alone')
+option('developer_mode', type: 'feature',
+ description: 'turn on additional build checks relevant for DPDK developers')
option('disable_drivers', type: 'string', value: '',
description: 'Comma-separated list of drivers to explicitly disable.')
option('drivers_install_subdir', type: 'string', value: 'dpdk/pmds-<VERSION>',
--
2.27.0
next prev parent reply other threads:[~2021-02-25 15:29 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-02-25 15:29 [dpdk-dev] [PATCH 0/3] Add developer mode to DPDK build Bruce Richardson
2021-02-25 15:29 ` Bruce Richardson [this message]
2021-02-25 15:29 ` [dpdk-dev] [PATCH 2/3] build: hide debug messages in non-developer mode Bruce Richardson
2021-02-25 15:29 ` [dpdk-dev] [PATCH 3/3] build: limit symbol checks to developer mode Bruce Richardson
2021-02-25 19:50 ` [dpdk-dev] [PATCH 0/3] Add developer mode to DPDK build Thomas Monjalon
2021-04-09 17:05 ` 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=20210225152903.148347-2-bruce.richardson@intel.com \
--to=bruce.richardson@intel.com \
--cc=david.marchand@redhat.com \
--cc=dev@dpdk.org \
--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).