From patchwork Thu Feb 25 15:29:01 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bruce Richardson X-Patchwork-Id: 88229 X-Patchwork-Delegate: thomas@monjalon.net Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org 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 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-', From patchwork Thu Feb 25 15:29:02 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bruce Richardson X-Patchwork-Id: 88230 X-Patchwork-Delegate: thomas@monjalon.net Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id D74ADA034F; Thu, 25 Feb 2021 16:29:28 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id B674F1607FB; Thu, 25 Feb 2021 16:29:23 +0100 (CET) Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by mails.dpdk.org (Postfix) with ESMTP id E05D51607FB for ; Thu, 25 Feb 2021 16:29:20 +0100 (CET) IronPort-SDR: WsEfflxxT9WY1oalIJJwQpxhYzhX5g38yVBtYo1aOTqj3X2Ba8xdduIO9CfBaIZypogRpFmzfM pJiViI2trLjA== X-IronPort-AV: E=McAfee;i="6000,8403,9905"; a="249617662" X-IronPort-AV: E=Sophos;i="5.81,206,1610438400"; d="scan'208";a="249617662" 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:20 -0800 IronPort-SDR: MgCH+6tG3x+QJ2dcaz/KSc+uALeGC9DLhm/gZRvdqTD4CLwuiu7grnj4bO2SrLZIcDx2ionaTQ qBr3JDjvo6Xg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.81,206,1610438400"; d="scan'208";a="367432368" Received: from silpixa00399126.ir.intel.com ([10.237.223.204]) by orsmga006.jf.intel.com with ESMTP; 25 Feb 2021 07:29:19 -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:02 +0000 Message-Id: <20210225152903.148347-3-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 Subject: [dpdk-dev] [PATCH 2/3] build: hide debug messages in non-developer mode 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" The messages about what components have what dependency names, and information about function versioning not being supported on windows are only of interest to developers, so hide them when building in non-developer mode. Signed-off-by: Bruce Richardson --- drivers/meson.build | 6 ++++-- lib/meson.build | 10 ++++++---- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/drivers/meson.build b/drivers/meson.build index fdf76120ac..b26051c21c 100644 --- a/drivers/meson.build +++ b/drivers/meson.build @@ -208,8 +208,10 @@ foreach subpath:subdirs set_variable('shared_@0@'.format(lib_name), shared_dep) set_variable('static_@0@'.format(lib_name), static_dep) dependency_name = ''.join(lib_name.split('rte_')) - message('drivers/@0@: Defining dependency "@1@"'.format( - drv_path, dependency_name)) + if developer_mode + message('drivers/@0@: Defining dependency "@1@"'.format( + drv_path, dependency_name)) + endif endif # build endforeach diff --git a/lib/meson.build b/lib/meson.build index 7712aa4977..b378050299 100644 --- a/lib/meson.build +++ b/lib/meson.build @@ -115,9 +115,9 @@ foreach l:libraries shared_dep = declare_dependency(include_directories: includes) static_dep = shared_dep else - if is_windows and use_function_versioning + if is_windows and use_function_versioning and developer_mode message('@0@: Function versioning is not supported by Windows.' - .format(name)) + .format(name)) endif if use_function_versioning @@ -206,7 +206,9 @@ foreach l:libraries set_variable('shared_rte_' + name, shared_dep) set_variable('static_rte_' + name, static_dep) - message('lib/@0@: Defining dependency "@1@"'.format( - dir_name, name)) + if developer_mode + message('lib/@0@: Defining dependency "@1@"'.format( + dir_name, name)) + endif endif # if build endforeach From patchwork Thu Feb 25 15:29:03 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bruce Richardson X-Patchwork-Id: 88231 X-Patchwork-Delegate: thomas@monjalon.net Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id E1CAEA034F; Thu, 25 Feb 2021 16:29:35 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 056B4160884; Thu, 25 Feb 2021 16:29:26 +0100 (CET) Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by mails.dpdk.org (Postfix) with ESMTP id F417A40692 for ; Thu, 25 Feb 2021 16:29:22 +0100 (CET) IronPort-SDR: aDcjRomAwC79mCw2Vp3lksil0q2o8886FFU401Hr9+OyXplgYEIFsGNK3bJnbZFwXvTgJXMjT7 qJc3/dteyaLQ== X-IronPort-AV: E=McAfee;i="6000,8403,9905"; a="249617674" X-IronPort-AV: E=Sophos;i="5.81,206,1610438400"; d="scan'208";a="249617674" 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:22 -0800 IronPort-SDR: k8EEi/HenQXNl9quuYoOeUwDv5iqLUVZrSLYtA6VdOJRW7YqLnImsv0COhJ5AxYVqbXNRHhMlM v62mYebx8kRQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.81,206,1610438400"; d="scan'208";a="367432377" Received: from silpixa00399126.ir.intel.com ([10.237.223.204]) by orsmga006.jf.intel.com with ESMTP; 25 Feb 2021 07:29:21 -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:03 +0000 Message-Id: <20210225152903.148347-4-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 Subject: [dpdk-dev] [PATCH 3/3] build: limit symbol checks to developer mode 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" The checking of symbols within each library and driver is only of interest to developers, so limit to developer mode only. Signed-off-by: Bruce Richardson --- drivers/meson.build | 20 +++++++++++--------- lib/meson.build | 2 +- 2 files changed, 12 insertions(+), 10 deletions(-) diff --git a/drivers/meson.build b/drivers/meson.build index b26051c21c..54af1f132f 100644 --- a/drivers/meson.build +++ b/drivers/meson.build @@ -170,15 +170,17 @@ foreach subpath:subdirs endif else lk_args = ['-Wl,--version-script=' + version_map] - # on unix systems check the output of the - # check-symbols.sh script, using it as a - # dependency of the .so build - lk_deps += custom_target(lib_name + '.sym_chk', - command: [check_symbols, - version_map, '@INPUT@'], - capture: true, - input: static_lib, - output: lib_name + '.sym_chk') + if developer_mode + # on unix systems check the output of the + # check-symbols.sh script, using it as a + # dependency of the .so build + lk_deps += custom_target(lib_name + '.sym_chk', + command: [check_symbols, + version_map, '@INPUT@'], + capture: true, + input: static_lib, + output: lib_name + '.sym_chk') + endif endif shared_lib = shared_library(lib_name, diff --git a/lib/meson.build b/lib/meson.build index b378050299..d003ad3dfe 100644 --- a/lib/meson.build +++ b/lib/meson.build @@ -173,7 +173,7 @@ foreach l:libraries endif lk_deps = [version_map, def_file, mingw_map] - if not is_windows + if developer_mode and not is_windows # on unix systems check the output of the # check-symbols.sh script, using it as a # dependency of the .so build