[09/10] devtools: compile all examples with pkg-config

Message ID 20201110151219.4893-10-david.marchand@redhat.com (mailing list archive)
State Superseded, archived
Delegated to: Thomas Monjalon
Headers
Series Examples compilation fixes |

Checks

Context Check Description
ci/checkpatch success coding style OK

Commit Message

David Marchand Nov. 10, 2020, 3:12 p.m. UTC
  Compiling examples out of meson must be tested so that those examples
Makefile work.
This is based on Bruce patch [1], waiting for it (or an equivalent) to be
merged.

1: https://patchwork.dpdk.org/patch/82361/

Signed-off-by: David Marchand <david.marchand@redhat.com>
---
 devtools/test-meson-builds.sh | 28 +++++++++++++++++++++++++++-
 1 file changed, 27 insertions(+), 1 deletion(-)
  

Comments

Bruce Richardson Nov. 10, 2020, 4:02 p.m. UTC | #1
On Tue, Nov 10, 2020 at 04:12:18PM +0100, David Marchand wrote:
> Compiling examples out of meson must be tested so that those examples
> Makefile work.
> This is based on Bruce patch [1], waiting for it (or an equivalent) to be
> merged.
> 
> 1: https://patchwork.dpdk.org/patch/82361/
> 
> Signed-off-by: David Marchand <david.marchand@redhat.com>
> ---
>  devtools/test-meson-builds.sh | 28 +++++++++++++++++++++++++++-
>  1 file changed, 27 insertions(+), 1 deletion(-)
> 
> diff --git a/devtools/test-meson-builds.sh b/devtools/test-meson-builds.sh
> index 0c95d1cc98..8e26d0808d 100755
> --- a/devtools/test-meson-builds.sh
> +++ b/devtools/test-meson-builds.sh
> @@ -268,7 +268,33 @@ export PKG_CONFIG_PATH=$(dirname $pc_file):$PKG_CONFIG_PATH
>  # if pkg-config defines the necessary flags, test building some examples
>  if pkg-config --define-prefix libdpdk >/dev/null 2>&1; then
>  	export PKGCONF="pkg-config --define-prefix"
> -	for example in cmdline helloworld l2fwd l3fwd skeleton timer; do
> +	export LD_LIBRARY_PATH=$(dirname $(find $DESTDIR -name librte_eal.so)):$LD_LIBRARY_PATH
> +	examples_to_test=${DPDK_BUILD_TEST_EXAMPLES:-}
> +	if [ -z "$examples_to_test" ]; then
> +		##################
> +		# FIXME examples #
> +		##################
> +		skipped=""
> +		# Relies on librte_power internal header
> +		skipped="$skipped guest_cli vm_power_manager"
> +		# Expects libqos
> +		skipped="$skipped l2fwd-cat"
> +		# performance-thread/{l3fwd-thread,pthread_shim} expect common .mk
> +		skipped="$skipped l3fwd-thread pthread_shim"
> +		# client_server_mp/{mp_server,mp_client} expect common headers
> +		skipped="$skipped mp_client mp_server"

I was initially confused by this, because they build fine for me. However,
I realised I was running the build from within the examples source folder,
rather than as installed in the install folder. The examples directory
seems more flattened there, which is the cause of the problems. I will
investigate.

/Bruce
  
