From patchwork Wed Nov 11 15:56:46 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bruce Richardson X-Patchwork-Id: 84025 X-Patchwork-Delegate: thomas@monjalon.net Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 36AC0A09D9; Wed, 11 Nov 2020 16:57:14 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 082C2592B; Wed, 11 Nov 2020 16:57:01 +0100 (CET) Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by dpdk.org (Postfix) with ESMTP id 9FAB75916; Wed, 11 Nov 2020 16:56:57 +0100 (CET) IronPort-SDR: g6PGHaHjmnss1oHLyKtsE7mYeaNJBoqDKN2w9spQzjWH3NfWzlBPrNwryw5ffYKSR8E8WfjocB eS0FHCQdi9jA== X-IronPort-AV: E=McAfee;i="6000,8403,9801"; a="157180356" X-IronPort-AV: E=Sophos;i="5.77,469,1596524400"; d="scan'208";a="157180356" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 11 Nov 2020 07:56:55 -0800 IronPort-SDR: mLrx4YEIHUxf7VfEptj5XErfztyyub4X5tshvyrOXPSOvb4M1cIwfsQTuUOausnTERP/xUUQ5Q K/d2inIZeV1w== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.77,469,1596524400"; d="scan'208";a="531745880" Received: from silpixa00399126.ir.intel.com ([10.237.222.4]) by fmsmga005.fm.intel.com with ESMTP; 11 Nov 2020 07:56:54 -0800 From: Bruce Richardson To: dev@dpdk.org Cc: david.marchand@redhat.com, Bruce Richardson , stable@dpdk.org Date: Wed, 11 Nov 2020 15:56:46 +0000 Message-Id: <20201111155647.1720787-1-bruce.richardson@intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20201110170809.1309043-1-bruce.richardson@intel.com> References: <20201110170809.1309043-1-bruce.richardson@intel.com> MIME-Version: 1.0 Subject: [dpdk-dev] [PATCH v2 1/2] examples: fix flattening directory layout on install X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 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" By installing the examples one-by-one in a loop in the examples meson.build file we effectively flattened out the structure of the examples folder and omitted some common and shared subfolders that were never directly built. Instead, we can remove the loop and just have the whole "examples" folder installed as-is in a single statement, preserving its directory structure, and thereby fixing the build of a number of the examples. Fixes: 2daf565f91b5 ("examples: install as part of ninja install") Cc: stable@dpdk.org Signed-off-by: Bruce Richardson --- examples/meson.build | 7 ------- meson.build | 3 +++ 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/examples/meson.build b/examples/meson.build index f179955325..46ec80919e 100644 --- a/examples/meson.build +++ b/examples/meson.build @@ -47,13 +47,6 @@ all_examples = [ 'vm_power_manager/guest_cli', 'vmdq', 'vmdq_dcb', ] -# install all example code on install - irrespective of whether the example in -# question is to be built as part of this build or not. -foreach ex:all_examples - install_subdir(ex, - install_dir: get_option('datadir') + '/dpdk/examples', - exclude_files: 'meson.build') -endforeach if get_option('examples') == '' subdir_done() diff --git a/meson.build b/meson.build index 61d9a4f5fa..45d974cd2c 100644 --- a/meson.build +++ b/meson.build @@ -59,6 +59,9 @@ subdir('doc') # build any examples explicitly requested - useful for developers - and # install any example code into the appropriate install path subdir('examples') +install_subdir('examples', + install_dir: get_option('datadir') + '/dpdk', + exclude_files: 'meson.build') # build kernel modules if enabled if get_option('enable_kmods') From patchwork Wed Nov 11 15:56:47 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bruce Richardson X-Patchwork-Id: 84026 X-Patchwork-Delegate: thomas@monjalon.net Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 8E5BFA09D9; Wed, 11 Nov 2020 16:57:33 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 87F545A51; Wed, 11 Nov 2020 16:57:05 +0100 (CET) Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by dpdk.org (Postfix) with ESMTP id 1937E5958 for ; Wed, 11 Nov 2020 16:57:03 +0100 (CET) IronPort-SDR: Wv1G2fp8ZDSK65ENlnMzjRBLjpn19HiLbdrg8b8WnQvsEQb/1zALMNrAm2eqXnfqA6oniW04LN PsuqcLGLry2w== X-IronPort-AV: E=McAfee;i="6000,8403,9801"; a="170275481" X-IronPort-AV: E=Sophos;i="5.77,469,1596524400"; d="scan'208";a="170275481" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 11 Nov 2020 07:57:02 -0800 IronPort-SDR: QgojeY2DuDqsCUN7tSPfPnZ8in+vk5HThu//BjVCaVW2SIAWSkHWRepwFyCSBVxmG2LzLzNpOn X0iu23f0+GXQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.77,469,1596524400"; d="scan'208";a="531745905" Received: from silpixa00399126.ir.intel.com ([10.237.222.4]) by fmsmga005.fm.intel.com with ESMTP; 11 Nov 2020 07:57:00 -0800 From: Bruce Richardson To: dev@dpdk.org Cc: david.marchand@redhat.com, Bruce Richardson Date: Wed, 11 Nov 2020 15:56:47 +0000 Message-Id: <20201111155647.1720787-2-bruce.richardson@intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20201111155647.1720787-1-bruce.richardson@intel.com> References: <20201110170809.1309043-1-bruce.richardson@intel.com> <20201111155647.1720787-1-bruce.richardson@intel.com> MIME-Version: 1.0 Subject: [dpdk-dev] [PATCH v2 2/2] examples: skip installing unbuildable examples X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 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" Rather than just installing all examples, we can use the build checks to filter out any examples that are missing dependencies or are otherwise unbuildable on the current system. Signed-off-by: Bruce Richardson --- examples/meson.build | 54 +++++++++++++++++++++++++++----------------- meson.build | 2 ++ 2 files changed, 35 insertions(+), 21 deletions(-) diff --git a/examples/meson.build b/examples/meson.build index 46ec80919e..9d268c9786 100644 --- a/examples/meson.build +++ b/examples/meson.build @@ -48,15 +48,11 @@ all_examples = [ 'vmdq', 'vmdq_dcb', ] -if get_option('examples') == '' - subdir_done() -endif - if get_option('examples').to_lower() == 'all' - examples = all_examples + requested_examples = all_examples allow_skips = true # don't flag an error if we can't build an app else - examples = get_option('examples').split(',') + requested_examples = get_option('examples').split(',') allow_skips = false # error out if we can't build a requested app endif default_cflags = machine_args @@ -64,7 +60,9 @@ if cc.has_argument('-Wno-format-truncation') default_cflags += '-Wno-format-truncation' endif -foreach example: examples +# iterate through all examples to see what we need to install +# only actually build requested ones +foreach example: all_examples name = example.split('/')[-1] build = true sources = [] @@ -81,22 +79,36 @@ foreach example: examples foreach d:deps var_name = get_option('default_library') + '_rte_' + d if not is_variable(var_name) - error('Missing dependency "@0@" for example "@1@"'.format(d, name)) + message('Missing dependency "@0@" for example "@1@"'.format(d, name)) + build = false + else + dep_objs += [get_variable(var_name)] endif - dep_objs += [get_variable(var_name)] endforeach - if allow_experimental_apis - cflags += '-DALLOW_EXPERIMENTAL_API' + endif # build + + if not build + # exclude based on top-level directory only + dir = example.split('/')[0] + dpdk_examples_exclude += dir + message('Excluding example directory "@0@" from install'.format(dir)) + endif + + if requested_examples.contains(example) + if build + if allow_experimental_apis + cflags += '-DALLOW_EXPERIMENTAL_API' + endif + executable('dpdk-' + name, sources, + include_directories: includes, + link_whole: link_whole_libs, + link_args: dpdk_extra_ldflags, + c_args: cflags, + dependencies: dep_objs) + elif not allow_skips + error('Cannot build requested example "' + name + '"') + else + message('Skipping example "' + name + '"') endif - executable('dpdk-' + name, sources, - include_directories: includes, - link_whole: link_whole_libs, - link_args: dpdk_extra_ldflags, - c_args: cflags, - dependencies: dep_objs) - elif not allow_skips - error('Cannot build requested example "' + name + '"') - else - message('Skipping example "' + name + '"') endif endforeach diff --git a/meson.build b/meson.build index 45d974cd2c..559a9d2f1b 100644 --- a/meson.build +++ b/meson.build @@ -58,9 +58,11 @@ subdir('doc') # build any examples explicitly requested - useful for developers - and # install any example code into the appropriate install path +dpdk_examples_exclude = [] subdir('examples') install_subdir('examples', install_dir: get_option('datadir') + '/dpdk', + exclude_directories: dpdk_examples_exclude, exclude_files: 'meson.build') # build kernel modules if enabled