[balsa] meson.build: Be careful with run_command()



commit 4f8199ed5f3e60686200bdd4ee6f2292875b9b83
Author: Peter Bloomfield <PeterBloomfield bellsouth net>
Date:   Fri Jun 3 18:38:41 2022 -0400

    meson.build: Be careful with run_command()
    
    See https://github.com/mesonbuild/meson/issues/9300
    
    In some future version of meson, the `check` kwarg of `run_command()`
    will default to `true` instead of `false`, meaning that `meson` will
    error out if the command fails. When we check `.returncode()`, we don't
    want that to happen, so explicitly set `check: false`. If we don't use
    `.returncode()`, we expect the command to succeed, so allowing `meson`
    to error out should be desirable.

 meson.build | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
---
diff --git a/meson.build b/meson.build
index 601650cbd..033bc7092 100644
--- a/meson.build
+++ b/meson.build
@@ -6,7 +6,8 @@ project('balsa', 'c',
 # if meson is used not in a git source tree, use project version:
 balsa_version = meson.project_version()
 
-balsa_from_git = run_command('sh', '-c', 'test -d ${MESON_SOURCE_ROOT}/.git').returncode() == 0
+balsa_from_git = run_command('sh', '-c', 'test -d ${MESON_SOURCE_ROOT}/.git',
+                             check: false).returncode() == 0
 
 if balsa_from_git
   git_describe = run_command('git', 'describe', '--tags')
@@ -183,7 +184,8 @@ if html_widget == 'webkit2'
       description : 'Path to html2text program.')
     conftest_htm = join_paths(meson.current_build_dir(), 'conftest.htm')
     run_command('sh', '-c', 'echo "<html/>" > ' + conftest_htm)
-    unicode_snob = run_command(html2text.path(), '--unicode-snob', conftest_htm)
+    unicode_snob = run_command(html2text.path(), '--unicode-snob', conftest_htm,
+                               check: false)
     if unicode_snob.returncode() == 0
       conf.set('HTML2TEXT_UCOPT', 1,
         description : 'Defined when HTML2TEXT accepts the --unicode-snob option.')


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]