Bruce Richardson Nov. 10, 2020, 5:18 p.m. UTC | #2
On Tue, Nov 10, 2020 at 04:12:18PM +0100, David Marchand wrote:
> Compiling examples out of meson must be tested so that those examples
> Makefile work.
> This is based on Bruce patch [1], waiting for it (or an equivalent) to be
> merged.
> 
> 1: https://patchwork.dpdk.org/patch/82361/
> 
> Signed-off-by: David Marchand <david.marchand@redhat.com>
> ---
>  devtools/test-meson-builds.sh | 28 +++++++++++++++++++++++++++-
>  1 file changed, 27 insertions(+), 1 deletion(-)
> 
> diff --git a/devtools/test-meson-builds.sh b/devtools/test-meson-builds.sh
> index 0c95d1cc98..8e26d0808d 100755
> --- a/devtools/test-meson-builds.sh
> +++ b/devtools/test-meson-builds.sh
> @@ -268,7 +268,33 @@ export PKG_CONFIG_PATH=$(dirname $pc_file):$PKG_CONFIG_PATH
>  # if pkg-config defines the necessary flags, test building some examples
>  if pkg-config --define-prefix libdpdk >/dev/null 2>&1; then
>  	export PKGCONF="pkg-config --define-prefix"
> -	for example in cmdline helloworld l2fwd l3fwd skeleton timer; do
> +	export LD_LIBRARY_PATH=$(dirname $(find $DESTDIR -name librte_eal.so)):$LD_LIBRARY_PATH
> +	examples_to_test=${DPDK_BUILD_TEST_EXAMPLES:-}
> +	if [ -z "$examples_to_test" ]; then
> +		##################
> +		# FIXME examples #
> +		##################
> +		skipped=""
> +		# Relies on librte_power internal header
> +		skipped="$skipped guest_cli vm_power_manager"
> +		# Expects libqos
> +		skipped="$skipped l2fwd-cat"
> +		# performance-thread/{l3fwd-thread,pthread_shim} expect common .mk
> +		skipped="$skipped l3fwd-thread pthread_shim"
> +		# client_server_mp/{mp_server,mp_client} expect common headers
> +		skipped="$skipped mp_client mp_server"
> +		# server_node_efd/{node,server} expect common headers
> +		skipped="$skipped node server"

The issues with the missing common files for all of above should be fixed
by patch [1]

/Bruce

[1] http://patches.dpdk.org/patch/83911/
  
David Marchand Nov. 10, 2020, 5:27 p.m. UTC | #3
On Tue, Nov 10, 2020 at 6:19 PM Bruce Richardson
<bruce.richardson@intel.com> wrote:
> > +             # performance-thread/{l3fwd-thread,pthread_shim} expect common .mk
> > +             skipped="$skipped l3fwd-thread pthread_shim"
> > +             # client_server_mp/{mp_server,mp_client} expect common headers
> > +             skipped="$skipped mp_client mp_server"
> > +             # server_node_efd/{node,server} expect common headers
> > +             skipped="$skipped node server"
>
> The issues with the missing common files for all of above should be fixed
> by patch [1]

I was about to look at this flattening stuff.
Thanks for fixing while I was out for the kids :-).

I'll respin once both your patches are in.
  

Patch

diff --git a/devtools/test-meson-builds.sh b/devtools/test-meson-builds.sh
index 0c95d1cc98..8e26d0808d 100755
--- a/devtools/test-meson-builds.sh
+++ b/devtools/test-meson-builds.sh
@@ -268,7 +268,33 @@  export PKG_CONFIG_PATH=$(dirname $pc_file):$PKG_CONFIG_PATH
 # if pkg-config defines the necessary flags, test building some examples
 if pkg-config --define-prefix libdpdk >/dev/null 2>&1; then
 	export PKGCONF="pkg-config --define-prefix"
-	for example in cmdline helloworld l2fwd l3fwd skeleton timer; do
+	export LD_LIBRARY_PATH=$(dirname $(find $DESTDIR -name librte_eal.so)):$LD_LIBRARY_PATH
+	examples_to_test=${DPDK_BUILD_TEST_EXAMPLES:-}
+	if [ -z "$examples_to_test" ]; then
+		##################
+		# FIXME examples #
+		##################
+		skipped=""
+		# Relies on librte_power internal header
+		skipped="$skipped guest_cli vm_power_manager"
+		# Expects libqos
+		skipped="$skipped l2fwd-cat"
+		# performance-thread/{l3fwd-thread,pthread_shim} expect common .mk
+		skipped="$skipped l3fwd-thread pthread_shim"
+		# client_server_mp/{mp_server,mp_client} expect common headers
+		skipped="$skipped mp_client mp_server"
+		# server_node_efd/{node,server} expect common headers
+		skipped="$skipped node server"
+		# waiting for fixes
+		skipped="$skipped vhost"
+		for mk in $DESTDIR/usr/local/share/dpdk/examples/*/Makefile; do
+			name=$(basename $(dirname $mk))
+			[ "$skipped" = "${skipped/ $name}" ] ||
+				continue
+			examples_to_test="$examples_to_test $name"
+		done
+	fi
+	for example in $examples_to_test; do
 		echo "## Building $example"
 		$MAKE -C $DESTDIR/usr/local/share/dpdk/examples/$example clean shared static
 	done