patches for DPDK stable branches
 help / color / mirror / Atom feed
From: Bruce Richardson <bruce.richardson@intel.com>
To: stable@dpdk.org
Cc: christian.ehrhardt@canonical.com,
	Bruce Richardson <bruce.richardson@intel.com>,
	Jerin Jacob <jerinj@marvell.com>
Subject: [PATCH 19.11 v2 4/5] build: fix warnings when running external commands
Date: Tue,  1 Mar 2022 14:44:02 +0000	[thread overview]
Message-ID: <20220301144403.411190-5-bruce.richardson@intel.com> (raw)
In-Reply-To: <20220301144403.411190-1-bruce.richardson@intel.com>

Meson 0.61.1 is giving warnings that the calls to run_command do not
always explicitly specify if the result is to be checked or not, i.e.
there is a missing "check" parameter. This is because the default
behaviour without the parameter is due to change in the future.

We can fix these warnings by explicitly adding into each call whether
the result should be checked by meson or not. This patch therefore
adds in "check: false" to each run_command call where the result is
being checked by the DPDK meson.build code afterwards, and adds in
"check: true" to any calls where the result is currently unchecked.

Bugzilla ID: 921
Cc: stable@dpdk.org

Reported-by: Jerin Jacob <jerinj@marvell.com>
Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Tested-by: Jerin Jacob <jerinj@marvell.com>
---
 app/test/meson.build         | 4 ++--
 config/arm/meson.build       | 2 +-
 config/meson.build           | 4 ++--
 config/x86/meson.build       | 2 +-
 drivers/meson.build          | 4 ++--
 kernel/linux/kni/meson.build | 2 +-
 kernel/linux/meson.build     | 6 +++---
 lib/meson.build              | 4 ++--
 meson.build                  | 4 ++--
 9 files changed, 16 insertions(+), 16 deletions(-)

diff --git a/app/test/meson.build b/app/test/meson.build
index 2e35e93477..5554be9710 100644
--- a/app/test/meson.build
+++ b/app/test/meson.build
@@ -405,7 +405,7 @@ dpdk_test = executable('dpdk-test',
 has_hugepage = true
 if is_linux
 	check_hugepage = run_command('cat',
-				     '/proc/sys/vm/nr_hugepages')
+				     '/proc/sys/vm/nr_hugepages', check: false)
 	if (check_hugepage.returncode() != 0 or
 	    check_hugepage.stdout().strip() == '0')
 		has_hugepage = false
@@ -419,7 +419,7 @@ timeout_seconds = 600
 timeout_seconds_fast = 10
 
 get_coremask = find_program('get-coremask.sh')
-num_cores_arg = '-l ' + run_command(get_coremask).stdout().strip()
+num_cores_arg = '-l ' + run_command(get_coremask, check: true).stdout().strip()
 
 default_test_args = [num_cores_arg]
 
diff --git a/config/arm/meson.build b/config/arm/meson.build
index 60f7b05396..dceea336dd 100644
--- a/config/arm/meson.build
+++ b/config/arm/meson.build
@@ -152,7 +152,7 @@ else
 		# 'Primary Part number', 'Revision']
 		detect_vendor = find_program(join_paths(
 				meson.current_source_dir(), 'armv8_machine.py'))
-		cmd = run_command(detect_vendor.path())
+		cmd = run_command(detect_vendor.path(), check: false)
 		if cmd.returncode() == 0
 			cmd_output = cmd.stdout().to_lower().strip().split(' ')
 		endif
diff --git a/config/meson.build b/config/meson.build
index e87d1ba533..4b03746889 100644
--- a/config/meson.build
+++ b/config/meson.build
@@ -22,8 +22,8 @@ is_ms_linker = is_windows and (cc.get_id() == 'clang')
 # depending on the configuration options
 pver = meson.project_version().split('.')
 major_version = '@0@.@1@'.format(pver.get(0), pver.get(1))
-abi_version = run_command(find_program('cat', 'more'),
-	abi_version_file).stdout().strip()
+abi_version = run_command(find_program('cat', 'more'), abi_version_file,
+		check: true).stdout().strip()
 # experimental libraries are versioned as 0.majorminor versions, e.g. 0.201
 ever = abi_version.split('.')
 experimental_abi_version = '0.@0@@1@'.format(ever.get(0), ever.get(1))
diff --git a/config/x86/meson.build b/config/x86/meson.build
index adc857ba28..855a7d0edd 100644
--- a/config/x86/meson.build
+++ b/config/x86/meson.build
@@ -3,7 +3,7 @@
 
 # get binutils version for the workaround of Bug 97
 if not is_windows
-	ldver = run_command('ld', '-v').stdout().strip()
+	ldver = run_command('ld', '-v', check: true).stdout().strip()
 	if ldver.contains('2.30') and cc.has_argument('-mno-avx512f')
 		machine_args += '-mno-avx512f'
 		message('Binutils 2.30 detected, disabling AVX512 support as workaround for bug #97')
diff --git a/drivers/meson.build b/drivers/meson.build
index 0400d84675..22cc049142 100644
--- a/drivers/meson.build
+++ b/drivers/meson.build
@@ -127,8 +127,8 @@ foreach class:dpdk_driver_classes
 					meson.current_source_dir(),
 					drv_path, lib_name)
 
