From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id B9869A034F; Thu, 25 Feb 2021 16:29:21 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 7A6A41607FF; Thu, 25 Feb 2021 16:29:17 +0100 (CET) Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by mails.dpdk.org (Postfix) with ESMTP id 7239A1607FB for ; Thu, 25 Feb 2021 16:29:16 +0100 (CET) IronPort-SDR: dpK10xCVsyCvBjMh1b8uP26kd0H2hAXrHjDL7f3gtfJNtru18XBl6p7Afa9W4X/1/5qXl1BUq1 NxLY/epU1iJQ== X-IronPort-AV: E=McAfee;i="6000,8403,9905"; a="249617656" X-IronPort-AV: E=Sophos;i="5.81,206,1610438400"; d="scan'208";a="249617656" Received: from orsmga006.jf.intel.com ([10.7.209.51]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 25 Feb 2021 07:29:16 -0800 IronPort-SDR: k2i23h647STxuO4wbtW6O6uu1YnTKfF4TWEhB2fhWVXjeQqdvs2QpDlsFutQ+fMV3MqCvwGZP7 JJCclNF+l5+g== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.81,206,1610438400"; d="scan'208";a="367432351" Received: from silpixa00399126.ir.intel.com ([10.237.223.204]) by orsmga006.jf.intel.com with ESMTP; 25 Feb 2021 07:29:14 -0800 From: Bruce Richardson To: dev@dpdk.org Cc: thomas@monjalon.net, david.marchand@redhat.com, Bruce Richardson Date: Thu, 25 Feb 2021 15:29:01 +0000 Message-Id: <20210225152903.148347-2-bruce.richardson@intel.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20210225152903.148347-1-bruce.richardson@intel.com> References: <20210225152903.148347-1-bruce.richardson@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-dev] [PATCH 1/3] build: enable a developer mode setting X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" 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 --- 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-', -- 2.27.0