Skip to content

Commit

Permalink
build: fix warnings when running external commands
Browse files Browse the repository at this point in the history
[ upstream commit ecb904c ]

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

Reported-by: Jerin Jacob <jerinj@marvell.com>
Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Tested-by: Jerin Jacob <jerinj@marvell.com>
  • Loading branch information
bruce-richardson authored and bluca committed Feb 17, 2022
1 parent 29649b4 commit 1442174
Show file tree
Hide file tree
Showing 9 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion app/test/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -437,7 +437,7 @@ dpdk_test = executable('dpdk-test',
driver_install_path),
install: true)

has_hugepage = run_command('has-hugepage.sh').stdout().strip() != '0'
has_hugepage = run_command('has-hugepage.sh', check: true).stdout().strip() != '0'
message('hugepage availability: @0@'.format(has_hugepage))

# some perf tests (eg: memcpy perf autotest)take very long
Expand Down
2 changes: 1 addition & 1 deletion config/arm/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,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
Expand Down
2 changes: 1 addition & 1 deletion config/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ is_ms_linker = is_windows and (cc.get_id() == 'clang')
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_file, check: true).stdout().strip()

# Libraries have the abi_version as the filename extension
# and have the soname be all but the final part of the abi_version.
Expand Down
2 changes: 1 addition & 1 deletion config/x86/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
# get binutils version for the workaround of Bug 97
binutils_ok = true
if not is_windows and (is_linux or cc.get_id() == 'gcc')
binutils_ok = run_command(binutils_avx512_check).returncode() == 0
binutils_ok = run_command(binutils_avx512_check, check: false).returncode() == 0
if not binutils_ok and cc.has_argument('-mno-avx512f')
machine_args += '-mno-avx512f'
warning('Binutils error with AVX512 assembly, disabling AVX512 support')
Expand Down
2 changes: 1 addition & 1 deletion drivers/common/mlx5/linux/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ foreach libname:libnames
endforeach
if static_ibverbs or dlopen_ibverbs
# Build without adding shared libs to Requires.private
ibv_cflags = run_command(pkgconf, '--cflags', 'libibverbs').stdout()
ibv_cflags = run_command(pkgconf, '--cflags', 'libibverbs', check: true).stdout()
ext_deps += declare_dependency(compile_args: ibv_cflags.split())
endif
if static_ibverbs
Expand Down
2 changes: 1 addition & 1 deletion drivers/net/mlx4/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ foreach libname:libnames
endforeach
if static_ibverbs or dlopen_ibverbs
# Build without adding shared libs to Requires.private
ibv_cflags = run_command(pkgconf, '--cflags', 'libibverbs').stdout()
ibv_cflags = run_command(pkgconf, '--cflags', 'libibverbs', check:true).stdout()
ext_deps += declare_dependency(compile_args: ibv_cflags.split())
endif
if static_ibverbs
Expand Down
2 changes: 1 addition & 1 deletion kernel/linux/kni/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down
4 changes: 2 additions & 2 deletions kernel/linux/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ endif
kernel_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
endif

Expand All @@ -23,7 +23,7 @@ endif

# test running make in kernel directory, using "make kernelversion"
make_returncode = run_command('make', '-sC', kernel_dir + '/build',
'kernelversion').returncode()
'kernelversion', check: true).returncode()
if make_returncode != 0
error('Cannot compile kernel modules as requested - are kernel headers installed?')
endif
Expand Down
2 changes: 1 addition & 1 deletion meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ 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(),
files('VERSION'), check: true).stdout().strip(),
license: 'BSD',
default_options: ['buildtype=release', 'default_library=static'],
meson_version: '>= 0.47.1'
Expand Down

0 comments on commit 1442174

Please sign in to comment.