]> git.ipfire.org Git - thirdparty/knot-resolver.git/commitdiff
meson nit: deal with warning about future of run_command
authorVladimír Čunát <vladimir.cunat@nic.cz>
Mon, 30 May 2022 11:48:16 +0000 (13:48 +0200)
committerVladimír Čunát <vladimir.cunat@nic.cz>
Wed, 1 Jun 2022 08:10:41 +0000 (10:10 +0200)
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.

daemon/lua/meson.build
doc/meson.build
etc/config/meson.build
modules/policy/meson.build
tests/meson.build

index 410cb0233f86eab1e775e573b71c2b8c02964dba..c5f4df090c0a622d0b46d40c3073ba2e11058da9 100644 (file)
@@ -87,7 +87,7 @@ if get_option('kres_gen_test') and not meson.is_cross_build()
     '''.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())
index e64d8e93708cac0f5e2606917e799fe20348f302..72a8a7b03cb003685b90e7d22cc27539619b02aa 100644 (file)
@@ -4,7 +4,7 @@
 # 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'
@@ -30,20 +30,20 @@ if get_option('doc') == '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
index a4a9c500b3eecc19b85291fa6ecc2f5de29c6726..ca888084913709cd272bf094a6caf55fc686fd59 100644 (file)
@@ -21,7 +21,7 @@ install_data(
 # 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
index fd51b0fdac46fcaebf729a5f3d5ac478dcde18d6..37f168399727aeff3000cb8793c9a0a0c804394b 100644 (file)
@@ -19,7 +19,8 @@ integr_tests += [
 
 # 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
index 1647b30f1abedc8589cf648c3434aff6b43e9e5a..818169dfcb24d5d9cdaf17fbf7479f8faeeb086f 100644 (file)
@@ -22,15 +22,15 @@ 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
@@ -52,7 +52,7 @@ if build_extra_tests
   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