build: provide suitable error for "both" libraries option

Message ID 20210111135559.1169775-1-bruce.richardson@intel.com (mailing list archive)
State Accepted, archived
Delegated to: Thomas Monjalon
Headers
Series build: provide suitable error for "both" libraries option |

Checks

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

Commit Message

Bruce Richardson Jan. 11, 2021, 1:55 p.m. UTC
  Rather than having the DPDK configuration error out when linking apps
and examples when "both" is select for "default_library" option, we can
detect that setting earlier in the build config and provide a suitable
error message to the user.

CC: stable@dpdk.org

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
---
 config/meson.build | 9 +++++++++
 1 file changed, 9 insertions(+)

--
2.27.0
  

Comments

Andrew Boyer Jan. 11, 2021, 4:19 p.m. UTC | #1
> On Jan 11, 2021, at 8:55 AM, Bruce Richardson <bruce.richardson@intel.com> wrote:
> 
> Rather than having the DPDK configuration error out when linking apps
> and examples when "both" is select for "default_library" option, we can
> detect that setting earlier in the build config and provide a suitable
> error message to the user.
> 
> CC: stable@dpdk.org
> 
> Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
> ---
> config/meson.build | 9 +++++++++
> 1 file changed, 9 insertions(+)
> 
> diff --git a/config/meson.build b/config/meson.build
> index 3ddcc3539..05e9cede5 100644
> --- a/config/meson.build
> +++ b/config/meson.build
> @@ -308,3 +308,12 @@ if get_option('b_lto')
> 		add_project_link_arguments('-Wno-lto-type-mismatch', language: 'c')
> 	endif
> endif
> +
> +if get_option('default_library') == 'both'
> +	error( '''
> +    Unsupported value "both" for "default_library" option.
> +
> +    NOTE: DPDK always builds both shared and static libraries.  Please set
> +    "default_library" to either "static" or "shared" to select default linkage
> +    for apps and any examples''')

Should there be a period after ‘examples’?

> +endif
> --
> 2.27.0
> 


Reviewed-by: Andrew Boyer <aboyer@pensando.io>
  
Bruce Richardson Jan. 11, 2021, 4:57 p.m. UTC | #2
On Mon, Jan 11, 2021 at 11:19:26AM -0500, Andrew Boyer wrote:
> 
> 
> > On Jan 11, 2021, at 8:55 AM, Bruce Richardson
> > <bruce.richardson@intel.com> wrote:
> > 
> > Rather than having the DPDK configuration error out when linking apps
> > and examples when "both" is select for "default_library" option, we can
> > detect that setting earlier in the build config and provide a suitable
> > error message to the user.
> > 
> > CC: stable@dpdk.org
> > 
> > Signed-off-by: Bruce Richardson <bruce.richardson@intel.com> ---
> > config/meson.build | 9 +++++++++ 1 file changed, 9 insertions(+)
> > 
> > diff --git a/config/meson.build b/config/meson.build index
> > 3ddcc3539..05e9cede5 100644 --- a/config/meson.build +++
> > b/config/meson.build @@ -308,3 +308,12 @@ if get_option('b_lto')
> > add_project_link_arguments('-Wno-lto-type-mismatch', language: 'c')
> > endif endif + +if get_option('default_library') == 'both' +	error( '''
> > +    Unsupported value "both" for "default_library" option.  + +
> > NOTE: DPDK always builds both shared and static libraries.  Please set
> > +    "default_library" to either "static" or "shared" to select default
> > linkage +    for apps and any examples''')
> 
> Should there be a period after ‘examples’?
> 
Yes, to have it a valid English sentence. If there are no other comments to
fix I'll not do a v2 for it alone, though - committers, feel free to add
one on apply.

/Bruce
  
Honnappa Nagarahalli Jan. 11, 2021, 5:40 p.m. UTC | #3
<snip>

> 
> Rather than having the DPDK configuration error out when linking apps and
> examples when "both" is select for "default_library" option, we can detect
> that setting earlier in the build config and provide a suitable error message to
> the user.
> 
> CC: stable@dpdk.org
> 
> Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Looks good, thanks Bruce
Reviewed-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>

> ---
>  config/meson.build | 9 +++++++++
>  1 file changed, 9 insertions(+)
> 
> diff --git a/config/meson.build b/config/meson.build index
> 3ddcc3539..05e9cede5 100644
> --- a/config/meson.build
> +++ b/config/meson.build
> @@ -308,3 +308,12 @@ if get_option('b_lto')
>  		add_project_link_arguments('-Wno-lto-type-mismatch',
> language: 'c')
>  	endif
>  endif
> +
> +if get_option('default_library') == 'both'
> +	error( '''
> +    Unsupported value "both" for "default_library" option.
> +
> +    NOTE: DPDK always builds both shared and static libraries.  Please set
> +    "default_library" to either "static" or "shared" to select default linkage
> +    for apps and any examples''')
> +endif
> --
> 2.27.0
  
Thomas Monjalon Jan. 20, 2021, 12:49 a.m. UTC | #4
11/01/2021 17:19, Andrew Boyer:
> > On Jan 11, 2021, at 8:55 AM, Bruce Richardson <bruce.richardson@intel.com> wrote:
> > 
> > Rather than having the DPDK configuration error out when linking apps
> > and examples when "both" is select for "default_library" option, we can
> > detect that setting earlier in the build config and provide a suitable
> > error message to the user.
> > 
> > CC: stable@dpdk.org
> > 
> > Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
> > ---
> > +if get_option('default_library') == 'both'
> > +	error( '''
> > +    Unsupported value "both" for "default_library" option.
> > +
> > +    NOTE: DPDK always builds both shared and static libraries.  Please set
> > +    "default_library" to either "static" or "shared" to select default linkage
> > +    for apps and any examples''')
> 
> Should there be a period after ‘examples’?
> 
> Reviewed-by: Andrew Boyer <aboyer@pensando.io>

Applied with above fixup, thanks
  

Patch

diff --git a/config/meson.build b/config/meson.build
index 3ddcc3539..05e9cede5 100644
--- a/config/meson.build
+++ b/config/meson.build
@@ -308,3 +308,12 @@  if get_option('b_lto')
 		add_project_link_arguments('-Wno-lto-type-mismatch', language: 'c')
 	endif
 endif
+
+if get_option('default_library') == 'both'
+	error( '''
+    Unsupported value "both" for "default_library" option.
+
+    NOTE: DPDK always builds both shared and static libraries.  Please set
+    "default_library" to either "static" or "shared" to select default linkage
+    for apps and any examples''')
+endif