-			is_experimental = run_command(is_experimental_cmd,
-				files(version_map)).returncode()
+			is_experimental = run_command(is_experimental_cmd, files(version_map),
+					check: false).returncode()
 
 			if is_experimental != 0
 				lib_version = experimental_abi_version
diff --git a/kernel/linux/kni/meson.build b/kernel/linux/kni/meson.build
index facc6d8a69..eb97ec1491 100644
--- a/kernel/linux/kni/meson.build
+++ b/kernel/linux/kni/meson.build
@@ -5,7 +5,7 @@
 # Ref: https://jira.devtools.intel.com/browse/DPDK-29263
 kmod_cflags = ''
 file_path = kernel_source_dir + '/include/linux/netdevice.h'
-run_cmd = run_command('grep', 'ndo_tx_timeout', file_path)
+run_cmd = run_command('grep', 'ndo_tx_timeout', file_path, check: false)
 
 if run_cmd.stdout().contains('txqueue') == true
    kmod_cflags = '-DHAVE_ARG_TX_QUEUE'
diff --git a/kernel/linux/meson.build b/kernel/linux/meson.build
index cd74739905..793c58ef56 100644
--- a/kernel/linux/meson.build
+++ b/kernel/linux/meson.build
@@ -13,7 +13,7 @@ kernel_dir = get_option('kernel_dir')
 kernel_source_dir = get_option('kernel_dir')
 if kernel_dir == ''
 	# use default path for native builds
-	kernel_version = run_command('uname', '-r').stdout().strip()
+	kernel_version = run_command('uname', '-r', check: true).stdout().strip()
 	kernel_dir = '/lib/modules/' + kernel_version
 	if kernel_source_dir == ''
 		# use default path for native builds
@@ -22,8 +22,8 @@ if kernel_dir == ''
 endif
 
 # test running make in kernel directory, using "make kernelversion"
-make_returncode = run_command('make', '-sC', kernel_dir + '/build',
-		'kernelversion').returncode()
+make_returncode = run_command('make', '-sC', kernel_dir + '/build', 'kernelversion',
+		check: false).returncode()
 if make_returncode != 0
 	warning('Cannot compile kernel modules as requested - are kernel headers installed?')
 	subdir_done()
diff --git a/lib/meson.build b/lib/meson.build
index f8da4f3168..6d86ca3e26 100644
--- a/lib/meson.build
+++ b/lib/meson.build
@@ -108,8 +108,8 @@ foreach l:libraries
 			version_map = '@0@/@1@/rte_@2@_version.map'.format(
 					meson.current_source_dir(), dir_name, name)
 
-			is_experimental = run_command(is_experimental_cmd,
-					files(version_map)).returncode()
+			is_experimental = run_command(is_experimental_cmd, files(version_map),
+					check: false).returncode()
 
 			if is_experimental != 0
 				lib_version = experimental_abi_version
diff --git a/meson.build b/meson.build
index a32bcda1c9..94f51a8c6c 100644
--- a/meson.build
+++ b/meson.build
@@ -4,8 +4,8 @@
 project('DPDK', 'C',
 	# Get version number from file.
 	# Fallback to "more" for Windows compatibility.
-	version: run_command(find_program('cat', 'more'),
-		files('VERSION')).stdout().strip(),
+	version: run_command(find_program('cat', 'more'), files('VERSION'),
+			check: true).stdout().strip(),
 	license: 'BSD',
 	default_options: [
         'buildtype=release',
-- 
2.32.0


  parent reply	other threads:[~2022-03-01 14:44 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-01 14:08 [PATCH 19.11 0/4] Patch backports from main Bruce Richardson
2022-03-01 14:08 ` [PATCH 19.11 1/4] eventdev: fix C++ include Bruce Richardson
2022-03-01 14:08 ` [PATCH 19.11 2/4] eal: " Bruce Richardson
2022-03-01 14:08 ` [PATCH 19.11 3/4] build: remove deprecated Meson functions Bruce Richardson
2022-03-01 14:08 ` [PATCH 19.11 4/4] build: fix warnings when running external commands Bruce Richardson
2022-03-01 14:43 ` [PATCH 19.11 v2 0/5] Patch backports from main Bruce Richardson
2022-03-01 14:43   ` [PATCH 19.11 v2 1/5] eventdev: fix C++ include Bruce Richardson
2022-03-01 14:44   ` [PATCH 19.11 v2 2/5] eal: " Bruce Richardson
2022-03-01 14:44   ` [PATCH 19.11 v2 3/5] build: remove deprecated Meson functions Bruce Richardson
2022-03-01 14:44   ` Bruce Richardson [this message]
2022-03-01 14:44   ` [PATCH 19.11 v2 5/5] drivers: remove warning with Meson 0.59 Bruce Richardson
2022-03-09  7:59   ` [PATCH 19.11 v2 0/5] Patch backports from main Christian Ehrhardt

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220301144403.411190-5-bruce.richardson@intel.com \
    --to=bruce.richardson@intel.com \
    --cc=christian.ehrhardt@canonical.com \
    --cc=jerinj@marvell.com \
    --cc=stable@dpdk.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).