WARNING: You should add the boolean check kwarg to the run_command call.
It currently defaults to false,
but it will default to true in future releases of meson.
See also: https://github.com/mesonbuild/meson/issues/9300
In almost all cases we already check the return code explicitly
and throw a more descriptive message than what would be the default.
'''.format(ttc.get('tname'), tsize)
endforeach
# Now feed it directly into luajit.
- kres_gen_test = run_command(find_program('luajit'), '-e', kres_gen_test_luastr)
+ kres_gen_test = run_command(find_program('luajit'), '-e', kres_gen_test_luastr, check: false)
if kres_gen_test.returncode() != 0
error('if you use released Knot* versions, please contact us: https://www.knot-resolver.cz/contact/\n'
+ kres_gen_test.stderr().strip())
# man page
man_config = configuration_data()
man_config.set('version', meson.project_version())
-man_config.set('date', run_command('../scripts/get-date.sh').stdout())
+man_config.set('date', run_command('../scripts/get-date.sh', check: true).stdout())
man_config.set('man_seealso_systemd', '')
if systemd_files == 'enabled'
makeinfo = find_program('makeinfo', required: false)
# python dependencies: breathe, sphinx_rtd_theme
- python_breathe = run_command('python3', '-c', 'import breathe')
+ python_breathe = run_command('python3', '-c', 'import breathe', check: false)
if python_breathe.returncode() != 0
# some distros might use python2 sphinx
- python_breathe = run_command('python2', '-c', 'import breathe')
+ python_breathe = run_command('python2', '-c', 'import breathe', check: false)
if python_breathe.returncode() != 0
error('missing doc dependency: python breathe')
else
- python_sphinx_rtd_theme = run_command('python2', '-c', 'import sphinx_rtd_theme')
+ python_sphinx_rtd_theme = run_command('python2', '-c', 'import sphinx_rtd_theme', check: false)
if python_sphinx_rtd_theme.returncode() != 0
error('missing doc dependency: python sphinx_rtd_theme')
endif
endif
else
- python_sphinx_rtd_theme = run_command('python3', '-c', 'import sphinx_rtd_theme')
+ python_sphinx_rtd_theme = run_command('python3', '-c', 'import sphinx_rtd_theme', check: false)
if python_sphinx_rtd_theme.returncode() != 0
error('missing doc dependency: python sphinx_rtd_theme')
endif
# kresd.conf
install_kresd_conf = get_option('install_kresd_conf') == 'enabled'
if get_option('install_kresd_conf') == 'auto'
- if run_command(['test', '-r', etc_dir / 'kresd.conf']).returncode() == 1
+ if run_command(['test', '-r', etc_dir / 'kresd.conf'], check: false).returncode() == 1
install_kresd_conf = true
endif
endif
# check git submodules were initialized
lua_ac_submodule = run_command(['test', '-r',
- '@0@/lua-aho-corasick/ac_fast.cxx'.format(meson.current_source_dir())])
+ '@0@/lua-aho-corasick/ac_fast.cxx'.format(meson.current_source_dir())],
+ check: false)
if lua_ac_submodule.returncode() != 0
error('run "git submodule update --init --recursive" to initialize git submodules')
endif
## config tests
if build_config_tests
message('--- config_tests dependencies ---')
- cqueues = run_command('luajit', '-l', 'cqueues', '-e', 'os.exit(0)') # luajit -l $(1) -e "os.exit(0)"
+ cqueues = run_command('luajit', '-l', 'cqueues', '-e', 'os.exit(0)', check: false) # luajit -l $(1) -e "os.exit(0)"
if cqueues.returncode() != 0
error('missing luajit package: cqueues')
endif
- basexx = run_command('luajit', '-l', 'basexx', '-e', 'os.exit(0)') # luajit -l $(1) -e "os.exit(0)"
+ basexx = run_command('luajit', '-l', 'basexx', '-e', 'os.exit(0)', check: false) # luajit -l $(1) -e "os.exit(0)"
if basexx.returncode() != 0
error('missing luajit package: basexx')
endif
- ffi = run_command('luajit', '-l', 'ffi', '-e', 'os.exit(0)') # luajit -l $(1) -e "os.exit(0)"
+ ffi = run_command('luajit', '-l', 'ffi', '-e', 'os.exit(0)', check: false) # luajit -l $(1) -e "os.exit(0)"
if ffi.returncode() != 0
error('missing luajit package: ffi')
endif
endif
foreach py3_dep : py3_deps
- py3_import = run_command(python3, '-c', 'import @0@'.format(py3_dep[0]))
+ py3_import = run_command(python3, '-c', 'import @0@'.format(py3_dep[0]), check: false)
if py3_import.returncode() != 0
error('missing python3 dependency: @0@'.format(py3_dep[1]))
endif