install: fix flattening of examples directory

Message ID 20201110170809.1309043-1-bruce.richardson@intel.com (mailing list archive)
State Superseded, archived
Delegated to: Thomas Monjalon
Headers
Series install: fix flattening of examples directory |

Checks

Context Check Description
ci/checkpatch warning coding style issues
ci/iol-broadcom-Performance success Performance Testing PASS
ci/iol-broadcom-Functional success Functional Testing PASS
ci/iol-intel-Performance success Performance Testing PASS
ci/iol-testing success Testing PASS
ci/Intel-compilation success Compilation OK
ci/iol-mellanox-Performance success Performance Testing PASS
ci/iol-intel-Functional success Functional Testing PASS

Commit Message

Bruce Richardson Nov. 10, 2020, 5:08 p.m. UTC
  By installing the examples one-by-one in a loop in the examples
meson.build file we effectively flatted 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 <bruce.richardson@intel.com>
---
 examples/meson.build | 7 -------
 meson.build          | 3 +++
 2 files changed, 3 insertions(+), 7 deletions(-)
  

Comments

Bruce Richardson Nov. 10, 2020, 5:09 p.m. UTC | #1
Using correct address for David. :-(

On Tue, Nov 10, 2020 at 05:08:09PM +0000, Bruce Richardson wrote:
> By installing the examples one-by-one in a loop in the examples
> meson.build file we effectively flatted 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 <bruce.richardson@intel.com>
> ---
>  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 f17995532..46ec80919 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 61d9a4f5f..45d974cd2 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')
> -- 
> 2.25.1
>
  
David Marchand Nov. 10, 2020, 5:14 p.m. UTC | #2
On Tue, Nov 10, 2020 at 6:09 PM Bruce Richardson
<bruce.richardson@intel.com> wrote:
>
> Using correct address for David. :-(

A clone @intel.com would sure be helpful :-).
  
David Marchand Nov. 10, 2020, 5:33 p.m. UTC | #3
On Tue, Nov 10, 2020 at 6:08 PM Bruce Richardson
<bruce.richardson@intel.com> wrote:
>
> By installing the examples one-by-one in a loop in the examples
> meson.build file we effectively flatted out the structure of the examples

flattened*

> 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.

It seems wrong to provide all examples without looking at all_examples.
We would provide examples that can't link against the available dpdk libraries.
  
Bruce Richardson Nov. 10, 2020, 5:42 p.m. UTC | #4
On Tue, Nov 10, 2020 at 06:33:03PM +0100, David Marchand wrote:
> On Tue, Nov 10, 2020 at 6:08 PM Bruce Richardson
> <bruce.richardson@intel.com> wrote:
> >
> > By installing the examples one-by-one in a loop in the examples
> > meson.build file we effectively flatted out the structure of the examples
> 
> flattened*
> 
> > 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.
> 
> It seems wrong to provide all examples without looking at all_examples.
> We would provide examples that can't link against the available dpdk libraries.
> 
Yes, let me think on this a bit about what is best to do, or how to manage
it. I'll try and get a v2 tomorrow.

For older releases with "make" buildsystem, did we provide an installation
method for examples, because I can't think of how we handled this fact
there?
  

Patch

diff --git a/examples/meson.build b/examples/meson.build
index f17995532..46ec80919 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 61d9a4f5f..45d974cd2 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')